query
stringlengths
7
5.25k
document
stringlengths
15
1.06M
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Remove an item from a store's stock.
public function action_item_remove(Request $request, Response $response) { $values = $request->query(); $restock = ORM::factory('Store_Restock', $values['restock_id']); if(!$restock->loaded()) { RD::set(RD::ERROR, 'No restock record found.'); } else { $restock->delete(); RD::set(RD::SUCCESS, 'Item successfully removed from the store\'s stock'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function removeItem(string $sku): Cart;", "public function remove($item);", "public function clearStockTransaction() {\n// $stockItemClass = Mage::app()->getConfig()->getModelClassName('cataloginventory/stock_item');\n// $productClass = Mage::app()->getConfig()->getModelClassName('catalog/product');\n//\n// if ( !Mage::registry(self::REGISTRY_TXN_KEY) ) {\n// $this->_initTransactionRegistry();\n// return Mage::registry(self::REGISTRY_TXN_KEY);\n// }\n//\n// return Mage::registry(self::REGISTRY_TXN_KEY)->removeItemByKey($id);\n Mage::unregister(self::REGISTRY_KEY_TRANSACTION);\n }", "public function removeItem(OrderItem $item);", "public function removeItem(Cart $cart, CartItem $item);", "public function remove($item) {\n unset($this->items[$item->id()]);\n }", "abstract public function removeItem($name);", "public function remove($item)\n {\n return $this->removeWhen(\n function ($storedItem) use ($item) {\n return $storedItem === $item;\n }\n );\n }", "public function remove()\n {\n $key = $this->request->param('ID');\n $title = \"\";\n\n if (!empty($key)) {\n foreach ($this->items as $item) {\n if ($item->Key == $key) {\n $title = $item->Title;\n $this->items->remove($item);\n }\n }\n\n $this->save();\n \n if ($title) {\n $this->setSessionMessage(\n \"bad\",\n _t(\n \"Checkout.RemovedItem\",\n \"Removed '{title}' from your cart\",\n \"Message to tell user they removed an item\",\n array(\"title\" => $title)\n )\n );\n }\n }\n\n return $this->redirectBack();\n }", "public function destroySaveLater($item){\n\n Cart::instance('saveForLater')->remove($item);\n return back()->with('success_message','Item was removed !');\n }", "public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}", "function remove($item) {\n\t\t\t$numItems = count($this->items);\n\n\t\t\tfor($i = 0; $i < count($this->items); $i++) {\n\t\t\t\t$_item = $this->items[$i];\n\n\t\t\t\t// grab the last item's value, overwrite it \n\t\t\t\t// to the found item, then pop it off the stack\n\t\t\t\tif($_item->equals($item)) {\n\t\t\t\t\t$this->items[$i] = $this->items[$numItems - 1];\n\t\t\t\t\tarray_pop($this->items);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public function remove($fruit) {\r\n // We get the number of $fruit in the basket\r\n // -1 to qty\r\n // Update value in basket\r\n\r\n $qty = $this->get($fruit);\r\n $this->itemQtyArr[$fruit] = $qty - 1;\r\n }", "public function testRemoveItem()\n {\n $item = $this->addItem();\n\n $this->laracart->removeItem($item->getHash());\n\n $this->assertEmpty($this->laracart->getItem($item->getHash()));\n }", "function removeItem($item){\n\t\tif( $item instanceof cacheItem)\n\t\t\t$item = $item->name;\n\t\tcacheItem::dropInstance($item);\n\t\treturn $this->db->delete(self::$tableName,array('WHERE name=?',$item));\n\t}", "public function removeItem($id){\n $cart = Session::get('cart');\n unset($cart->items[$id]);\n $itemTotal = $this->items[$id]['price'] * $this->items[$id]['qty'];\n $cart->totalPrice -= $itemTotal;\n $cart->totalQty -= $this->items[$id]['qty'];\n if($cart->totalQty <= 0){\n Session::flush();\n } else {\n Session::put('cart', $cart);\n }\n }", "public function removeItem($key);", "private function removeItem($id){\n $this->totalQty -= $this->items[$id]['qty'];\n $this->totalPrice -= $this->items[$id]['price'];\n unset($this->items[$id]);\n }", "public function remove_item($data)\n {\n $required = array(\n 'id' => 'Cart item id not passed',\n );\n $this->di['validator']->checkRequiredParamsForArray($required, $data);\n\n $cart = $this->getService()->getSessionCart();\n\n return $this->getService()->removeProduct($cart, $data['id'], true);\n }", "public function removeItem ( $item ) {\n\n if ( is_object( $item ) ) {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Object: ' . $item->getIdentifier() );\n } else {\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Identifier: ' . $item );\n }\n\n\n $item = is_object( $item ) ? $item : $this->getOrder()->getItem( $item );\n\n $orderApi = new OrdersApi( );\n\n\n//\t\tdie(print_r($this->getOrder()->getItems(),true));\n //TODO: Check if the item exists, we have to remove it and add the new one.\n if ( $this->getOrder()->itemExists( $item->getIdentifier() ) ) {\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Item found: ' . $item->getIdentifier() );\n\n $orderApi->removeItem( $this->order, $item );\n\n \\Maven\\Loggers\\Logger::log()->message( 'Maven/Cart/removeItem: Updating order after item removed: ' . $item->getIdentifier() );\n $this->update();\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item removed sucessfully', $this->order );\n }\n\n return Message\\MessageManager::createSuccessfulMessage( 'Item not found', $this->order );\n }", "public function testRemoveItem()\n {\n $cart = new Cart(['foo']);\n $cart->removeItem('foo');\n $this->assertEquals([], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 3]);\n $cart->removeItem(3);\n $this->assertEquals(['bar', 'foo', 'horse'], $cart->getItems());\n\n $cart = new Cart(['foo', 'bar', 'horse', 'bar', 'horse', 3]);\n $cart->removeItem('foo');\n $this->assertEquals(['bar', 'bar', 'horse', 'horse', 3], $cart->getItems());\n }", "public function removeItem($index) {\n $this->sessionCart->removeItem($index);\n }", "public function remove($id)\n {\n\t\t$item = $this->getItem($id);\n \t$cart = $this->session->get(self::SHOPPINGCART);\n $this->session->forget(self::SHOPPINGCART);\n for($i=0;$i<sizeof($cart);$i++)\n {\n if($cart[$i] == $item)\n {\n continue;\n }\n $this->session->push(self::SHOPPINGCART,$cart[$i]);\n }\n \n \tfor($i=0;$i<sizeof($this->items);$i++)\n {\n if($this->items[$i] == $item)\n {\n unset($this->items[$i]);\n }\n }\n }", "public function remove($item) {\n $index = self::IndexOf($item);\n self::RemoveAt($index);\n }", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function removeItem(int $itemId): bool;", "public function unsetInStockStockItems()\n {\n $this->_inStockStockItems = null;\n }", "public function removeAction()\n {\n if (!$this->_isActive()\n || !$this->_getHelper()->isRemoveItemAllowed()) {\n $this->norouteAction();\n return;\n }\n\n if ($this->_expireAjax()) {\n return;\n }\n\n $result = array();\n\n $quoteItem = $this->getOnepage()->getQuote()->getItemById(\n $this->getRequest()->getPost('item_id')\n );\n\n if ($quoteItem) {\n try {\n $this->getOnepage()->getQuote()\n ->removeItem($quoteItem->getId());\n \n $this->_recalculateTotals();\n $result['success'] = true;\n /**\n * When cart is ampty - redirect to empty cart page\n */\n if(!$this->getOnepage()->getQuote()->getItemsCount()){\n $result['redirect'] = Mage::helper('checkout/cart')->getCartUrl();\n }\n } catch (Mage_Core_Exception $e) {\n $result['error'] = $e->getMessage();\n } catch (Exception $e) {\n Mage::logException($e);\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('There was an error during removing product from order');\n }\n } else {\n $result['error'] = Mage::helper('ecomdev_checkitout')->__('Product was not found');\n }\n\n $this->_addHashInfo($result);\n $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result));\n }", "public function removeItemFromCartById($itemModelNum)\n {\n if ( !empty($this->cartItems) )\n {\n $i = 0;\n foreach ( $this->cartItems as $item )\n {\n if ( $item )\n {\n if ( $item->getModelNumber() == $itemModelNum )\n {\n unset($this->cartItems[i]);\n break;\n }\n $i++;\n }\n }\n }\n else\n {\n echo \"Cart is empty. Cannot Remove\";\n }\n Cart::updateTotalPrice();\n }", "public function remove(String $storeKey) {\n\n\t\tunset($this->__store[$storeKey]);\n\n\t}", "public function deleteItemsFromStock()\n {\n $id = $this->request->id;\n try {\n $item = new ItemService();\n $result = $item->deleteItemsFromStockById($id);\n if ($result) {\n return response()->json([\n 'success' => true,\n 'message' => 'Item Deleted'\n ], 204);\n }\n return response()->json([\n 'success' => false,\n 'message' => 'item not found'\n ], 404);\n } catch (Exception $ex) {\n var_dump($ex->getMessage());\n return response()->json([\n 'success' => false,\n 'message' => 'Error Occured deleting Items. Ensure the IDs are Valid'\n ], 400);\n }\n }", "function stockDecrement($product, $quantity)\n{\n\tinclude 'setup.php';\n\n\tclearstatcache();\n\tif(file_exists($STOCKFILE) && is_readable($STOCKFILE) && filesize($STOCKFILE) > 0)\n\t{\n\t\t$handle = fopen($STOCKFILE, \"r+\");\n\t\tflock($handle, 2);\t// get an exclusive lock\n\n\t\t$stocks = unserialize(fread($handle, filesize($STOCKFILE)));\n\t\tif($stocks == FALSE)\n\t\t{\n\t\t\t$retval = -2;\t// error reading stocks\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif(($stocks[$product][instock] - $quantity) < 0)\n\t\t\t{\n\t\t\t\t$retval = -1;\t// not enough available\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$stocks[$product][instock] -= $quantity;\n\t\t\t\t$retval = $stocks[$product][instock];\n\t\t\t\t$stocks[$product][sold] += $quantity;\n\n\t\t\t\trewind($handle);\n\t\t\t\tif(fwrite($handle, serialize($stocks), strlen(serialize($stocks))) == FALSE)\n\t\t\t\t\t$retval = -2;\t// error storing new stock amounts\n\t\t\t}\n\t\t}\n\n\t\tflock($handle, 3);\t// release lock again\n\t\tfclose($handle);\n\t}\n\telse\n\t\t$retval = -1;\n\n\treturn $retval;\n}", "function removeItem($itemKey){\n\n\t\t\tif(isset($this->items[$itemKey])){\n\t\t\t\t//remove the item from the cart including all of its quantity\n\t\t\t\tunset($this->items[$itemKey]);\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t//code for if the items should be removed 1 item at a time \n\t\t\t\t$this->items[$itemKey]['quantity'] = $this->items[$itemKey]['quantity'] - 1;\n\t\t\t\tif($this->items[$itemKey]['quantity'] == 0){\t\n\t\t\t\t\tunset($this->items[$itemKey]);\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t}\n\n\t\t\treturn;\n\t\t}", "public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}", "public function removeNamedItem($name) { }", "public function remove(Buyable $buyable): void\n {\n $this->items->forget($this->getItemId($buyable));\n\n $this->save();\n }", "static function removeItem( $itemID )\n {\n $item = eZProductCollectionItem::fetch( $itemID );\n $item->remove();\n }", "public function removeItemFromCart($itemId)\n {\n $client = new GuzzleHttp\\Client();\n $res = $client->get($this->_link . '/removeItemApi/' . $itemId);\n $cartItems = json_decode($res->getBody());\n return redirect('/cart');\n }", "public function remove (Item $item): void\n {\n foreach ($this->equippedItems as $key => $entity) {\n if ($item->getId() === $entity->getId()) {\n unset($this->equippedItems[$key]);\n break;\n }\n }\n }", "public function destroy(Stock $stock)\n {\n //\n }", "public function destroy(Stock $stock)\n {\n //\n }", "public function removeFromCart() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'] = array_splice($_SESSION['cart'], $count, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}", "public function deleteItem($item);", "public function removeProduct(Product $product): CurrentCart;", "public function deleteById($stockistId);", "function decreaseStock($quantity)\n {\n global $objDatabase;\n \n $query = \"\n UPDATE \".DBPREFIX.\"module_shop\".MODULE_INDEX.\"_products\n SET stock=stock-$quantity\n WHERE id=$this->id\n AND distribution='delivery'\";\n return (boolean)$objDatabase->Execute($query);\n }", "public function removeItem($itemHash)\n {\n foreach ($this->items as $itemKey => $item) {\n if ($item->getHash() == $itemHash) {\n unset($this->items[$itemKey]);\n break;\n }\n }\n\n \\Event::fire('laracart.removeItem', $itemHash);\n }", "public function destroy($item)\n {\n // dd($item);\n Cart::remove($item);\n return back()->with('success_message','Item was deleted ');\n }", "public function delete_product_stock($id) {\n $repository = new IM_Product_Warehouse_Repository();\n $repository->deleteByProductID($id);\n }", "function item_delete()\n {\n $key = $this->get('id');\n $this->supplies->delete($key);\n $this->response(array('ok'), 200);\n }", "function removeProduct(Product $product){\n \t$this->myCart->remove($product);\n }", "public function remove_item($item_id) \n\t{\n\t\tif($this->cart[$item_id] == 1)\n\t\t{\n\t\t\tunset($this->cart[$item_id]);\n\t\t}\n\t\telse if(isset($this->cart[$item_id]))\n\t\t{\n\t\t\t$this->cart[$item_id]--;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn \"Item not found\";\n\t\t}\n\t\tSession::set('cart', $this->cart);\n\t\treturn true;\n\t}", "public function destroy($itemId, $stockId)\n {\n $item = $this->inventory->findOrFail($itemId);\n\n $stock = $item->stocks()->findOrFail($stockId);\n\n return $stock->delete();\n }", "public function removeItem($itemHash, $withEvent = true)\n {\n $item = $this->getItem($itemHash);\n\n if ($withEvent) {\n $event = $this->fireEvent('cart.item.removing', [$item]);\n\n if (false === $event) {\n return $this;\n }\n }\n\n $cart = $item->getCart();\n $this->forget($itemHash);\n\n if ($withEvent) {\n $this->fireEvent('cart.item.removed', [$itemHash, clone $cart]);\n }\n\n return $this;\n }", "public function remove(ProductInterface $product);", "public function removeFromCart(CartItemRepository $model)\n {\n return null;\n }", "public function removeItem($item)\n {\n $this->items = array_values(array_diff($this->items, array($item)));\n }", "public function removeProductStocks($product_id)\n {\n $this->db->query(\n 'UPDATE ?:products SET is_stock_split_by_warehouses = ?s'\n . ' WHERE product_id = ?i AND is_stock_split_by_warehouses = ?s',\n YesNo::NO,\n $product_id,\n YesNo::YES\n );\n\n $this->db->query('DELETE FROM ?:warehouses_products_amount WHERE product_id = ?i', $product_id);\n $this->db->query('DELETE FROM ?:warehouses_destination_products_amount WHERE product_id = ?i', $product_id);\n }", "public function removeItem($item)\n {\n return $this->setItems(\n array_diff($this->getItems(), array($item))\n );\n }", "private function removePlaylistItem()\n {\n try\n {\n $request = $_REQUEST;\n\n if( !isset($request['playlist_item_id']) || $request['playlist_item_id']==\"\" )\n throw_error_msg(\"playlist item id not provided\");\n \n if( !is_numeric($request['playlist_item_id']) )\n throw_error_msg(\"invalid playlist item id\");\n\n $id = (int)$request['playlist_item_id'];\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\"));\n\n global $cbvid; \n\n $cbvid->action->delete_playlist_item($id);\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n\n if( msg() )\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'item has been removed from playlist successfully', \"data\" => array());\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }", "static function remove($item){\n\t\tself::init();\n\t\tif( is_array($item)){\n\t\t\tforeach($item as $i)\n\t\t\t\tself::remove($i);\n\t\t\treturn;\n\t\t}\n\t\tself::$backend->removeItem($item);\n\t\tcacheItem::dropInstance($item);\n\t}", "public function removeItemFromCart( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->select('quantity')->from(TABLES::$ORDER_CART)->where($params);\r\n\t\t\t$query = $this->db->get();\r\n\t\t\t$result = $query->result_array();\r\n\t\t\tif(count($result) > 0) {\r\n\t\t\t\tif ($result[0]['quantity'] <=1 ) {\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->delete(TABLES::$ORDER_CART);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$quantity = $result[0]['quantity'];\r\n\t\t\t\t\t$qty = array();\r\n\t\t\t\t\t$qty['quantity'] = $quantity - 1;\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "abstract function del ($item);", "public function removeStock(array $stock) {\n\t\t$stock = $this->_normaliseStock($stock, false);\n\t\t$this->ShopBranchStockLog->create();\n\t\tif (!$this->ShopBranchStockLog->saveAll($stock)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->updateStock($stock);\n\t}", "public function removeAction() {\r\n $response = Mage::getModel('ajaxcartpro/ajaxresponse');\r\n $id = $this->getRequest()->getParam('id');\r\n Mage::getSingleton('checkout/cart')->removeItem($id)->save();\r\n $response->setCart(Mage::helper('ajaxcartpro')->rendercartpageUpdate());\r\n $response->setSidebar(Mage::helper('ajaxcartpro')->cartItemssidebar());\r\n $response->setLinks(Mage::helper('ajaxcartpro')->topLinkTitle());\r\n $response->send();\r\n }", "public function action_removeCartItem()\n {\n $cartItemId = $this->request->post('cartItemId');\n\n if(!is_null($cartItemId))\n {\n try\n {\n $modelCartItem = new Model_CartItemInfo();\n $modelCartItem->removeItem($cartItemId);\n\n $this->redirect('cart/index');\n }\n catch (Exception $e)\n {\n $this->request->status = 400;\n $this->request->response = View::factory('errors/400');\n }\n }\n else\n {\n $this->request->status = 406;\n $this->request->response = View::factory('errors/406');\n }\n }", "public function DeleteAction()\n {\n\n \t//Supprime le mouvement\n \t$sm_id = $this->getRequest()->getParam('sm_id');\n \t$sm = mage::getModel('Purchase/StockMovement')->load($sm_id);\n \t$product_id = $sm->getsm_product_id();\n \t$sm->delete();\n \t\t\n \t//Met a jour le stock du produit\n \tmage::getModel('Purchase/StockMovement')->ComputeProductStock($product_id);\n \t\n \t//Redirige sur la fiche produit\n \t$this->_redirect('Purchase/Products/Edit/product_id/'.$product_id);\n \t\n }", "public function subtractOrderedItemsFromStock($order)\r\n {\r\n \t$nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\r\n \t$isCustomStockManagementEnabled = Mage::getModel('paymentsensegateway/direct')->getConfigData('customstockmanagementenabled');\r\n \t\r\n \tif($nVersion >= 1410 &&\r\n \t\t$isCustomStockManagementEnabled)\r\n \t{\r\n\t \t$items = $order->getAllItems();\r\n\t\t\tforeach ($items as $itemId => $item)\r\n\t\t\t{\r\n\t\t\t\t// ordered quantity of the item from stock\r\n\t\t\t\t$quantity = $item->getQtyOrdered();\r\n\t\t\t\t$productId = $item->getProductId();\r\n\t\t\t\t\r\n\t\t\t\t$stock = Mage::getModel('cataloginventory/stock_item')->loadByProduct($productId);\r\n\t\t\t\t$stockManagement = $stock->getManageStock();\r\n\t\t\t\t\r\n\t\t\t\tif($stockManagement)\r\n\t\t\t\t{\r\n\t\t\t\t\t$stock->setQty($stock->getQty() - $quantity);\r\n\t\t\t\t\t$stock->save();\r\n\t\t\t\t}\r\n\t\t\t}\r\n \t}\r\n }", "public function takeFromStock($quantity = 1) {\n $this->leftInStock = $this->leftInStock - $quantity;\n $this->save();\n }", "public static function removeSubshop()\n {\n /** @var Connection $dbal */\n $dbal = Shopware()->Container()->get('dbal_connection');\n $dbal->exec('DELETE FROM s_core_shops WHERE id=3');\n }", "function soldStock($product_id, $count=1) {\n\t\t\t$product=$this->findById($product_id);\n\t\t\t\n\t\t\tif ($product['Product']['stock']) {\n\t\t\t\t$product['Product']['stock_number']--;\n\t\t\t\t\n\t\t\t\t$this->Save($product);\n\t\t\t}\n\t\t}", "function remove()\n {\n $gameId = $this->registry->params[0];\n\n if (isset($gameId, $_SESSION['cart'])) {\n Util::deleteElement($gameId, $_SESSION['cart']);\n }\n\n $count = 0;\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n $count++;\n if ($_SESSION['cart'][$index][0] == $gameId) {\n unset($_SESSION['cart'][$index]);\n }\n }\n if($count == 0){\n unset($_SESSION['cart']);\n }\n\n header(\"Location: /cart\");\n }", "function sell($amount,$symbol){\n //user should be the owner of the stock if he wants to sell\n if($symbol==\"Book\" && $this->bookstock_buy>0){\n echo $this->new_account.\" sold Book Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->bookstock_buy--;\n $this->object_linkedlist->remove_last();\n }\n elseif($symbol==\"Newspaper\" && $this->newspaperstock_buy>0){\n echo $this->new_account.\" sold Newspaper Stock\\n\";\n echo \"Transaction Time:\";\n echo date('Y-m-d H:i:s').\"\\n\";\n echo \"Total balance of \".$this->new_account.\" is:\".$this->totalamount.\"\\n\";\n $this->newspaperstock_buy--;\n $this->object_linkedlist->remove_last();\n }\n }", "public function removeItem()\n\t{\n\t\t$this->autoRender = false;\n\t\t$this->layout = false;\n\t\t$id = \"\";\n\t\tif($this->request->is(array('POST')))\n\t\t{\n\t\t\t$data = $this->request->data;\n\t\t\t$cateId = $data['cate_id'];\n\t\t\t$row = $data['row'];\n\t\t\t$id= '';\n\t\t\tif($this->Session->check('item_'.$cateId))\n\t\t\t{\n\t\t\t\t$itemId = $this->Session->read('item_'.$cateId);\n\t\t\t\tif(!empty($itemId))\n\t\t\t\t{\n\t\t\t\t\t$i = $row*2 -2;\n\t\t\t\t\tif(isset($itemId[$i+1]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i+1]);\n\t\t\t\t\t}\n\t\t\t\t\tif(isset($itemId[$i]))\n\t\t\t\t\t{\n\t\t\t\t\t\tunset($itemId[$i]);\n\t\t\t\t\t}\n\t\t\t\t\t$this->Session->write('item_'.$cateId,$itemId);\n\t\t\t\t\t$id = implode(',',$itemId);\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\techo $id;\n\t\t\texit;\n\t}", "function delete_product_item($id){\n $this->delete($id);\n }", "public function destroy($id)\n\t{\n\t\t$stock = Stock::find($id);\n\t\t$product_id = $stock->product_id;\n\t\tStock::destroy($id);\n\t\t\n\t\t// Update product stock\n\t\tProduct::updateInStock($product_id);\n\n\t\tSession::flash('delete', 'Stock deleted');\n\t\treturn Redirect::to('stock');\n\t}", "public function removeCartItem($rowId){\n if(!$rowId)\n throw new \\Exception('bad rowId');\n\n return Cart::remove($rowId);\n }", "public function removeItem( $wishlistitem_hash )\r\n {\r\n $exists = false;\r\n foreach ( $this->items as $key => $item )\r\n {\r\n if ($item['hash'] == $wishlistitem_hash)\r\n {\r\n $exists = true;\r\n unset( $this->items[$key] );\r\n \r\n break;\r\n }\r\n }\r\n \r\n if ($exists)\r\n {\r\n $this->save();\r\n }\r\n \r\n return $this;\r\n }", "public function remove(string $name = '')\n {\n if ('' === $name) {\n unset($this->items);\n return;\n }\n \n if (isset($this->items[$name])) {\n unset($this->items[$name]);\n }\n }", "public function dropItem(Zbozi $product, ?ZboziVarianta $variant = null)\r\n {\r\n $this->getItem($product, $variant)->delete();\r\n }", "public function deleteAction() {\r\n $id = (int) $this->getRequest()->getParam('id');\r\n if ($id) {\r\n try {\r\n $this->_getCart()->removeItem($id)\r\n ->save();\r\n } catch (Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot remove the item.'));\r\n $_response->send();\r\n\r\n Mage::logException($e);\r\n }\r\n }\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n\r\n $_response->setMessage($this->__('Item was removed.'));\r\n\r\n //append updated blocks\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n $_response->addUpdatedBlocks($_response);\r\n\r\n $_response->send();\r\n }", "public function remove($id)\n {\n $this->loadItems();\n if (array_key_exists($id, $this->items)) {\n unset($this->items[$id]);\n }\n $this->saveItems();\n }", "public function delete()\n {\n $this->_checkItem();\n\n $service = $this->getService();\n $entry = $service->getGbaseItemEntry( $this->getItem()->getGbaseItemId() );\n return $service->deleteGbaseItem($entry, $this->getDryRun());\n }", "public function deleteItem($key);", "public function deleteItem(Item $item) {\n\t\t$id = $item->getId();\n unset($this->items[$id]);\n }", "public function drop () {\n\t\tif ($this->oStore->isSetUp()) {\n\t\t\t$this->oStore->drop();\n\t\t}\n\t}", "function removeItem() {\r\n \tglobal $itemsArray;\r\n\r\n\tif (isset( $_GET[\"itemId\"] )){\r\n\t$itemId = (int)$_GET[\"itemId\"];\r\n\t$price = $_GET[\"price\"];\r\n\r\n\tif ( isset( $_SESSION[\"cart\"][$itemId] ) ) {\r\n\t\tunset( $_SESSION[\"cart\"][$itemId] );\r\n\t}\r\n\r\n\t$_SESSION[\"nuOfItems\"] = $_SESSION[\"nuOfItems\"]-1; //decrements the number of items in the cart \r\n\t$_SESSION[\"total\"] = $_SESSION[\"total\"]-$price; //decrement current total price by the price recived from the URL\r\n}\r\nsession_write_close();\r\n}", "public function deleteStock($id,$quantite)\n {\n $produit = $this->em->getRepository(\"AppBundle:Produit\")->findOneBy(['id'=>$id]);\n if ($produit){\n $stock = $produit->getStock() - $quantite;\n $produit->setStock($stock);\n $this->em->flush();\n\n return true;\n }else{\n return false;\n }\n }", "public function remove()\n {\n return $this->session->remove('cart');\n }", "public function remove($key)\n {\n unset($this->items[$key]);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function rmhouse($itemid){\n $api = new Api();\n $api->rmitem($itemid);\n $itemid = mysql_real_escape_string( $itemid);\n $sql = \"delete FROM house where itemid='$itemid'\";\n mysql_query($sql);\n }", "public function removeitem(Request $request) {\n Cart::remove([\n 'id' => $request->id,\n ]);\n return back()->with('success',\"Producto eliminado con éxito de su carrito.\");\n }", "public function removeOrder(OrderInterface $order)\n\t{\n\t\t// restore stock and move item back to cart\n\t\tforeach ($order->getOrderLines() as $line) {\n\t\t\t$product = $line->getPurchasable();\n\t\t\t$stock = $product->getStock();\n\t\t\t$this->purchasableManager->updateProductStock($product->getId(), $stock + $line->getQuantity());\n\t\t}\n\n\t\t// set order invalid\n\t\t$this->updateExtRecord($order, '', 0);\n\n\t\t// return item to cart\n\t\t$this->best365CartManager->recoverCartByOrder($order);\n\t}", "public function rmbook($itemid){\n \n $api = new Api();\n $api->rmitem($itemid);\n $itemid = mysql_real_escape_string( $itemid);\n $sql = \"delete FROM book where itemid='$itemid'\";\n mysql_query($sql);\n \n }", "public function remove($rowid = null)\n\t{\n\t\t// Check if we have an id passed.\n\t\t//\n\t\tif (is_null($rowid))\n\t\t{\n\t\t\tthrow new CartInvalidItemRowIdException;\n\t\t}\n\n\t\t// Try to remove the item.\n\t\t//\n\t\tif ($this->update(array('rowid' => $rowid, 'qty' => 0)))\n\t\t{\n\t\t\t// Success, item removed.\n\t\t\t//\n\t\t\treturn true;\n\t\t}\n\n\t\t// Something went wrong.\n\t\t//\n\t\tthrow new CartException;\n\t}", "public function removeCartItem($itemId){\r\n\t\tfor($i=0;$i<(count($this->cart_items));$i++){\r\n\t\t\tif($this->cart_items[$i]->itemId==$itemId){\r\n\t\t\t\tunset($this->cart_items[$i]);\r\n\t\t\t\t$this->cart_items = array_values($this->cart_items);\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "function delete($product)\n {\n if (array_key_exists($product->id, $this->items)) {\n $storeProductDelete = $this->items[$product->id];\n //giam tien\n $this->totalPrice -= $storeProductDelete['price'];\n //giam so luong\n $this->totalQuantity -= $storeProductDelete['quantity'];\n // xoa phan tu o vi tri $product->id\n unset($this->items[$product->id]);\n }\n }", "function eliminaStock($codigo)\r\n{\r\n $link=conectar();\r\n $sql=\"DELETE FROM producto_ubicacion WHERE pu_id ='$codigo'\";\r\n $res=mysql_query($sql,$link) or die(\"Error en: $sql: \" . mysql_error());\r\n if(mysql_affected_rows()>0)\r\n {\r\n return '1';\r\n }\r\n mysql_close($link);\r\n}", "public function remove($itemId, $synchronize = false) {\r\n if (!isset($itemId)) {\r\n return false;\r\n }\r\n if ($synchronize && $this->user->profile['userid'] !== -1) {\r\n if (isset($this->items[$itemId])) {\r\n unset($this->items[$itemId]);\r\n }\r\n return $this->user->context->dbDriver->remove(RestoDatabaseDriver::CART_ITEM, array('email' => $this->user->profile['email'], 'itemId' => $itemId));\r\n }\r\n else if (isset($this->items[$itemId])) {\r\n unset($this->items[$itemId]);\r\n return true;\r\n }\r\n \r\n return false;\r\n }" ]
[ "0.679734", "0.6533454", "0.64882594", "0.64102197", "0.63687485", "0.6210717", "0.6152507", "0.61183125", "0.6115957", "0.6105898", "0.6068565", "0.6046272", "0.60171795", "0.6008523", "0.5975704", "0.5973731", "0.59717244", "0.59713745", "0.59648895", "0.59256136", "0.58610654", "0.5853415", "0.584802", "0.5842868", "0.5795139", "0.5793475", "0.5790901", "0.57875997", "0.578383", "0.57833475", "0.5776857", "0.57633543", "0.57627106", "0.574576", "0.57093704", "0.5706083", "0.56983864", "0.56778455", "0.56743133", "0.56703264", "0.56703264", "0.5669946", "0.5651264", "0.56452394", "0.564208", "0.5600278", "0.5588728", "0.5586659", "0.55843675", "0.55817914", "0.55763245", "0.55697364", "0.55376023", "0.5537169", "0.5530504", "0.5501032", "0.5480916", "0.5478808", "0.54769313", "0.5471843", "0.5460923", "0.54519653", "0.54471654", "0.5439099", "0.54388124", "0.5426691", "0.54151446", "0.54137546", "0.5406902", "0.54006594", "0.5387503", "0.53785235", "0.5377429", "0.53770643", "0.53734225", "0.53688824", "0.53637725", "0.5345507", "0.53336656", "0.5325455", "0.53230685", "0.5318297", "0.5311849", "0.5302084", "0.5293596", "0.52894026", "0.5288857", "0.5283796", "0.5277797", "0.52777964", "0.5257043", "0.52551466", "0.52307516", "0.52280545", "0.52264965", "0.5224603", "0.52239656", "0.52235955", "0.52198493", "0.5218145" ]
0.6587807
1
Static, once only constructor
public static function __once() { try { self::$environment = \Glue\Component\Environment::getInstance(); self::$path = self::$environment->get('path'); self::$node = '/' . self::$environment->get('node'); } catch(\Exception $exception) { throw new \RuntimeException(\Glue\Helper\General::replace(array('class' => __CLASS__), GLUE_EXCEPTION_CLASS_INITIALIZE), NULL, $exception); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "final private function __construct() {}", "final private function __construct() {}", "private final function __construct() {}", "final private function __construct() { }", "final private function __construct() { }", "final private function __construct() { }", "public static function __constructStatic() : void;", "protected final function __construct() {}", "private function __construct()\r\n {\r\n // Prevent direct instantiation\r\n }", "final private function __construct(){\r\r\n\t}", "function __constructor(){}", "function _construct(){ }", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "private function __construct() {}", "final private function __construct()\n {\n }", "final private function __construct()\n {\n }", "final private function __construct()\n\t{\n\t}", "final private function __construct() {\n\t\t\t}", "private function __construct () {}", "private function __construct()\t// Private to prevent object being instantiated outside class\r\n {\r\n // Do nothing\r\n }", "private function __construct() { // singleton\n }", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct(){}", "private function __construct()\r\n\t\t{\r\n\r\n\t\t\t/* Do Nothing */\r\n\r\n\t\t}", "private function __construct() { /* Do nothing here */ }", "private function __construct() { /* Do nothing here */ }", "function _construct() {\n \t\n\t\t\n\t}", "final private function __construct()\n {\n }", "public function __construct() {\n\t\tif ( self::$_instance ) {\n\t\t\t_doing_it_wrong( __FUNCTION__, 'Cheatin&#8217; huh?', '2.0' );\n\t\t}\n\t}" ]
[ "0.8213274", "0.8213274", "0.81530035", "0.79852897", "0.79852897", "0.79852897", "0.79839295", "0.7886951", "0.78454316", "0.7714863", "0.7689553", "0.7670618", "0.7625035", "0.7625035", "0.7624934", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.7624664", "0.75898933", "0.75898933", "0.75819415", "0.7581337", "0.75458544", "0.7543339", "0.74956506", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7472493", "0.7459924", "0.7454947", "0.7454947", "0.7453813", "0.74341244", "0.73992366" ]
0.0
-1
Magic method to allow registry access
public function __call($method, $arguments) { if(method_exists($this->registry, $method) === true) { return call_user_func_array(array(&$this->registry, $method), (array) $arguments); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function &get_registry()\n {\n }", "protected static function register() {}", "abstract public function register();", "abstract public function register();", "abstract public function register();", "public function loadRegistry();", "abstract public function register ( );", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function register();", "public function _register()\n {\n }", "protected function registered()\n {\n //\n }", "public function getRegistryAlias(): string;", "protected function getExtractorRegistry() {}", "public function set_registry(Registry $registry);", "public function register() {}", "public function registry()\n {\n if(!$this->defaultRegistry) {\n $this->defaultRegistry = $this('registry');\n }\n\n return $this->defaultRegistry;\n }", "function loadRegistry() {\n\t\t$reg = @include $this->path( 'var/Application Support/xoops_kernel_Xoops2/registry.php' );\n\t\tif ( !is_array($reg) || ( $this->xoRunMode & XO_MODE_DEV_MASK ) ) {\n\t\t\t$reg = include $this->path( \"$this->xoBundleRoot/scripts/rebuild_registry.php\" );\n\t\t}\n\t\t$GLOBALS['exxos']->registry = $reg;\n\t}", "public function register(){}", "abstract protected function registerHandlers();", "public static function registry()\n {\n\t\tif ( empty(self::$registry) ){\n\t\t\tself::$registry = new Registry();\n\t\t}\n\t\treturn self::$registry;\n\n }", "abstract public function Register();", "public function &__invoke()\r\n\t{\r\n\t\t$result = new stdClass();\r\n\t\tAdhoc::eachTrap('Registry',\r\n\t\t\tfunction ($trap) use (&$result)\r\n\t\t\t{\r\n\t\t\t\t$data =& $trap->GetList();\r\n\t\t\t\tforeach ($data as $k=>$v)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($result->$k) and isset($v))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result->$k = $v;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t\t\r\n\t\treturn $result;\r\n\t}", "public function customize_register()\n {\n }", "public function customize_register()\n {\n }", "static function getRegistry() {\n\t\tif ( self::$_Registry === false ) {\n\t\t\tself::$_Registry = new systemRegistry();\n\t\t}\n\t\treturn self::$_Registry;\n\t}", "public function __get($key)\n {\n return $this->registry->$key;\n\n }", "public function register(): void;", "public function register()\n\t{\n\t\t\n\t}", "function initRegister() {\r\n $register = new Zend_Registry(array(), ArrayObject::ARRAY_AS_PROPS);\r\n Zend_Registry::setInstance($register);\r\n }", "protected function registerSystem() { }", "public function register(){\n\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\r\n\t{\r\n\r\n\t}", "public function register()\n {\n parent::register();\n }", "public function register()\n {\n parent::register();\n }", "public function register()\n {\n parent::register();\n }", "public function register()\n {\n parent::register();\n }", "public function getParameterRegistry();", "public function register()\r\n {\r\n //\r\n\t}", "public function register(): array;", "public function register()\n\t{\n //\n\t}", "public function setRegistry()\n {\n $reg = controllers\\Registry::getInstance();\n foreach ($this->config as $key => $value)\n {\n $reg->setResource($key, $value, true);\n }\n\n\n }", "public abstract function registry(): CommandDescribe;", "abstract function register_data($register);", "abstract protected function registerFunctions();", "public function __clone()\r\n\t{\r\n\t\ttrigger_error( 'Cloning the registry is not permitted', E_USER_ERROR );\r\n\t}", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register()\n\t{\n\t}", "public function register()\r\n {\r\n \r\n }", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public function register()\n\t{\n\n\t}", "public static function register()\n {\n }", "public function register(): void\n {\n\n }", "private function __RegistryKey ( $key )\n\t {\n\t\t$key = str_replace ( '/', '\\\\', $key ) ;\n\n\t\tif ( strncasecmp ( $key, \"HK\", 2 ) )\n\t\t {\n\t\t\tif ( $key{0} != '\\\\' )\n\t\t\t\t$root = '\\\\' ;\n\t\t\telse\n\t\t\t\t$root = \"\" ;\n\n\t\t\t$key = \"HKCU\" . $root . $key ;\n\t\t }\n\n\t\treturn ( $key ) ;\n\t }\n\n\n\t// Reads a registry value\n\tpublic function RegistryRead ( $key )\n\t {\n\t\t$key = $this -> __RegistryKey ( $key ) ;\n\n\t\treturn ( $this -> ShellInstance -> RegRead ( $key ) ) ;\n\t }\n\n\n\t// Writes a registry value\n\tpublic function RegistryWrite ( $key, $value, $type = self::REG_SZ )\n\t {\n\t\t$key = $this -> __RegistryKey ( $key ) ;\n\n\t\treturn ( $this -> ShellInstance -> RegWrite ( $key, $value, $type ) ) ;\n\t }\n\n\n\t// Delete a registry value\n\tpublic function RegistryDelete ( $key )\n\t {\n\t\t$key = $this -> __RegistryKey ( $key ) ;\n\n\t\treturn ( $this -> ShellInstance -> RegDelete ( $key ) ) ;\n\t }\n }", "public static function get_type_registry()\n {\n }", "public function register(){\r\n\r\n }", "function get_registered_settings()\n {\n }", "public function afterRegistry()\n {\n // parent::afterRegistry();\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register()\r\n {\r\n //\r\n }", "public function register() { \n }", "protected function getRegistry() {\r\n if (!isset($this -> mReg)) {\r\n $this -> mReg = new CApp_Event_Action_Registry();\r\n }\r\n }", "public function registration_get(){\n }", "public function __clone()\n\t{\n\t\ttrigger_error('Cloning the registry is not permitted', E_USER_ERROR);\n\t}", "public function register()\n {\n }", "function registerPermissionMapping( $internal, $system );", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n //\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register(): void\n {\n }", "public function register() \n {\n \n\n }", "public function register()\r\n {\r\n }", "public function __get($_name);", "abstract protected function _regenerate();", "public function register()\n { }", "public function register() {\n\t}", "static public function getInstance(){\r\n if(self::$_instance === NULL){\r\n self::$_instance = new Registry;\r\n }\r\n return self::$_instance;\r\n }", "public function register()\n {\n //\n\t\t\n }", "public function register()\n\t{\n\t\t//\n\t}", "public function register()\n\t{\n\t\t//\n\t}", "public function register()\n\t{\n\t\t//\n\t}", "public function register()\n\t{\n\t\t//\n\t}" ]
[ "0.7423067", "0.73408884", "0.67322206", "0.67322206", "0.67322206", "0.665471", "0.6635395", "0.6568741", "0.6568741", "0.6568741", "0.6568741", "0.6568741", "0.6568741", "0.6568741", "0.6568741", "0.6550025", "0.65472955", "0.65039146", "0.6477578", "0.6339831", "0.63338214", "0.6259813", "0.6250768", "0.6207405", "0.61490947", "0.61407673", "0.611865", "0.6056988", "0.6043782", "0.6043782", "0.6040353", "0.60400605", "0.60288507", "0.60134", "0.59943616", "0.59785706", "0.597302", "0.59543204", "0.59543204", "0.59543204", "0.595384", "0.595384", "0.595384", "0.595384", "0.5952712", "0.59266734", "0.5892168", "0.5874824", "0.58688706", "0.58560383", "0.5848605", "0.58391386", "0.58249754", "0.5824525", "0.5824525", "0.5824525", "0.5824525", "0.58166355", "0.58035505", "0.58035505", "0.58035505", "0.58035505", "0.5800976", "0.57985884", "0.5786929", "0.57863593", "0.57725483", "0.57688665", "0.57534945", "0.574555", "0.574555", "0.574555", "0.574555", "0.5744246", "0.57427126", "0.5741796", "0.5737727", "0.57275593", "0.5714187", "0.57129264", "0.57129264", "0.57129264", "0.57129264", "0.57129264", "0.5704833", "0.5704833", "0.5704833", "0.5704833", "0.5704833", "0.5696762", "0.5696071", "0.56892174", "0.5682501", "0.5676396", "0.5674186", "0.5667117", "0.56501544", "0.5639604", "0.5639604", "0.5639604", "0.5639604" ]
0.0
-1
Method to load tree files
public function load($language, $scope = GLUE_SCOPE_ALL) { $language = (is_string($language)) ? (array) $language : $language; if(($result = \Glue\Helper\Validator::batch(array( '@$language' => array($language, 'isString'), '$scope' => array($scope, array('matchesBitmask', array(GLUE_SCOPE_ALL))) ))) !== true) { throw new \InvalidArgumentException(\Glue\Helper\General::replace(array('method' => __METHOD__, 'parameter' => $result), GLUE_EXCEPTION_PARAMETER)); } try { $this->dispatcher->notify(new \Glue\Event($this->id . '.load.pre', array($language))); $dependencies = array(); switch($scope) { case GLUE_SCOPE_GLOBAL: foreach($language as $code) { $dependencies[] = self::$path['global'] . '/.internationalization/tree/' . $code . '.xml'; } break; case GLUE_SCOPE_LOCAL: foreach($language as $code) { $dependencies[] = self::$path['local'] . '/.internationalization/tree/' . $code . '.xml'; } break; case GLUE_SCOPE_ALL: foreach(self::$path as $scope) { foreach($language as $code) { $dependencies[] = $scope . '/.internationalization/tree/' . $code . '.xml'; } } break; } $id = self::$path['local'] . '/.cache/' . __CLASS__ . '/' . sha1(serialize($language)); if(extension_loaded('apc') === true) { $cache = \Glue\Entity\Cache\Apc::getInstance($id); } else { $cache = \Glue\Entity\Cache\File::getInstance($id); } $cache->setDependencies($dependencies); if(($data = $cache->get()) === false) { if(($data = \Glue\Helper\General::loadConfiguration($cache->dependencies)) !== false && isset($data['Tree'])) { $temp = array(); if(!isset($data['Tree'][0])) { $data['Tree'] = array($data['Tree']); } foreach($data['Tree'] as $tree) { if(!isset($tree['childnodes'][0])) { $tree['childnodes'] = array($tree['childnodes']); } $temp[$tree['@attributes']['id']] = array(); $temp[$tree['@attributes']['id']]['nodelist'] = array(); $temp[$tree['@attributes']['id']]['current'] = NULL; $temp[$tree['@attributes']['id']]['childnodes'] =& $this->_processTree($tree['childnodes'], $temp[$tree['@attributes']['id']]); if(isset($tree['@attributes']['breadcrumb']) && $tree['@attributes']['breadcrumb'] == true) { $temp[$tree['@attributes']['id']]['breadcrumb'] = array(); } unset($tree['@attributes']); } $data = $temp; $cache->setData($data)->set(); unset($temp, $tree); } } if($data !== false) { foreach($data as &$tree) { $this->_processState($tree); if(isset($tree['breadcrumb'])) { $this->_processBreadcrumb($tree, $tree['breadcrumb']); $tree['current'] =& $tree['breadcrumb'][count($tree['breadcrumb']) - 1]; } } $this->registry->set(NULL, $data); } $this->dispatcher->notify(new \Glue\Event($this->id . '.load.post', array($language, $data))); unset($language, $scope, $result, $dependencies, $id, $cache, $data); } catch(\Exception $exception) { throw new \RuntimeException(\Glue\Helper\General::replace(array('method' => __METHOD__), GLUE_EXCEPTION_METHOD_FAILED), NULL, $exception); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function loadTreeData() {}", "abstract protected function loadFiletree(DataContainerInterface $objDc);", "public function load()\n {\n\n /*\n $folder = new LibFilesystemFolder(PATH_GW.'data/bdl/');\n $files = $folder->getPlainFiles();\n\n $this->data = array();\n\n // Load als xmi Files\n foreach ($files as $file)\n if (substr($file, -3 , strlen($file)) == \"xml\")\n $this->data[] = $file;\n */\n\n $data = array();\n\n include PATH_GW.'conf/map/bdl/projects/projects.php';\n\n $this->data = $data;\n\n ksort($this->data);\n\n }", "public static function initFileTree()\n {\n //-- Add css\n ecrStylesheet('php_file_tree');\n\n //-- Add javascript\n ecrScript('php_file_tree');\n }", "private function load_children() {\n\t\tif (isset($this->_children)) return;\n\t\t$this->_children = array();\n\t\t$this->_testcases = array();\n\t\tif (!$this->exists()) return; // entity doesn't actually exist\n\t\tforeach (new DirectoryIterator($this->data_path()) as $child) {\n\t\t\t$filename = $child->getFilename();\n\t\t\tif ($child->isDot() || $filename[0] == '.') {\n\t\t\t\t// skip hidden files and ..\n\t\t\t} else if ($child->isDir()) {\n\t\t\t\t// subdirectory = child entity\n\t\t\t\t$this->_children[$filename] = new Entity($this, $filename);\n\t\t\t} else if (substr($filename,-3) == '.in') {\n\t\t\t\t// \".in\" file = testcase\n\t\t\t\t$this->_testcases []= substr($filename,0,-3);\n\t\t\t}\n\t\t}\n\t\tsort($this->_testcases);\n\t\t//ksort($this->_children);\n\t\tuasort($this->_children, 'compare_order');\n\t}", "public function loadTree($folder)\n {\n $filter = \".class.php\";\n $files = file::file_tree_filtered($this->ApplicationRootFolder().\"/\".$folder,\"/\",$filter);\n\n $files = file::arrayFilterOut($files, \"~\");\n $files = file::arrayFilterOut($files, \".new\");\n $files = file::arrayFilterOut($files, \".backup\");\n\n\n // load classes found\n foreach ($files as $key => $value)\n {\n\n include_once $value;\n }\n\n }", "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "public function loadAll()\n {\n $this->setAll(array());\n $d = dir($this->getPath());\n $this->load($d);\n $d->close();\n }", "protected function loadFiles() {\n if ($this->loaded === true) {\n return;\n }\n $iter = new RecursiveDirectoryIterator($this->directory);\n $this->iterateFiles($iter);\n $this->loaded = true;\n }", "public function load(): void\n {\n if ($this->paths->isEmpty()) {\n return;\n }\n\n foreach ((new Finder)->in($this->paths->toArray())->files() as $file) {\n $this->loadAction(\n $this->getClassnameFromPathname($file->getPathname())\n );\n }\n }", "public abstract function load();", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }", "public function parseFiles()\n {\n $this->files->each(function ($file) {\n $this->store[] = $this->getTree($this->parseFile($file), $file);\n });\n }", "private static function load_files() {\n\t\t\t// Classes.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/class-astra-ext-advanced-headers-data.php';\n\t\t\t// Load Astra Breadcrumbs.\n\t\t\tinclude_once ASTRA_ADDON_EXT_ADVANCED_HEADERS_DIR . 'classes/astra-breadcrumbs.php';\n\t\t}", "abstract public function load();", "abstract public function load();", "abstract public function load($filename);", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load();", "public function load($path);", "public function load($path);", "public function load($path);", "function loadStructure($reload=false) {\n if($this->loaded && !$reload) return;\n $this->loaded = true;\n global $USER, $Controller, $CONFIG, $DB;\n\n if(!$this->path) return false;\n $extensions = $CONFIG->Files->filter;\n $d = dir($this->path);\n $realNames = array();\n while(false !== ($f = $d->read())) {\n if($f[0] == '.') continue;\n $fullpath = $this->path.'/'.$f;\n $type = (is_file($fullpath)?'File':(is_dir($fullpath)?'Folder':false));\n $info = pathinfo($fullpath);\n if($type == 'File' && !in_array(strtolower($info['extension']), $extensions)) {\n continue;\n }\n if($type != false) {\n $File = new $type($fullpath, $this);\n $this->{strtolower($type).'s'}[$File->basename] = $File;\n\n $realNames[] = $File->basename;\n }\n }\n $d->close();\n if(empty($realNames))\n $clean = $DB->files->asList(array('parent' => $this->ID));\n else\n $clean = $DB->files->asList(array('parent' => $this->ID, 'name!' => $realNames));\n if(!empty($clean) && is_array($clean)) {\n $DB->files->delete(array('id' => $clean));\n $DB->spine->delete(array('id' => $clean));\n }\n natcasesort($this->files);\n natcasesort($this->folders);\n }", "public function loadTree($par = 1){\r\n\t\t$user = new Table_Users();\r\n\t\t// load the user data\r\n\t\t$userData = $user->getDataById($_SESSION['userId']);\r\n\t\t//get the role id\r\n\t\t$role_id = $userData->role_id;\r\n\t\t// load the tree\r\n\t\techo $this->getChildrens($par, $role_id);\r\n\t}", "function parseTree($files, $icons, $nested = 0){\n $tree = '';\n $padding = $nested * 16 + 6;\n\n foreach ($files as $path => $value) {\n $parts = explode('/',$path);\n\n /* Sanitize name, http://stackoverflow.com/questions/2103797/url-friendly-username-in-php */\n $name = 'folder-'.strtolower(trim(preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($path, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8')), '-'));\n\n if (is_array($value)) {\n $tree .= \"<li><input type='checkbox' name ='$name' id='$name'>\".\n \"<label for='$name' style='padding-left:\".$padding.\"px'><svg xmlns='http://www.w3.org/2000/svg' width='14' height='16' viewBox='0 0 14 16' class='folder icon'><path d='M13 4H9V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM8 4H1V3h7z'/><path class='open' d='M1 3v4.094h12V4.97H8V3H1z'/></svg>\". end($parts) . \"</label>\".\n '<ul>'.parseTree($value, $icons, $nested + 1).'</ul></li>';\n } else {\n $class_name = $icons->getClassWithColor($value);\n // ($match = $icons->matchName($value)) ? $match->getClass(1) : 'text-icon';\n $tree .= \"<li><label style='padding-left:\".$padding.\"px'><a target='iframe' href='index.php/$path' onmouseup='document.getElementById(\\\"content\\\").scrollTop = 0'><i class='icon $class_name'></i>$value</a></label></li>\";\n }\n } \n return $tree; \n }", "function loadFiles($folder){\n $files = scandir($folder);\n foreach ($files as $filename)\n {\n if($filename != \".\" && $filename != \"..\") {\n if (is_dir($filename)) {\n //handle nesting\n loadFiles($filename);\n } else {\n if (strpos($filename, '.php') !== false) {\n require $folder.\"/\".$filename;\n }\n }\n }\n\n }\n}", "public function load() { }", "abstract public function loadAll();", "protected function load_files() {\n\t\trequire_once __DIR__ . '/class-papi-admin-meta-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-option-handler.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-post.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-entry-taxonomy.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-columns.php';\n\t\trequire_once __DIR__ . '/class-papi-admin-page-type-switcher.php';\n\t}", "public function load_files() {\n\n\t\t// Load our admin-related functions.\n\t\tif ( is_admin() ) {\n\t\t\trequire_once( GUPR_DIR . 'lib/admin.php' );\n\t\t}\n\t}", "private function ReadPathTree()\n\t{\n\t\t$this->pathTreeRead = true;\n\n\t\tif (empty($this->path)) {\n\t\t\t/* this is a top level tree, it has no subpath */\n\t\t\treturn;\n\t\t}\n\n\t\t$path = $this->path;\n\n\t\twhile (($pos = strrpos($path, '/')) !== false) {\n\t\t\t$path = substr($path, 0, $pos);\n\t\t\t$pathhash = $this->commit->PathToHash($path);\n\t\t\tif (!empty($pathhash)) {\n\t\t\t\t$parent = $this->GetProject()->GetTree($pathhash);\n\t\t\t\t$parent->SetPath($path);\n\t\t\t\t$this->pathTree[] = $parent;\n\t\t\t}\n\t\t}\n\n\t\tif (count($this->pathTree) > 0) {\n\t\t\t$this->pathTree = array_reverse($this->pathTree);\n\t\t}\n\t}", "protected function load()\n {\n $this->translations = array();\n \n if ($this->language) {\n if ($this->cachepath) {\n if (file_exists($cache = $this->cachepath.'/'.$this->language.'.php')) {\n $this->translations = include($cache);\n }\n } else {\n if (!empty($this->filepaths)) {\n foreach ($this->filepaths as $filepath) {\n $this->loadFilePath($filepath);\n }\n }\n }\n }\n }", "private static function _load() {\n $kategorier = Yaml::parse( file_get_contents( UKMrapporter::getPluginPath() .'rapporter/kategorier.yml') );\n foreach( $kategorier as $id => $kategori_data ) {\n $kategori = new Kategori( $id, $kategori_data );\n static::$data[ $kategori->getId() ] = $kategori;\n }\n }", "public function load() {\r\n\t\t$this->includes();\r\n\t\t$this->inits();\r\n\t}", "public function loadDir($directory);", "public function load($file);", "public function load($file);", "public function load($file);", "public function loadContents() {}", "public function loadContents() {}", "public function loadContents() {}", "public function loadContents() {}", "public function __load();", "public function getTreeSource();", "public function load()\n {\n }", "public function load()\n {\n }", "function loadFileData() {\n if (isset($this->params['file_id'])) {\n if (isset($this->params['version_id']) && $this->params['version_id'] > 0) {\n $this->currentFile = $this->getFile($this->params['file_id'], $this->params['version_id']);\n } else {\n $this->currentFile = $this->getFile($this->params['file_id']);\n }\n $fileData = $this->getFileTrans(\n $this->params['file_id'], $this->lngSelect->currentLanguageId\n );\n if (isset($fileData[$this->params['file_id']])) {\n $this->currentFileData = $fileData[$this->params['file_id']];\n } else {\n unset($this->currentFileData);\n }\n }\n }", "public function load()\n {\n if( $this->autoload ) {\n $loader = new BasePathClassLoader( $this->paths );\n $loader->useEnvPhpLib();\n $loader->register();\n }\n\n foreach( $this->paths as $path ) {\n $di = new RecursiveDirectoryIterator($path);\n $ita = new RecursiveIteratorIterator($di);\n $regex = new RegexIterator($ita, '/^.+\\.php$/i', \n RecursiveRegexIterator::GET_MATCH);\n\n foreach( $regex as $matches ) foreach( $matches as $match ) {\n try {\n require_once $match;\n } \n catch ( Exception $e ) {\n echo \"$match class load failed.\\n\";\n }\n }\n }\n }", "private function readFolder($path, $parent, $depth)\n {\n // Remove . and ..\n\n// $files = array_diff(scandir($path), array('.', '..'));\n $files = scandir(($path)) ? array_diff(scandir($path), array('.', '..')) : null;\n\n// $files = scandir($this->path);\n\n if ($this->isDebug) {\n echo '<h2>Contents of ' . $path . '</h2><pre>';\n print_r($files);\n echo '</pre>';\n }\n\n if ($files == null) {\n return;\n }\n\n $count = 0;\n foreach ($files as $file) {\n\n // Instantiate classes and store their filenames and titles in an array\n\n\n $filePath = $path . $file;\n if ($this->isDebug) {\n echo 'readFolder() | filePath = ' . $filePath . '<br>';\n }\n\n if (is_dir($filePath)) {\n if ($this->isDebug) {\n echo $count++ . ' | Site readFolder() | ' . $filePath . ' is a directory with a depth of ' . $depth . '<br>';\n }\n\n switch ($depth) {\n\n // Is a course\n case 0:\n\n // Add the directory path to the courses array\n array_push($this->courses, $this->stripClassNameFromFilePath($filePath));\n\n $this->structure[$parent][$this->stripClassNameFromFilePath($filePath, true)] = array();\n\n break;\n\n // Is a Topic\n case 1:\n\n // Add the directory path to the topics array\n array_push($this->topics, $this->stripClassNameFromFilePath($filePath));\n\n $this->structure['Courses'][$parent][$this->stripClassNameFromFilePath($filePath, true)] = array();\n\n break;\n }\n if ($this->isDebug) {\n echo '<br>$filePath = ' . $filePath . '<hr>';\n }\n\n $this->readFolder($filePath . '/', $this->stripClassNameFromFilePath($filePath, true), $this->directoryLevel + 1);\n } elseif (is_file($filePath)) {\n if ($this->isDebug) {\n echo $count++ . ' | Site readFolder() | ' . $filePath . ' is a file with a depth of ' . $depth . '<br>';\n }\n\n // Break the filePath into an array on the '/'\n $array = explode(\n '/',\n $filePath\n );\n\n $page = $this->stripExtFromFile($array[count($array) - 1]);\n $module = $array[count($array) - 2];\n $course = $array[count($array) - 3];\n $temp = [\n $module,\n $course]\n ;\n $this->allPages[$page] = $temp;\n\n// array_push($this->allPages, $temp);\n\n $className = $this->stripClassNameFromFilePath($filePath);\n\n // Add the file to the modules array\n\n array_push($this->modules, $className);\n\n $this->createNavbarArray($filePath);\n\n $this->modulesAssoc[$className] = $filePath;\n }\n }\n }", "public function testLoad() {\n $this->_loader->getSource('FilesystemTest.php');\n $this->_loader->getSource('FilesystemTest.php');\n\n $this->_loader->appendDir(dirname(__FILE__) . '/../Loader');\n $this->_loader->prependDir(dirname(__FILE__) . '/../Loader');\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function load()\n {\n }", "public function loadResources() {\n\t\t$file = 'LLL:EXT:lang/locallang_core.xml:';\n\t\t$indicators = $this->getIndicators();\n\t\t$configuration = array(\n\t\t\t'LLL' => array(\n\t\t\t\t'copyHint' => $GLOBALS['LANG']->sL($file . 'tree.copyHint', TRUE),\n\t\t\t\t'fakeNodeHint' => $GLOBALS['LANG']->sL($file . 'mess.please_wait', TRUE),\n\t\t\t\t'activeFilterMode' => $GLOBALS['LANG']->sL($file . 'tree.activeFilterMode', TRUE),\n\t\t\t\t'dropToRemove' => $GLOBALS['LANG']->sL($file . 'tree.dropToRemove', TRUE),\n\t\t\t\t'buttonRefresh' => $GLOBALS['LANG']->sL($file . 'labels.refresh', TRUE),\n\t\t\t\t'buttonNewNode' => $GLOBALS['LANG']->sL($file . 'tree.buttonNewNode', TRUE),\n\t\t\t\t'buttonFilter' => $GLOBALS['LANG']->sL($file . 'tree.buttonFilter', TRUE),\n\t\t\t\t'dropZoneElementRemoved' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRemoved', TRUE),\n\t\t\t\t'dropZoneElementRestored' => $GLOBALS['LANG']->sL($file . 'tree.dropZoneElementRestored', TRUE),\n\t\t\t\t'searchTermInfo' => $GLOBALS['LANG']->sL($file . 'tree.searchTermInfo', TRUE),\n\t\t\t\t'temporaryMountPointIndicatorInfo' => $GLOBALS['LANG']->sl($file . 'labels.temporaryDBmount', TRUE),\n\t\t\t\t'deleteDialogTitle' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteItem', TRUE),\n\t\t\t\t'deleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:deleteWarning', TRUE),\n\t\t\t\t'recursiveDeleteDialogMessage' => $GLOBALS['LANG']->sL('LLL:EXT:cms/layout/locallang.xml:recursiveDeleteWarning', TRUE),\n\t\t\t),\n\n\t\t\t'Configuration' => array(\n\t\t\t\t'hideFilter' => $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.hideFilter'),\n\t\t\t\t'displayDeleteConfirmation' => $GLOBALS['BE_USER']->jsConfirmation(4),\n\t\t\t\t'canDeleteRecursivly' => $GLOBALS['BE_USER']->uc['recursiveDelete'] == TRUE,\n\t\t\t\t'disableIconLinkToContextmenu' => $GLOBALS['BE_USER']->getTSConfigVal(\n\t\t\t\t\t'options.pageTree.disableIconLinkToContextmenu'\n\t\t\t\t),\n\t\t\t\t'indicator' => $indicators['html'],\n\t\t\t\t'temporaryMountPoint' => Tx_Taxonomy_Service_ExtDirect_Controller_Commands::getMountPointPath(),\n\t\t\t),\n\n\t\t\t'Sprites' => array(\n\t\t\t\t'Filter' => t3lib_iconWorks::getSpriteIconClasses('actions-system-tree-search-open'),\n\t\t\t\t'NewNode' => t3lib_iconWorks::getSpriteIconClasses('actions-page-new'),\n\t\t\t\t'Refresh' => t3lib_iconWorks::getSpriteIconClasses('actions-system-refresh'),\n\t\t\t\t'InputClear' => t3lib_iconWorks::getSpriteIconClasses('actions-input-clear'),\n\t\t\t\t'TrashCan' => t3lib_iconWorks::getSpriteIconClasses('actions-edit-delete'),\n\t\t\t\t'TrashCanRestore' => t3lib_iconWorks::getSpriteIconClasses('actions-edit-restore'),\n\t\t\t\t'Info' => t3lib_iconWorks::getSpriteIconClasses('actions-document-info'),\n\t\t\t)\n\t\t);\n\n\t\treturn $configuration;\n\t}", "public static function loadAll();", "public function loadFromFile($file)\n {\n \n }", "function loadContents() ;", "public function getTrees() {}", "protected function loadClassFiles() {}", "function load() {\n\n\t}", "function load ()\n {\n $this->relationships = parent::_load ( $this->basepath ) ;\n }", "private function readTypes() {\n $files = $this->path->read();\n\n foreach ($files as $file) {\n if ($file->isDirectory()) {\n continue;\n }\n\n $this->readType($file->getName());\n }\n }", "public function load(): void;", "public function load(): void;", "abstract protected function reloadFiletree(DataContainerInterface $objDc);", "public function loadResources() {}", "public function requireTree()\n\t{\n\t\t// Spin through all the files within the directory and add them to the pending array of assets.\n\t\t// This allows assets to be excluded or included before being added as valid.\n\t\tforeach ($this->recursivelyIterateDirectory() as $file)\n\t\t{\n\t\t\tif ($file->isDir()) continue;\n\n\t\t\t$asset = $this->createAsset($file->getPathname());\n\n\t\t\tif ($asset->isValid())\n\t\t\t{\n\t\t\t\t$this->pending[] = $asset;\n\t\t\t}\n\t\t}\n\n\t\treturn $this;\n\t}", "function load();", "protected function loadFileManager(DataContainerInterface $objDc)\n\t{\n\t\t// Method ajaxTreeView is in TreeView.php - watch out!\n\t\techo $objDc->ajaxTreeView(self::getPost('folder', true), intval(self::getPost('level')));\n\t\texit;\n\t}", "public function initializeChildren() {\n\t\tif ($this->initialized === TRUE) {\n\t\t\treturn;\n\t\t}\n\t\t/** @var \\TYPO3\\CMS\\Core\\Resource\\Folder $folder */\n\t\t$subFolders = $this->folder->getSubfolders();\n\t\tforeach ($subFolders as $folder) {\n\t\t\t$f = new Storage($this->mapFolderIdToEntityName($folder->getName()), array());\n\t\t\t$f->setStorage($this->storage);\n\t\t\t$f->setFolder($folder);\n\t\t\t$this->addChild($f);\n\t\t}\n\n\t\t$files = $this->folder->getFiles();\n\t\tforeach ($files as $file) {\n\t\t\t$f = new File();\n\t\t\t$f->setFalFileObject($file);\n\t\t\t$this->addChild($f);\n\t\t}\n\t\t$this->initialized = TRUE;\n\t}", "abstract public function loadData();", "protected function _loadTemplates()\n {\n $this->_tpl = array();\n $dir = Solar_Class::dir($this, 'Data');\n $list = glob($dir . '*.php');\n foreach ($list as $file) {\n \n // strip .php off the end of the file name to get the key\n $key = substr(basename($file), 0, -4);\n \n // load the file template\n $this->_tpl[$key] = file_get_contents($file);\n \n // we need to add the php-open tag ourselves, instead of\n // having it in the template file, becuase the PEAR packager\n // complains about parsing the skeleton code.\n // \n // however, only do this on non-view files.\n if (substr($key, 0, 4) != 'view') {\n $this->_tpl[$key] = \"<?php\\n\" . $this->_tpl[$key];\n }\n }\n }", "function &GetAllContentAsHierarchy($loadprops, $onlyexpanded=null, $loadcontent = false)\n\t{\n\t\tdebug_buffer('', 'starting tree');\n\n\t\trequire_once(dirname(dirname(__FILE__)).'/Tree/Tree.php');\n\n\t\t$nodes = array();\n\t\tglobal $gCms;\n\t\t$db = &$gCms->GetDb();\n\n\t\t$cachefilename = TMP_CACHE_LOCATION . '/contentcache.php';\n\t\t$usecache = true;\n\t\tif (isset($onlyexpanded) || isset($CMS_ADMIN_PAGE))\n\t\t{\n\t\t\t#$usecache = false;\n\t\t}\n\n\t\t$loadedcache = false;\n\n\t\tif ($usecache)\n\t\t{\n\t\t\tif (isset($gCms->variables['pageinfo']) && file_exists($cachefilename))\n\t\t\t{\n\t\t\t\t$pageinfo =& $gCms->variables['pageinfo'];\n\t\t\t\t//debug_buffer('content cache file exists... file: ' . filemtime($cachefilename) . ' content:' . $pageinfo->content_last_modified_date);\n\t\t\t\tif (isset($pageinfo->content_last_modified_date) && $pageinfo->content_last_modified_date < filemtime($cachefilename))\n\t\t\t\t{\n\t\t\t\t\tdebug_buffer('file needs loading');\n\n\t\t\t\t\t$handle = fopen($cachefilename, \"r\");\n\t\t\t\t\t$data = fread($handle, filesize($cachefilename));\n\t\t\t\t\tfclose($handle);\n\n\t\t\t\t\t$tree = unserialize(substr($data, 16));\n\n\t\t\t\t\t#$variables =& $gCms->variables;\n\t\t\t\t\t#$variables['contentcache'] =& $tree;\n\t\t\t\t\tif (strtolower(get_class($tree)) == 'tree')\n\t\t\t\t\t{\n\t\t\t\t\t\t$loadedcache = true;\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$loadedcache = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!$loadedcache)\n\t\t{\n\t\t\t$query = \"SELECT id_hierarchy FROM \".cms_db_prefix().\"content ORDER BY hierarchy\";\n\t\t\t$dbresult =& $db->Execute($query);\n\n\t\t\tif ($dbresult && $dbresult->RecordCount() > 0)\n\t\t\t{\n\t\t\t\twhile ($row = $dbresult->FetchRow())\n\t\t\t\t{\n\t\t\t\t\t$nodes[] = $row['id_hierarchy'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$tree = new Tree();\n\t\t\tdebug_buffer('', 'Start Loading Children into Tree');\n\t\t\t$tree = Tree::createFromList($nodes, '.');\n\t\t\tdebug_buffer('', 'End Loading Children into Tree');\n\t\t}\n\n\t\tif (!$loadedcache && $usecache)\n\t\t{\n\t\t\tdebug_buffer(\"Serializing...\");\n\t\t\t$handle = fopen($cachefilename, \"w\");\n\t\t\tfwrite($handle, '<?php return; ?>'.serialize($tree));\n\t\t\tfclose($handle);\n\t\t}\n\n\t\tif( $loadcontent )\n\t\t {\n\t\t ContentOperations::LoadChildrenIntoTree(-1, $tree, false, true);\n\t\t }\n\n\t\tdebug_buffer('', 'ending tree');\n\n\t\treturn $tree;\n\t}", "public function testLoadByPath()\r\n\t{\r\n\t\t// Cleanup just in case the first level already exists\r\n\t\t$objDef = CAntObject::factory($this->dbh, \"project\", null, $this->user);\r\n\t\t$obj = $objDef->loadByName(\"testLoadByPathLevel1\");\r\n\t\tif ($obj && $obj->id)\r\n\t\t\t$obj->removeHard();\r\n\t\t$obj = $objDef->loadByPath(\"/testLoadByPathLevel1/Level2\");\r\n\t\tif ($obj && $obj->id)\r\n\t\t\t$obj->removeHard();\r\n\r\n\t\t// Create parent project\r\n\t\t$obj1 = CAntObject::factory($this->dbh, \"project\", null, $this->user);\r\n\t\t$obj1->setValue(\"name\", \"testLoadByPathLevel1\");\r\n\t\t$obj1->save();\r\n\r\n\t\t// Create child project\r\n\t\t$obj2 = CAntObject::factory($this->dbh, \"project\", null, $this->user);\r\n\t\t$obj2->setValue(\"name\", \"Level2\");\r\n\t\t$obj2->setValue(\"parent\", $obj1->id);\r\n\t\t$obj2->save();\r\n\r\n\t\t// Now load by path name\r\n\t\t$obj3 = $obj1->loadByPath(\"/testLoadByPathLevel1/Level2\");\r\n\t\t$this->assertEquals($obj3->id, $obj2->id);\r\n\r\n\t\t// Cleanup\r\n\t\t$obj2->removeHard();\r\n\t\t$obj1->removeHard();\r\n\t}", "public function getFileList()\r\n {\r\n $gid = $this->input->get_post('gid');\r\n if ($gid === FALSE)\r\n {\r\n // list all groups (by permission)\r\n $permission = $this->input->get_post('permission');\r\n $file_list = $this->_get_group_list($permission);\r\n $access_full_path = '';\r\n }\r\n else\r\n {\r\n // check permission\r\n $this->_check_group_permission();\r\n $access_full_path = $this->_get_access_full_path();\r\n $sortby = $this->input->get_post('sortby') ?: '+name';\r\n $file_list = $this->files_model->get_file_list($access_full_path, $sortby);\r\n }\r\n\r\n $format = $this->input->get_post('format');\r\n if ($format === 'jstree')\r\n {\r\n //$path = '/' . trim($this->input->get_post('path') ?: '', '/');\r\n $path = $this->input->get_post('path');\r\n $path = $path ? $path : '';\r\n $dironly = $this->input->get_post('dironly');\r\n $tree = array();\r\n foreach ($file_list as $file)\r\n {\r\n if ($dironly && $file['type'] === Files_model::FILE_TYPE_FILE)\r\n {\r\n continue;\r\n }\r\n // Give different directory icons based directories.\r\n $is_my_workspace = 0;\r\n if ($gid)\r\n {\r\n $is_my_workspace = $this->_is_my_workspace($gid);\r\n }\r\n else\r\n {\r\n $is_my_workspace = $this->_is_my_workspace($file['gid']);\r\n }\r\n $access_full_subpath = $access_full_path .'/'. $file['name'];\r\n\r\n $data_path = $file['type'] === Files_model::FILE_TYPE_FOLDER ? $path . '/' . $file['name'] : $path;\r\n if ($gid !== FALSE && $path === '' && $file['type'] === Files_model::FILE_TYPE_FOLDER)\r\n {\r\n $file['show_name'] = $this->files_model->get_system_folder_name($file['name']);\r\n }\r\n $tree[] = array(\r\n 'data' => array(\r\n 'title' => isset($file['show_name']) ? $file['show_name'] : $file['name'],\r\n 'attr' => array(\r\n 'href' => '#',\r\n ),\r\n ),\r\n 'attr' => array(\r\n 'data-name' => $file['name'],\r\n 'data-gid' => $gid === FALSE ? $file['gid'] : $gid,\r\n 'data-path' => $gid === FALSE ? '' : $data_path,\r\n 'data-size' => $file['size'],\r\n 'data-crumb'=> $file['type'] == Files_model::FILE_TYPE_FOLDER ? $this->login->get_crumb($access_full_subpath) : '',\r\n 'class' => $file['type'] == Files_model::FILE_TYPE_FOLDER ? 'folder' : 'file',\r\n 'rel' => $is_my_workspace ? 'user-folder' : 'folder',\r\n ),\r\n 'state' => $file['type'] == Files_model::FILE_TYPE_FOLDER ? 'closed' : '',\r\n );\r\n }\r\n $this->_outputJSON($tree);\r\n }\r\n\r\n $resp['status'] = 'ok';\r\n $resp['errno'] = $resp['errmsg'] = '';\r\n $resp['list'] = $file_list;\r\n $this->_outputJSON($resp);\r\n }", "public function load() {\n $this->loadModules($this->dir['modules_core'], 'core');\n $this->loadModules($this->dir['modules_custom'], 'custom');\n $this->runModules();\n }", "function load()\n {\n }", "public function load()\n {\n $files = $this->finder->files()->in($this->shimsDirectory);\n\n foreach ($files as $file) {\n $this->loadFile($file);\n }\n }", "function loadObjTree($types=null,$dq=null){\n\t\t$obj_pool = $this->loadChild($types,$dq);\n\t\t$new_obj_pool=array();\n\t\tforeach($obj_pool as $obj){\n\t\t\t$new_obj_pool[$obj->id]=$this->add($obj);\n\t\t\t$sub_obj_pool = $obj->loadObjTree($types,$dq);\n\t\t\tif (is_array($sub_obj_pool)){\n\t\t\t\t$new_obj_pool = array_merge($new_obj_pool, $sub_obj_pool);\n\t\t\t}\n\t\t}\n\t\treturn $new_obj_pool;\n\t}", "abstract public function load($file, $context);", "function files($dir, $first = true)\n{\n $data = '';\n if ($first === true) {\n $data .= '<ul><li data-jstree=\\'{ \"opened\" : true }\\'><a href=\"#\" class=\"open-dir\" data-dir=\"' . MAIN_DIR . '\">' . basename($dir) . '</a>';\n }\n $data .= '<ul class=\"files\">';\n $files = array_slice(scandir($dir), 2);\n asort($files);\n foreach ($files as $key => $file) {\n if ((SHOW_PHP_SELF === false && $dir . DS . $file == __FILE__) || (SHOW_HIDDEN_FILES === false && substr($file, 0, 1) === '.')) {\n continue;\n }\n if (is_dir($dir . DS . $file) && (empty(PATTERN_DIRECTORIES) || preg_match(PATTERN_DIRECTORIES, $file))) {\n $dir_path = str_replace(MAIN_DIR . DS, '', $dir . DS . $file);\n $data .= '<li class=\"dir\">'\n . '<a akbarali href=\"#' . MAIN_DIR . $dir_path . '/\" class=\"open-dir\" data-dir=\"../' . $dir_path . '/\">' . $file . '</a>' . files($dir . DS . $file, false) . '</li>';\n } else if (empty(PATTERN_FILES) || preg_match(PATTERN_FILES, $file)) {\n $file_path = str_replace(MAIN_DIR . DS, '', $dir . DS . $file);\n $data .= '<li class=\"file ' . (is_writable($file_path) ? 'editable' : null) . '\" data-jstree=\\'{ \"icon\" : \"jstree-file\" }\\'>'\n . '<a akbarali1 href=\"#' . MAIN_DIR . $file_path . '\" data-file=\"../' . $file_path . '\" class=\"open-file\">' . $file . '</a></li>';\n }\n }\n $data .= '</ul>';\n if ($first === true) {\n $data .= '</li></ul>';\n }\n return $data;\n}" ]
[ "0.8138365", "0.71508896", "0.6818853", "0.67137086", "0.66420805", "0.6622824", "0.6578812", "0.65448636", "0.65448636", "0.65153587", "0.64494836", "0.6346299", "0.6295452", "0.62606215", "0.6246496", "0.6246496", "0.6246496", "0.6246496", "0.62322843", "0.6222555", "0.62142265", "0.6214", "0.6214", "0.616037", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61567044", "0.61553127", "0.61553127", "0.61553127", "0.61500657", "0.6099037", "0.60752505", "0.6060208", "0.599804", "0.5995393", "0.59516436", "0.5951452", "0.59035856", "0.5886265", "0.587815", "0.58603835", "0.5855712", "0.58459795", "0.58459795", "0.58459795", "0.5825236", "0.58225816", "0.58223915", "0.58223915", "0.5818078", "0.58123845", "0.580925", "0.580925", "0.58052635", "0.58005816", "0.57871133", "0.5786546", "0.5760233", "0.5760233", "0.5760233", "0.5759914", "0.5758925", "0.5756768", "0.5744008", "0.5741836", "0.57365596", "0.57297075", "0.5722142", "0.5716051", "0.5706232", "0.5666191", "0.5647606", "0.5647606", "0.563414", "0.56226146", "0.5621034", "0.5618727", "0.5616066", "0.560624", "0.5590462", "0.5587256", "0.55851907", "0.5579911", "0.55766565", "0.55764705", "0.5566156", "0.5558694", "0.5558521", "0.55408496", "0.553299" ]
0.0
-1
Method to process state for tree
protected function _processState(array &$tree) { try { foreach($tree['nodelist'] as &$item) { $node = '/' . $item['node']; $state = (preg_match('/^' . preg_quote($node, '/') . '.*/', self::$node . '/')) ? (($node == self::$node) ? 2 : 1) : 0; if($state !== 0) { $item['state'] = $state; if($state === 2) { $tree['current'] =& $item; } } unset($item, $node, $state); } unset($tree); } catch(\Exception $exception) { throw new \RuntimeException(\Glue\Helper\General::replace(array('method' => __METHOD__), GLUE_EXCEPTION_METHOD_FAILED), NULL, $exception); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "public function calc_tree()\n\t{\n\t\t$this->readTree(TRUE);\t\t\t// Make sure we have accurate data\n\t\tforeach ($this->class_parents as $cp)\n\t\t{\n\t\t\t$rights = array();\n\t\t\t$this->rebuild_tree($cp,$rights);\t\t// increasing rights going down the tree\n\t\t}\n\t}", "abstract public function states();", "abstract public function getState() ;", "protected function loadTreeData() {}", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "private function _process_state(&$unprocessed, &$processed, $state)\n\t{\n\t\tif(isset($processed[$state])) {\n\t\t\treturn $processed[$state];\n\t\t}\n\t\t\n\t\t$processed[$state] = [];\n\t\t$tokens = &$processed[$state];\n\t\t$rflags = $this->flags;\n\t\tforeach($unprocessed[$state] as $tdef) {\n\t\t\t\n\t\t\tif($tdef instanceof \\Phygments\\Lexers\\Regex\\Helper\\_Include) {\n\t\t\t\t// it's a state reference\n\t\t\t\tif($tdef == $state) {\n\t\t\t\t\tthrow new \\Exception(sprintf('circular state reference %s', (string)$state));\n\t\t\t\t}\n\n\t\t\t\t$tokens = array_merge($tokens, $this->_process_state($unprocessed, $processed, (string)$tdef));\n\t\t\t\tcontinue;\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif($tdef instanceof \\Phygments\\Lexers\\Regex\\Helper\\_Inherit) {\n\t\t\t\t// processed already\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$rex = $this->_process_regex($tdef[0], $rflags);\n\t\t\t$token = $this->_process_token($tdef[1]);\n\t\t\t\n\t\t\tif(count($tdef) == 2) {\n\t\t\t\t$new_state = null;\n\t\t\t} else {\n\t\t\t\t$new_state = $this->_process_new_state($tdef[2], $unprocessed, $processed);\n\t\t\t}\n\t\t\t\n\t\t\t$tokens[] = array($rex, $token, $new_state);\t\t\n\t\t}\n\t\t\n\t\treturn $tokens;\n\t}", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "protected function processFileTree () {\n\t\t$files = $this->populateFileTree();\n\t\tforeach ($files as $file) {\n\t\t\t$this->processFile($file);\n\t\t}\n\t}", "function _modifyTree () {\r\n return true;\r\n }", "protected function updateState()\n {\n if (! array_key_exists($this->state, $this->state_tree))\n return false;\n\n foreach ($this->state_tree[$this->state] as $state) {\n if (strpos($this->line, $this->state_str[$state]) === 0) {\n $this->previous_state = $this->state;\n $this->state = $state;\n if (strlen($this->line) > strlen($this->state_str[$state]))\n $this->rerun = true; // There'll be additional info on this line\n return true;\n }\n }\n\n return false;\n }", "protected function load()\n {\n //$this->db->beginTransaction();\n $this->inTransaction = true;\n\n $q = $this->db->createSelectQuery();\n\n $q->select( '*' )\n ->from( $this->db->quoteIdentifier( $this->prefix.'pipe_execution' ) )\n ->where( $q->expr->eq( $this->db->quoteIdentifier( 'id' ),\n $q->bindValue( (int)$this->id ) ) );\n\n $stmt = $q->prepare();\n $stmt->execute();\n\n $result = $stmt->fetchAll( PDO::FETCH_ASSOC );\n\n if ( empty( $result ) )\n {\n //@todo better Exception\n throw new Exception(\n 'No state information for execution '.$this->id.'.'\n );\n }\n\n if ( $result === false )\n {\n //@todo better Exception\n throw new Exception(\n 'DB error loading state of execution '.$this->id.'.'\n );\n }\n\n // There can be only one result row\n $result = array_pop( $result );\n\n $this->pipeName = $result['pipe_name'];\n $this->pipeVersion = ( int )$result['pipe_version'];\n $this->executionState = ( int )$result['state'];\n\n //$this->parent = $result['parent'];\n $this->created = new DateTime( '@'.$result['created'] );\n\n // Load variables of this execution and of all nodes\n $q = $this->db->createSelectQuery();\n\n $q->select( '*' )\n ->from( $this->db->quoteIdentifier( $this->prefix.'pipe_execution_state' ) )\n ->where( $q->expr->eq( $this->db->quoteIdentifier( 'execution_id' ),\n $q->bindValue( (int)$this->id ) ) );\n\n $stmt = $q->prepare();\n $stmt->execute();\n\n $result = $stmt->fetchAll( PDO::FETCH_ASSOC );\n //@todo Check result\n\n $nodeStates = array();\n\n foreach( $result as $row )\n {\n $nodeId = ( int )$row['node_id'];\n\n if( 0 === $nodeId )\n {\n // This is the state of the execution \n $this->unserializeState( $row['state'] );\n }\n else\n {\n // It's a node's state\n $nodeStates[$nodeId] = $row['state'];\n }\n }\n\n $this->nodeStates = $nodeStates;\n }", "function perform( $data = FALSE )\r\n {\r\n // get var name defined in the public view to store the result\r\n $this->tree_result = & $this->B->$data['result']; \r\n $this->tree_result = array();\r\n\r\n if(!isset($data['node']))\r\n {\r\n $_node = 0;\r\n }\r\n else\r\n {\r\n $_node = $data['node'];\r\n }\r\n\r\n if(!isset($data['status']))\r\n {\r\n $status = FALSE;\r\n }\r\n else\r\n {\r\n $status = $data['status'];\r\n }\r\n\r\n if(SF_SECTION == 'public')\r\n {\r\n // check if cache ID exists\r\n if ( M( MOD_COMMON, \r\n 'cache_get',\r\n array('result' => $data['result'],\r\n 'cacheID' => SF_SECTION.'tree'.$_node.$status,\r\n 'cacheGroup' => 'navigation-tree'))) \r\n {\r\n return SF_IS_VALID_ACTION;\r\n } \r\n }\r\n\r\n // load navigation nodes\r\n include (SF_BASE_DIR . 'data/navigation/nodes.php'); \r\n \r\n // order the node tree by order\r\n $this->_tmp_array = array();\r\n $s=0;\r\n foreach($node as $n => $x)\r\n {\r\n $x['node'] = $n;\r\n $this->_tmp_array['o'.dechex($x['order']).$s] = $x; \r\n $s++;\r\n }\r\n \r\n ksort($this->_tmp_array);\r\n\r\n $this->_level = 0; \r\n\r\n // get child nodes of a given node id\r\n $this->_getTreeNodes( $_node, $status ); \r\n\r\n if(SF_SECTION == 'public')\r\n {\r\n // save result to cache\r\n M( MOD_COMMON, \r\n 'cache_save',\r\n array('result' => $this->tree_result)); \r\n }\r\n \r\n return SF_IS_VALID_ACTION;\r\n }", "function _postProcess() {\r\n $item = current($this->_struct);\r\n \r\n $ret = array('_name'=>$item['tag'], '_attributes'=>array(), '_value'=>null);\r\n\r\n if (isset($item['attributes']) && count($item['attributes'])>0) {\r\n foreach ($item['attributes'] as $key => $data) {\r\n if (!is_null($data)) {\r\n $item['attributes'][$key] = str_replace($this->_replaceWith, $this->_replace, $item['attributes'][$key]);\r\n }\r\n }\r\n $ret['_attributes'] = $item['attributes'];\r\n if ($this->attributesDirectlyUnderParent)\r\n $ret = array_merge($ret, $item['attributes']);\r\n }\r\n\r\n if (isset($item['value']) && $item['value'] != null)\r\n $item['value'] = str_replace($this->_replaceWith, $this->_replace, $item['value']);\r\n \r\n switch ($item['type']) {\r\n case 'open':\r\n $children = array();\r\n while (($child = next($this->_struct)) !== FALSE ) {\r\n if ($child['level'] <= $item['level'])\r\n break;\r\n \r\n $subItem = $this->_postProcess();\r\n \r\n if (isset($subItem['_name'])) {\r\n if (!isset($children[$subItem['_name']]))\r\n $children[$subItem['_name']] = array();\r\n \r\n $children[$subItem['_name']][] = $subItem;\r\n }\r\n else {\r\n foreach ($subItem as $key=>$value) {\r\n if (isset($children[$key])) {\r\n if (is_array($children[$key]))\r\n $children[$key][] = $value;\r\n else\r\n $children[$key] = array($children[$key], $value);\r\n }\r\n else {\r\n $children[$key] = $value;\r\n }\r\n }\r\n }\r\n }\r\n \r\n if ($this->childTagsDirectlyUnderParent)\r\n $ret = array_merge($ret, $this->_condenseArray($children));\r\n else\r\n $ret['_value'] = $this->_condenseArray($children);\r\n \r\n break;\r\n case 'close':\r\n break;\r\n case 'complete':\r\n if (count($ret['_attributes']) > 0) {\r\n if (isset($item['value']))\r\n $ret['_value'] = $item['value'];\r\n }\r\n else {\r\n\t\t\tif (isset($item['value'])) {\r\n\t\t\t\t$ret = array($item['tag']=> $item['value']);\r\n\t\t\t} else {\r\n\t\t\t\t$ret = array($item['tag']=> \"\");\r\n\t\t\t}\r\n }\r\n break;\r\n }\r\n\r\n //added by Dan Coulter\r\n\r\n \r\n /*\r\n foreach ($ret as $key => $data) {\r\n if (!is_null($data) && !is_array($data)) {\r\n $ret[$key] = str_replace($this->_replaceWith, $this->_replace, $ret[$key]);\r\n }\r\n }\r\n */\r\n return $ret;\r\n }", "public function save_tree()\n\t{\n\t\tforeach ($this->class_tree as $tree)\n\t\t{\n\t\t\tif (isset($tree['change_flag']))\n\t\t\t{\n\t\t\t\tswitch ($tree['change_flag'])\n\t\t\t\t{\n\t\t\t\t case 'INSERT' :\n\t\t\t\t\t$this->add_new_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t case 'UPDATE' :\n\t\t\t\t\t$this->save_edited_class($tree);\n\t\t\t\t\tbreak;\n\t\t\t\t default :\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected function populateState()\n\t{\n\t}", "protected function populateState()\n\t{\n\t}", "private function ReadPathTree()\n\t{\n\t\t$this->pathTreeRead = true;\n\n\t\tif (empty($this->path)) {\n\t\t\t/* this is a top level tree, it has no subpath */\n\t\t\treturn;\n\t\t}\n\n\t\t$path = $this->path;\n\n\t\twhile (($pos = strrpos($path, '/')) !== false) {\n\t\t\t$path = substr($path, 0, $pos);\n\t\t\t$pathhash = $this->commit->PathToHash($path);\n\t\t\tif (!empty($pathhash)) {\n\t\t\t\t$parent = $this->GetProject()->GetTree($pathhash);\n\t\t\t\t$parent->SetPath($path);\n\t\t\t\t$this->pathTree[] = $parent;\n\t\t\t}\n\t\t}\n\n\t\tif (count($this->pathTree) > 0) {\n\t\t\t$this->pathTree = array_reverse($this->pathTree);\n\t\t}\n\t}", "function ProcessMultilevel()\n {\n if ($this->debug_mode)\n echo $this->ClassName . \"::ProcessMultilevel();\" . \"<HR>\";\n if ($this->listSettings->HasItem(\"MAIN\", \"PARENT_FIELD\")) {\n $this->parent_field = $this->listSettings->GetItem(\"MAIN\", \"PARENT_FIELD\");\n }\n else {\n $this->AddEditErrorMessage(\"EMPTY_PARENTFIELD_SETTINGS\", array(), true);\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"USE_SUB_CATEGORIES\")) {\n $this->use_sub_categories = $this->listSettings->GetItem(\"MAIN\", \"USE_SUB_CATEGORIES\");\n }\n else {\n $this->use_sub_categories = 0;\n }\n if ($this->use_sub_categories) {\n $this->ProcessMultilevelSubCategories();\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"ENABLE_MEGA_DELETE\")) {\n $this->mega_delete = $this->listSettings->GetItem(\"MAIN\", \"ENABLE_MEGA_DELETE\");\n }\n else {\n $this->mega_delete = 0;\n }\n if ($this->listSettings->HasItem(\"MAIN\", \"ENABLE_NODE_MOVE\")) {\n $this->node_move = $this->listSettings->GetItem(\"MAIN\", \"ENABLE_NODE_MOVE\");\n }\n else {\n $this->node_move = 0;\n }\n\n }", "private function parse_directory_tree()\r\n {\r\n foreach ($this->tc_step_data_list as $tc_index => $testcase_node)\r\n {\r\n $first_level = $testcase_node->get_first_level();\r\n $first_id = null;\r\n $second_level = $testcase_node->get_second_level();\r\n $second_id = null;\r\n $third_level = $testcase_node->get_third_level();\r\n $third_id = null;\r\n $fourth_level = $testcase_node->get_fourth_level();\r\n $fourth_id = null;\r\n $fifth_level = $testcase_node->get_fifth_level();\r\n $fifth_id = null;\r\n \r\n if ($first_level != null && $first_level != \"\" && trim($first_level) != \"\")\r\n {\r\n $first_id = $this->parse_directory_level(1, $first_level, \r\n $tc_index, $testcase_node, null);\r\n }\r\n \r\n if ($second_level != null && $second_level != \"\" && trim($second_level) != \"\")\r\n {\r\n $second_id = $this->parse_directory_level(2, $second_level,\r\n $tc_index, $testcase_node, $first_id);\r\n }\r\n else \r\n {\r\n // no second level dic, means testcase in first dic\r\n $tc_parent = $this->directory_array[1][$first_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($third_level != null && $third_level != \"\" && trim($third_level) != \"\")\r\n {\r\n $third_id = $this->parse_directory_level(3, $third_level,\r\n $tc_index, $testcase_node, $second_id);\r\n }\r\n else\r\n {\r\n // no third level dic, means testcase in second dic\r\n $tc_parent = $this->directory_array[2][$second_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($fourth_level != null && $fourth_level != \"\" && trim($fourth_level) != \"\")\r\n {\r\n $fourth_id = $this->parse_directory_level(4, $fourth_level,\r\n $tc_index, $testcase_node, $third_id);\r\n }\r\n else\r\n {\r\n // no fourth level dic, means testcase in third dic\r\n $tc_parent = $this->directory_array[3][$third_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($fifth_level != null && $fifth_level != \"\" || trim($fifth_level) != \"\")\r\n {\r\n // the last level dic\r\n $fifth_id = $this->parse_directory_level(5, $fifth_level,\r\n $tc_index, $testcase_node, $fourth_id);\r\n $tc_parent = $this->directory_array[5][$fifth_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n }\r\n else\r\n {\r\n // no fifth level dic, means testcase in fourth dic\r\n $tc_parent = $this->directory_array[4][$fourth_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n }\r\n }\r\n }", "protected function emitPostProcessTreeDataSignal() {}", "function putInTree()\n\t{\n//echo \"st:putInTree\";\n\t\t// chapters should be behind pages in the tree\n\t\t// so if target is first node, the target is substituted with\n\t\t// the last child of type pg\n\t\tif ($_GET[\"target\"] == IL_FIRST_NODE)\n\t\t{\n\t\t\t$tree = new ilTree($this->content_object->getId());\n\t\t\t$tree->setTableNames('lm_tree','lm_data');\n\t\t\t$tree->setTreeTablePK(\"lm_id\");\n\n\t\t\t// determine parent node id\n\t\t\t$parent_id = (!empty($_GET[\"obj_id\"]))\n\t\t\t\t? $_GET[\"obj_id\"]\n\t\t\t\t: $tree->getRootId();\n\t\t\t// determine last child of type pg\n\t\t\t$childs =& $tree->getChildsByType($parent_id, \"pg\");\n\t\t\tif (count($childs) != 0)\n\t\t\t{\n\t\t\t\t$_GET[\"target\"] = $childs[count($childs) - 1][\"obj_id\"];\n\t\t\t}\n\t\t}\n\t\tif (empty($_GET[\"target\"]))\n\t\t{\n\t\t\t$_GET[\"target\"] = IL_LAST_NODE;\n\t\t}\n\n\t\tparent::putInTree();\n\t}", "protected function _tree($array) {\n\n\t\t\t$root = array(\n\t\t\t\t'children' => array()\n\t\t\t);\n\t\t\t$current = &$root;\n\n\t\t\tforeach ($array as $i => $node) {\n\n\t\t\t\t$result = $this->_tag($node);\n\t\t\t\t\n\t\t\t\tif ($result) {\n\t\t\t\t\t\n\t\t\t\t\tif (isset($result['tag'])) {\n\t\t\t\t\t\t$tag = $result['tag'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tag = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($result['arguments'])) {\n\t\t\t\t\t\t$arguments = $result['arguments'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arguments = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($tag) {\n\t\t\t\t\t\t// If segment does not contain a closer\n\t\t\t\t\t\tif (!$result['closer']) {\n\t\t\t\t\t\t\t// clean up syntax if segment is isolated and \n\t\t\t\t\t\t\t// preceded by an plain text segment\n\t\t\t\t\t\t\t$last = ArrayMethods::last($current['children']);\n\t\t\t\t\t\t\tif ($result['isolated'] && is_string($last)) {\n\t\t\t\t\t\t\t\tarray_pop($current['children']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$current = &$current['children'][count($current['children']) - 1];\n\t\t\t\t\t\t} else if (isset($current['tag']) && $result['tag'] == $current['tag']) {\n\t\t\t\t\t\t\t$start = $current['index'] + 1;\n\t\t\t\t\t\t\t$length = $i - $start;\n\t\t\t\t\t\t\t$current['source'] = implode(array_slice($array, $start, $length));\n\t\t\t\t\t\t\t$current = &$current['parent'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$current['children'][] = $node;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $root;\n\t\t}", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function getState();", "public function draw_tree()\n\t\t{\n\t\t\t// First step\n\t\t\t$this->clear_variable();\t\t\t\n\t\t\t//==================================================================\t\t\n\t\t\t// Set of action in display\n\t\t\t//==================================================================\t\t\n\t\t\tswitch ($this->action)\n\t\t\t{\n\t\t\t\tcase 0: // No action\n\t\t\t\t\t$this->build_full_array_expansion();\n\t\t\t\tbreak;\t\n\t\t\t\tcase 1: // Do search\n\t\t\t\t\t$this->search_items();\n\t\t\t\tbreak;\n\t\t\t\tcase 2: // Clear search\n\t\t\t\t\t$this->listexpand = ''; \n\t\t\t\t\t$this->listhighlight = '';\n\t\t\t\t\t$this->message = $_SESSION[$this->ssid]['MT']['global_text'][7]['LT'];\n\t\t\t\tbreak;\n\t\t\t\tcase 3: // No more in use available\n\t\t\t\tbreak;\t\n\t\t\t\tcase 4: // Refresh display\n\t\t\t\t\tif ($this->listhighlight != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->listexpand = $this->listhighlight;\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// No search\n\t\t\t\t\t\t// Keep current listexpand\n\t\t\t\t\t}\n\t\t\t\t\t$this->build_full_array_expansion();\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t//==================================================================\t\t\n\t\t\t// Build tree\n\t\t\t$this->build_tree();\n\n\t\t\t//==================================================================\n\t\t\t// Manage number of item found in search\n\t\t\t//==================================================================\n\t\t\tif($this->count_item_found != 'none')\n\t\t\t{\n\t\t\t\tif($this->count_item_found == 'NoItemFound')\n\t\t\t\t{\n\t\t\t\t\t$this->message = str_replace('$s',htmlentities($this->inputsearch,ENT_QUOTES,'UTF-8'),$_SESSION[$this->ssid]['MT']['global_text'][5]['LT']);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->message = str_replace('$s',htmlentities($this->inputsearch,ENT_QUOTES,'UTF-8'),str_replace('$i',$this->count_item_found,$_SESSION[$this->ssid]['MT']['global_text'][6]['LT']));\n\t\t\t\t}\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t\n\t\t\t//==================================================================\n\t\t\t// Catch mouse event on body div\n\t\t\t//==================================================================\n\t\t\tif(!$this->edit_mode)\n\t\t\t{\n\t\t\t\t$flying_popup = '';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$flying_popup = ' onmousemove=\"node_move(\\''.$this->internal_id.'\\',event);\" ';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t// Define HTML Div structure\n\t\t\techo '\n\t\t\t<div id=\"'.$this->internal_id.'main\" class=\"'.$this->style.'\">\n\t\t\t\t\n\t\t\t\t<div id=\"'.$this->internal_id.'headbar\" class=\"'.$this->style.'_headbar\">';\n\t\t\t\tif($this->display_version)\n\t\t\t\t{\n\t\t\t\t\techo '\t<div id=\"'.$this->internal_id.'_version\" class=\"'.$this->style.'_version\"';\n\t\t\t\t\tif ($this->enable_ticket_link)\n\t\t\t\t\t{\n\t\t\t\t\t\techo ' style=\"cursor: pointer;\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][27]['LT']).'\\')\" onClick=\"window.open(\\''.$this->application_release.'/bugs\\');\"';\n\t\t\t\t\t}\n\t\t\t\t\techo '>'.$this->application_release.'</div>';\n\t\t\t\t}\t\n\t\t\t\t\techo '<div id=\"'.$this->internal_id.'_search\" class=\"'.$this->style.'_search\">'.$this->search_name.' <input id=\"'.$this->internal_id.'_searchinput\" onkeydown=\"return mt_key_manager(event,\\''.$this->internal_id.'\\')\" type=\"text\" value=\"'.htmlentities($this->inputsearch,ENT_QUOTES,'UTF-8').'\" size=30 maxlength=50></div>\n\t\t\t\t\t<div id=\"'.$this->internal_id.'_bar_button\" class=\"'.$this->style.'_bar_button\">\n\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_search\" class=\"'.$this->style.'_button_search\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][3]['LT']).'\\')\" onClick=\"search_on_tree(\\''.$this->internal_id.'\\')\"></div>\n\t\t\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_bar_navigation\" class=\"'.$this->style.'_bar_navigation\" ';\n\t\t\tif($this->listhighlight != '')\n\t\t\t{\n\t\t\t\t// Always display navigation bar if some items highlighted \n\t\t\t\techo 'style=\"display:block;\"';\t\t\n\t\t\t}\n\t\t\techo '>\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_navigation_first\" class=\"'.$this->style.'_button_navigation_first\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][20]['LT']).'\\')\" onClick=\"navigation_focus(\\''.$this->internal_id.'\\',\\'first\\')\"></div>\n\t\t\t\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_navigation_before\" class=\"'.$this->style.'_button_navigation_before\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][21]['LT']).'\\')\" onClick=\"navigation_focus(\\''.$this->internal_id.'\\',\\'before\\')\"></div>\n\t\t\t\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_navigation_next\" class=\"'.$this->style.'_button_navigation_next\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][22]['LT']).'\\')\" onClick=\"navigation_focus(\\''.$this->internal_id.'\\',\\'next\\')\"></div>\n\t\t\t\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_navigation_last\" class=\"'.$this->style.'_button_navigation_last\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][23]['LT']).'\\')\" onClick=\"navigation_focus(\\''.$this->internal_id.'\\',\\'last\\')\"></div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_off\" class=\"'.$this->style.'_button_collapse\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][2]['LT']).'\\')\" onClick=\"reduce_expand_all(\\''.$this->internal_id.'\\',false)\"></div>\n\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_on\" class=\"'.$this->style.'_button_expand\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][1]['LT']).'\\')\" onClick=\"reduce_expand_all(\\''.$this->internal_id.'\\',true)\"></div>\n\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_refresh\" class=\"'.$this->style.'_button_refresh\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][13]['LT']).'\\')\" onClick=\"refresh_display(\\''.$this->internal_id.'\\',\\''.$this->myfocus.'\\')\"></div>\n\t\t\t\t\t\t';\n\t\t\t\tif($this->doc_user)\n\t\t\t\t{\n\t\t\t\t\techo '<div id=\"'.$this->internal_id.'_button_doc_user\" class=\"'.$this->style.'_button_doc_user\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][28]['ST']).'\\')\" onClick=\"window.open(\\''.$this->application_release.'\\')\"></div>';\n\t\t\t\t}\n\t\t\t\tif($this->doc_tech)\n\t\t\t\t{\n\t\t\t\t\techo '<div id=\"'.$this->internal_id.'_button_doc_tech\" class=\"'.$this->style.'_button_doc_tech\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.$this->javascript_protect($_SESSION[$this->ssid]['MT']['global_text'][29]['ST']).'\\')\" onClick=\"window.open(\\''.$this->application_release.'/indextech.php\\')\"></div>';\n\t\t\t\t}\n\t\t\t\techo ' </div>';\t\t\t\n\t\t\t// Add specific toolbar in update mode\n\t\t\t/*if ($this->edit_mode)\n\t\t\t{\n\t\t\techo '\t\t\t\n\t\t\t\t\t<div id=\"'.$this->internal_id.'_bar_edit\" class=\"'.$this->style.'_bar_edit\">\n\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_add_brother_item\" class=\"'.$this->style.'_button_add_brother_item\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.str_replace(\"'\",\"\\'\",$_SESSION[$this->ssid]['MT']['global_text'][11]['LT']).'\\')\" onClick=\"reduce_expand_all(\\''.$this->internal_id.'\\',true)\"></div>\n\t\t\t\t\t\t<div id=\"'.$this->internal_id.'_button_add_child_item\" class=\"'.$this->style.'_button_add_child_item\" onmouseout=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\'\\')\" onmouseover=\"display_message_tree(\\''.$this->internal_id.'_message\\',\\''.str_replace(\"'\",\"\\'\",$_SESSION[$this->ssid]['MT']['global_text'][12]['LT']).'\\')\" onClick=\"reduce_expand_all(\\''.$this->internal_id.'\\',true)\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t';\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\t\n\t\t\techo '\t\n\t\t\t\t<div id=\"'.$this->internal_id.'_message\" class=\"'.$this->style.'_message\">'.$this->message.'</div>\n\t\t\t\t<div id=\"'.$this->internal_id.'search_focus_last\" style=\"display:none;\">'.$this->count_item_found.'</div>\n\t\t\t\t\t\n\t\t\t\t</div>\t\n\t\t\t\t<div id=\"'.$this->internal_id.'head\" '.$flying_popup.' class=\"'.$this->style.'_overflow'.'\">'.$this->html_result.'</div>\n\t\t\t\t<div id=\"'.$this->internal_id.'mask\" class=\"'.$this->style.'_mask\"></div>\n\t\t\t\t\t\n\t\t\t\t\t<div id=\"'.$this->internal_id.'infobulle\" class=\"'.$this->style.'_infobulle\"></div>\n\t\t\t\t\t<div tabindex=1 id=\"'.$this->internal_id.'infobulle_cancel\" class=\"'.$this->style.'_infobulle_cancel\" onclick=\"infobulle_display(\\''.$this->internal_id.'\\')\" onkeydown=\"return input_key_button_infobulle(event,\\''.$this->internal_id.'\\',\\'cancel\\')\"></div>\n\t\t\t\t\t<div tabindex=2 id=\"'.$this->internal_id.'infobulle_ok\" class=\"'.$this->style.'_infobulle_ok\"></div>\n\t\t\t\t\n\t\t\t\t<div id=\"'.$this->internal_id.'main_wait_ajax\" class=\"'.$this->style.'_main_wait_ajax\"></div>\n\t\t\t\t<div id=\"'.$this->internal_id.'wait_ajax\" class=\"'.$this->style.'_wait_ajax\"></div>\n\t\t\t\t\n\t\t\t\t<div id=\"'.$this->internal_id.'move_item\" '.$flying_popup.' class=\"'.$this->style.'_move_item\"></div>\n\t\t\t\t\n\t\t\t</div>';\n\t\t\t\n\t\t}", "private function _process_new_state($new_state, &$unprocessed, &$processed)\n\t{\n\t\tif(is_string($new_state)) {\n\t\t\t// an existing state\n\t\t\tif($new_state == '#pop') {\n\t\t\t\treturn -1;\n\t\t\t} elseif(isset($unprocessed[$new_state])) {\n\t\t\t\treturn [$new_state]; //(new_state,) //??\n\t\t\t} elseif($new_state == '#push') {\n\t\t\t\treturn $new_state;\n\t\t\t} elseif(substr($new_state, 0, 5) == '#pop:') {\n\t\t\t\treturn -(int)substr($new_state, 5);\n\t\t\t} else {\n\t\t\t\t//assert False, 'unknown new state %r' % new_state\n\t\t\t\tthrow new \\Exception(sprintf('unknown new state %s', (string)$new_state));\n\t\t\t}\n\t\t\t\n\t\t//@todo combined not tested\n\t\t} elseif($new_state instanceof \\Phygments\\Lexers\\Regex\\Helper\\_Combined) {\n\t\t\t// combine a new state from existing ones\n\t\t\t$tmp_state = sprintf('_tmp_%d', $this->_tmpname);\n\t\t\t$this->_tmpname += 1;\n\t\t\t$itokens = [];\n\t\t\tforeach($new_state as $istate) {\n\t\t\t\tif($istate == $new_state) {\n\t\t\t\t\tthrow new \\Exception(sprintf('circular state ref %s', (string)$istate));\n\t\t\t\t}\n\t\t\t\t//assert istate != new_state, 'circular state ref %r' % istate\n\t\t\t\t$itokens = array_merge($itokens, $this->_process_state($unprocessed, $processed, $istate));\n\t\t\t}\n\t\t\t$processed[$tmp_state] = $itokens;\n\t\t\treturn [$tmp_state]; //(tmp_state,)\t\t\t\n\t\t\t\n\t\t} elseif(is_array($new_state)) {\n\t\t\tforeach($new_state as $istate) {\n\t\t\t\t//assert\n\t\t\t\tif(!(isset($unprocessed[$istate]) || in_array($istate, array('#pop', '#push')))) {\n\t\t\t\t\tthrow new \\Exception(sprintf('unknown new state %s', (string)$istate));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $new_state;\n\t\t\t\n\t\t} else {\n\t\t\tthrow new \\Exception(sprintf('unknown new state def %s', (string)$new_state));\n\t\t\t//assert False, 'unknown new state %r' % new_state\n\t\t}\n\t}", "public function getTrees() {}", "function _getTreeNodes( $parent_id = 0, $status = FALSE )\r\n { \r\n foreach($this->_tmp_array as $val)\r\n {\r\n if( $val['parent_id'] == $parent_id )\r\n {\r\n if( FALSE != $status )\r\n {\r\n if( $status == $val['status'] )\r\n {\r\n $val['level'] = $this->_level;\r\n $this->tree_result[] = $val;\r\n $this->_level++;\r\n $this->_getTreeNodes( $val['node'], $status );\r\n }\r\n }\r\n else\r\n {\r\n $val['level'] = $this->_level;\r\n $this->tree_result[] = $val;\r\n $this->_level++;\r\n $this->_getTreeNodes( $val['node'], $status ); \r\n }\r\n }\r\n } \r\n $this->_level--;\r\n return;\r\n }", "abstract public function getState(): array;", "public function getState() {}", "public function getState() {}", "public function getState() {}", "abstract public function setState() ;", "private function setTreeOutput(){\n \n $item = $this->item;\n \n $treeoutput = NULL;\n $menuname = NULL;\n $parameters = NULL;\n \n $menutree = \\Drupal::menuTree();\n \n if($item->menu_name == 'active-menu'){\n \n $menuname = $this->getCurrentMenuName();\n \n if($menuname)\n $parameters = $menutree->getCurrentRouteMenuTreeParameters($menuname);\n \n }else{\n $parameters = new MenuTreeParameters();\n $parameters->root = $item->menu_plid;\n $menuname = $item->menu_name;\n }\n \n \n if($parameters && $menuname){\n \n $parameters->setMaxDepth($item->menu_level);\n\n $tree = $menutree->load($menuname, $parameters);\n $treeoutput = $menutree->build($tree);\n \n }\n \n $this->treeoutput = $treeoutput;\n }", "public function getTree(): array\n\t{\n\t\t$tree = $this->getTreeFromApi();\n\t\tforeach ($tree as &$item) {\n\t\t\t$item['state'] = [\n\t\t\t\t'opened' => true,\n\t\t\t\t'selected' => \\in_array($item['tree'], $this->selectedItems)\n\t\t\t];\n\t\t}\n\t\treturn $tree;\n\t}", "private function _getTree($create = false) {}", "protected function parseState(): void\n {\n $state = $this->plotter()->parser()->getProgress();\n\n $this->setAttribute('status', $state->state());\n\n // Update plot file name only if it was not set and exists in state.\n if ($state->plotFileName() !== null && $this->getAttribute('plot_file_name') === null) {\n $filename = rtrim($this->plotter()->getDestination(), \" \\t\\n\\r\\0\\x0B\\\\/\") . DIRECTORY_SEPARATOR . trim($state->plotFileName(), \" \\t\\n\\r\\0\\x0B\\\\/\");\n Log::debug(sprintf('Plot filename resolved: %s', $filename));\n $this->setAttribute('plot_file_name', $filename);\n }\n\n if ($state->hasError()) {\n $this->setAttribute('has_error', $state->plotFileName());\n $this->setAttribute('error', $state->plotFileName());\n } else {\n $this->setAttribute('has_error', false);\n $this->setAttribute('error', null);\n }\n\n // Save will write attributes to DB only if there is changes.\n $this->save();\n\n $phase = $this->getAttribute('phase') ?? 0;\n $step = $this->getAttribute('step') ?? 0;\n $progress = $this->getAttribute('percents') ?? 0;\n\n if ($phase !== $state->phase() || $step !== $state->step() || $progress !== $state->progress()) {\n // update worker state\n $this->setAttribute('phase', $state->phase());\n $this->setAttribute('step', $state->step());\n $this->setAttribute('percents', $state->progress());\n $this->save();\n\n Log::debug(sprintf('Worker [%s] state changed. Phase %s->%s, step %s->%s, progress %s->%s]',\n $this->getAttribute('id'),\n $phase, $state->phase(),\n $step, $state->step(),\n $progress, $state->progress()\n ));\n\n // fire worker state changed event if changed\n WorkerStateEvent::dispatch(\n $this->getAttribute('job_id'),\n $phase, $state->phase(),\n $step, $state->step(),\n $progress, $state->progress()\n );\n }\n }", "function tpps_details_trees(array &$state) {\n $path = current_path();\n $args = explode('/', $path);\n $params = drupal_get_query_parameters($_POST);\n $page = 0;\n if (!empty($params['page'])) {\n $page = $params['page'];\n }\n $rows = array();\n $per_page = 20;\n\n if (empty($state['tree_info'])) {\n $output = t('The plant information for this study has not been properly updated. Please contact your site administrator.');\n return $output;\n }\n\n $skip = !empty($state['saved_values'][TPPS_PAGE_3]['skip_validation']);\n\n $_GET['page'] = $page;\n pager_default_initialize(count($state['tree_info']), $per_page);\n $chunks = array_chunk($state['tree_info'], $per_page, TRUE);\n\n foreach ($chunks[$page] as $name => $info) {\n $id = $info['organism_id'];\n $form_number = array_search($id, $state['ids']['organism_ids']);\n $species_name = $state['saved_values'][TPPS_PAGE_1]['organism'][$form_number]['name'];\n\n $tree_id = tpps_entity_link($info['stock_id'], $name, 'Stock');\n\n $row = array(\n strtoupper($args[2]) . '-' . strip_tags($tree_id),\n tpps_entity_link($info['stock_id'], $name, 'Stock'),\n tpps_entity_link($id, $species_name, 'Organism'),\n );\n if (!$skip) {\n $row[] = $info['lat'];\n $row[] = $info['lng'];\n }\n $rows[] = $row;\n }\n\n $header = array(\n 'TreeGenes Identifier',\n 'Identifier',\n 'Species',\n );\n if (!$skip) {\n $header[] = 'Latitude';\n $header[] = 'Longitude';\n }\n\n $vars = array(\n 'header' => $header,\n 'rows' => $rows,\n 'attributes' => array(\n 'class' => array('view'),\n 'id' => 'tpps_table_display',\n ),\n 'caption' => '',\n 'colgroups' => NULL,\n 'sticky' => FALSE,\n 'empty' => '',\n );\n $table = theme('table', $vars);\n $pager = theme('pager', array('quantity', count($state['tree_info'])));\n return $pager . $table;\n}", "public function run() {\n foreach ($this->data as $key => $value) {\n State::create($value);\n }\n }", "public function state();", "static function tree($params = false)\n {\n $params = parse_params($params);\n @extract($params);\n\n if (!isset($dir_name)) {\n return 'Error: You must set $dir_name for the function ' . __FUNCTION__;\n }\n if (!empty($params)) {\n ksort($params);\n }\n\n $function_cache_id = __FUNCTION__ . crc32(serialize($params));\n $cache_content = false;\n //$cache_content = $this->app->cache->get($function_cache_id, 'content/static');\n\n if (($cache_content) != false) {\n\n $tree = $cache_content;\n } else {\n\n //$this->app->cache->save($tree, $function_cache_id, $cache_group = 'content/static');\n }\n if (!isset($url)) {\n $url = $this->app->url->current(true, true);\n }\n $params['url'] = $url;\n $params['url_param'] = 'page';\n\n\n mw('Microweber\\Utils\\Files')->dir_tree($dir_name, $params);\n\n\n }", "public function rebuildtree(){\n\t\t//Rebuild categories ads trigger count.\n\n\t\t//Rebuild nested set - get cat\n\t\tBLog::addToLog('[Items] rebuilding nested sets...');\n\t\t//\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\t//\n\t\t$catslist=$this->itemsFilter(array());\n\t\tBLog::addToLog('[Items] Total categories count:'.count($catslist).'...');\n\n\t\t$rootcats=array();\n\t\t//\n\t\tforeach($catslist as $cat){\n\t\t\t$cat->level=0;\n\t\t\t$cat->lft=0;\n\t\t\t$cat->rgt=0;\n\t\t\tif(empty($cat->{$this->parentKeyName})){\n\t\t\t\t$rootcats[]=$cat;\n\t\t\t\t}\n\t\t\t}\n\t\t//Sort root categories.\n\t\t$n=count($rootcats);\n\t\tBLog::addToLog('[Items] Root categories count:'.$n.'...');\n\t\tfor($i=0; $i<$n; $i++){\n\t\t\t$m=$i;\n\t\t\tfor($j=$i+1; $j<$n; $j++){\n\t\t\t\tif($rootcats[$j]->ordering < $rootcats[$m]->ordering){\n\t\t\t\t\t$m=$j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tif($m!=$i){\n\t\t\t\t$t=$rootcats[$i];\n\t\t\t\t$rootcats[$i]=$rootcats[$m];\n\t\t\t\t$rootcats[$m]=$t;\n\t\t\t\t}\n\t\t\t}\n\n\t\t//Foreach by root categories...\n\t\tforeach($rootcats as $rcat){\n\t\t\tBLog::addToLog('[Items] Processing root category ['.$rcat->id.']');\n\n\t\t\t$rcat->level=1;\n\t\t\t$lft=1; $rgt=2;\n\t\t\t$this->rebuildtree_recursive($rcat,$lft,$rgt);\n\t\t\t$rcat->lft=1;\n\t\t\t$rcat->rgt=$rgt;\n\t\t\t}\n\t\t$db=\\Brilliant\\BFactory::getDBO();\n\t\tif(empty($db)){\n\t\t\treturn false;\n\t\t\t}\n\t\tBLog::addToLog('[Items] Updating nested set...');\n\t\tforeach($catslist as $ct){\n\t\t\t$qr='UPDATE `'.$this->tableName.'` set `'.$this->leftKeyName.'`='.$ct->lft.', `'.$this->rightKeyName.'`='.$ct->rgt.', `'.$this->levelKeyName.'`='.$ct->level.' WHERE `'.$this->primaryKeyName.'`='.$ct->id;\n\t\t\t$q=$db->query($qr);\n\t\t\tif(empty($q)){\n\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t//Invalidate all cache.\n\t\t$bcache=\\Brilliant\\BFactory::getCache();\n\t\tif($bcache){\n\t\t\t$bcache->invalidate();\n\t\t\t}\n\t\treturn true;\n\t\t}", "public function resetInTreeCache()\n\t{\n\t\t$this->in_tree_cache = array();\n\t}", "protected function _getTree($create = false) {}", "public function getState() \n\t{\n\t\tif ($this->_state == false) {\n\t\t\t$this->_state = new ProcessState();\n\t\t}\n\t\treturn $this->_state;\n\t}", "abstract public function tree_encoder();", "public function populateState()\n {\n //get states\n $app = \\Cobalt\\Container::fetch('app');\n $filter_order = $app->getUserStateFromRequest('Source.filter_order','filter_order','s.name');\n $filter_order_Dir = $app->getUserStateFromRequest('Source.filter_order_Dir','filter_order_Dir','asc');\n\n //set states\n $this->state->set('Source.filter_order',$filter_order);\n $this->state->set('Source.filter_order_Dir',$filter_order_Dir);\n }", "public function tree($just_published = FALSE)\n\t{\n\t\t$CI =& get_instance();\n\t\t$CI->load->helper('array');\n\t\t\n\t\t$data = array();\n\n\t\t$where = array();\n\t\t$group_id = (!empty($this->filters['group_id'])) ? $this->filters['group_id'] : $this->group_id;\n\t\t$where['group_id'] = $group_id;\n\n\t\tif ($just_published) $where['published'] = 'yes';\n\t\t$all_nav = $this->find_all_array_assoc('id', $where);\n\n\t\t$where = array();\n\t\tif (!empty($parent))\n\t\t{\n\t\t\t$parent = $this->find_one_array(array('location' => $parent));\n\t\t\t$where = array('group_id' => $group_id, 'parent_id' => $parent['id']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$where = array('group_id' => $group_id);\n\t\t}\n\t\t$data = $this->find_all_array($where, 'precedence, location asc');\n\t\t$return = array();\n\t\t$i = 0;\n\t\tforeach($data as $key => $val)\n\t\t{\n\t\t\t$return[$key] = $val;\n\n\t\t\tif ($val['parent_id'] != 0) {\n\t\t\t\tif (empty($all_nav[$val['parent_id']]))\n\t\t\t\t{\n\t\t\t\t\tif (empty($return['_orphans']))\n\t\t\t\t\t{\n\t\t\t\t\t\t$return['_orphans'] = array('label' => '_orphans', 'parent_id' => 0, 'location' => null);\n\t\t\t\t\t}\n\t\t\t\t\t$return[$key]['parent_id'] = '_orphans';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$return[$key]['parent_id'] = 0;\n\t\t\t\t\n\t\t\t}\n\n\t\t\t\n\t\t\tif ($val['published'] == 'no')\n\t\t\t{\n\t\t\t\t$return[$key]['attributes'] = array('class' => 'unpublished', 'title' => 'unpublished');\n\t\t\t}\n\t\t\t$return[$key]['location'] = fuel_url('navigation/edit/'.$val['id']);\n\t\t}\n\t\t//$return = array_sorter($return, 'label', 'asc');\n\t\treturn $return;\n\t}", "public function compute(): void\n {\n try {\n $this->emit(new Group\\Start($this->parser));\n $this->getLeftNode()->compute();\n $this->emit($this);\n $this->getRightNode()->compute();\n $this->emit(new Group\\End($this->parser));\n } catch (NodeHandledException $e) {\n return;\n }\n }", "public function processState(&$state) {\n\t\tassert('is_array($state)');\n\t\tassert('array_key_exists(\"ReturnURL\", $state) || array_key_exists(\"ReturnCall\", $state)');\n\t\tassert('!array_key_exists(\"ReturnURL\", $state) || !array_key_exists(\"ReturnCall\", $state)');\n\n\t\t$state[self::FILTERS_INDEX] = $this->filters;\n\n\t\ttry {\n\n\t\t\tif (!array_key_exists('UserID', $state)) {\n\t\t\t\t/* No unique user ID present. Attempt to add one. */\n\t\t\t\tself::addUserID($state);\n\t\t\t}\n\n\t\t\twhile (count($state[self::FILTERS_INDEX]) > 0) {\n\t\t\t\t$filter = array_shift($state[self::FILTERS_INDEX]);\n\t\t\t\t$filter->process($state);\n\t\t\t}\n\n\t\t} catch (SimpleSAML_Error_Exception $e) {\n\t\t\t/* No need to convert the exception. */\n\t\t\tthrow $e;\n\t\t} catch (Exception $e) {\n\t\t\t/*\n\t\t\t * To be consistent with the exception we return after an redirect,\n\t\t\t * we convert this exception before returning it.\n\t\t\t */\n\t\t\tthrow new SimpleSAML_Error_UnserializableException($e);\n\t\t}\n\n\t\t/* Completed. */\n\t}", "protected function _getState($name) {}", "abstract protected function getMenuTree();", "public function beforeSave()\n {\n $this->rebuildTree();\n }", "protected function _processBreadcrumb(array &$tree, array &$result) {\n\t\ttry {\n\t\t\tif(isset($tree['childnodes'])) {\n\t\t\t\tforeach($tree['childnodes'] as &$item) {\n\t\t\t\t\tif($item['state'] > 0) {\n\t\t\t\t\t\t$result[] =& $item;\n\n\t\t\t\t\t\tif(isset($item['childnodes'])) {\n\t\t\t\t\t\t\t$this->_processBreadcrumb($item, $result);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunset($item, $node, $status);\n\t\t\t}\n\n\t\t\tunset($tree, $result);\n\t\t} catch(\\Exception $exception) {\n\t\t\tthrow new \\RuntimeException(\\Glue\\Helper\\General::replace(array('method' => __METHOD__), GLUE_EXCEPTION_METHOD_FAILED), NULL, $exception);\n\t\t}\n\t}", "public function getState()\n {\n }", "private function eval_treeview()\n {\n static $bool_drsFirstPrompt = true;\n\n // LOOP each filter\n foreach ( ( array ) $this->conf_view[ 'filter.' ] as $table => $fields )\n {\n // CONTINUE : table hasn't any dot\n if ( rtrim( $table, '.' ) == $table )\n {\n continue;\n }\n // CONTINUE : table hasn't any dot\n\n foreach ( array_keys( ( array ) $fields ) as $field )\n {\n // CONTINUE : field has an dot\n if ( rtrim( $field, '.' ) != $field )\n {\n continue;\n }\n // CONTINUE : field has an dot\n // Class var table.field\n $tableField = $table . $field;\n\n $conf_view = $this->conf_view;\n $cObj_name = $conf_view[ 'filter.' ][ $table ][ $field . '.' ][ 'treeview.' ][ 'enabled' ];\n $cObj_conf = $conf_view[ 'filter.' ][ $table ][ $field . '.' ][ 'treeview.' ][ 'enabled.' ];\n $treeviewEnabled = $this->pObj->cObj->cObjGetSingle( $cObj_name, $cObj_conf );\n\n // CONTINUE : field has an dot\n if ( !$treeviewEnabled )\n {\n continue;\n }\n // CONTINUE : field has an dot\n // DRS\n if ( $this->pObj->b_drs_warn )\n {\n if ( $bool_drsFirstPrompt )\n {\n $prompt = 'DON\\'T USE AJAX: The treeview of ' . $tableField . ' is enabled. ' .\n 'You will get unexpected effects!';\n t3lib_div :: devLog( '[WARN/FILTER] ' . $prompt, $this->pObj->extKey, 2 );\n $bool_drsFirstPrompt = false;\n }\n }\n // DRS\n // #i0117, 141223, dwildt, 1+\n $this->treeviewTableFields[] = $tableField;\n\n switch ( $this->conf_view[ 'filter.' ][ $table ][ $field ] )\n {\n case( 'CATEGORY_MENU' ):\n $this->eval_treeviewCategoryMenu( $tableField );\n break;\n case( 'TREEVIEW' ):\n $this->eval_treeviewCheckbox( $tableField );\n // #43692, 121206, dwildt, 13+\n // Adding jQuery\n $bool_success_jQuery = $this->pObj->objJss->load_jQuery();\n if ( $bool_success_jQuery )\n {\n if ( $this->pObj->b_drs_javascript )\n {\n $prompt = 'Current filter is a treeview.';\n t3lib_div::devlog( '[INFO/JSS] ' . $prompt, $this->pObj->extKey, 0 );\n $prompt = 'jQuery will be loaded.';\n t3lib_div::devlog( '[INFO/JSS] ' . $prompt, $this->pObj->extKey, 0 );\n }\n }\n // Adding jQuery\n // #43692, 121206, dwildt, 13+\n break;\n default:\n $header = 'Evaluation of treeview filter failed!';\n $text = '' . $tableField . ' is configured as ' . $this->conf_view[ 'filter.' ][ $table ][ $field ] . '\n <br />\n But ' . $tableField . '.treeview.enabled is true. This isn\\'t proper.\n <br />\n Please take care of a proper TypoScript configuration.<br />\n Remove ' . $tableField . '.treeview.enabled or set it to false.';\n $this->pObj->drs_die( $header, $text );\n break;\n }\n }\n }\n // LOOP each filter\n\n return;\n }", "function _outputTree () {\r\n // this could e.g. call _applyPostfilters\r\n return true;\r\n }", "public function execute()\n {\n //children[child_id][startdate] = startdate[child_id];\n $newCartState = $this->state->toObject();\n\n $cartSession = JFactory::getSession();\n $cart = ($cart = $cartSession->get('sp4k_cart')) ? $cart : [];\n\n if(count($cart)>0) {\n foreach($cart as $item_type=>&$type_items){\n if($newCartState->item_type == $item_type){\n if(array_key_exists($newCartState->{$newCartState->item_identifier},$type_items)){\n $test='test';\n $type_items[$newCartState->{$newCartState->item_identifier}] = $newCartState;\n }\n }\n }\n }else{\n $cart[$newCartState->item_type][$newCartState->{$newCartState->item_identifier}]\n = $newCartState;\n }\n\n $cartSession->set('sp4k_cart',$cart);\n\n /**\n * todo\n * set a cart item type, then use a class to process that cart item for display.\n * also use that class to process new additions to the cart, so it can intelligently merge new items.\n *\n */\n }", "function CreateTree($data,$p_id=0,$level=0){\n if(!$data){\n return;\n }\n static $newarray=[];\n foreach($data as $k=>$v){\n if($v->p_id==$p_id){\n $v->level=$level;\n $newarray[]=$v;\n //调用自身\n $this->CreateTree($data,$v->cate_id,$level+1);\n }\n }\n return $newarray;\n}", "function update_tree()\n\t{\n\t\n\t\t$data = array();\n\t\t$field_prefs = array();\n\t\t\n\t\t// get all our post data\n\t\t$data['id'] \t\t= $this->EE->input->post('id');\n\t\t$data['site_id']\t= $this->site_id;\n\t\t$data['label']\t\t= $this->EE->input->post('label');\n\t\t$data['fields'] \t= $this->EE->input->post('fields');\n\t\t$data['template_preferences'] = $this->EE->input->post('template_preferences');\n\t\t$data['channel_preferences'] = $this->EE->input->post('channel_preferences');\n\t\t$data['permissions'] = $this->EE->input->post('member_group_preferences');\n\t\t$data['max_depth'] = (int) $this->EE->input->post('max_depth');\n\t\t\n\t\t// implode posted array data\n\t\t$data['template_preferences'] = (is_array($data['template_preferences']) ? implode('|', $data['template_preferences']) : '');\n\t\t$data['channel_preferences'] = (is_array($data['channel_preferences']) ? implode('|', $data['channel_preferences']) : '');\n\t\t$data['permissions'] \t\t = (is_array($data['permissions']) ? implode('|', $data['permissions']) : '');\n\t\t\n\t\t// prep our custom field data\n\t\tif($data['fields'] && is_array($data['fields']))\n\t\t{\n\t\t\tforeach($data['fields'] as $key => $field)\n\t\t\t{\n\t\t\t\tif($field['label'] && $field['name'])\n\t\t\t\t{\n\t\t\t\t\t$field_prefs[$key] = $field;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$data['fields'] = (count($field_prefs) > 0) ? base64_encode(serialize($field_prefs)) : '';\n\n\t\t$data = $this->EE->security->xss_clean($data);\n\n\t\t// do we have an id? update...\n\t\tif( $data['id'] )\n\t\t{\n\t\t\t$this->EE->db->query($this->EE->db->update_string('exp_taxonomy_trees', $data, \"id = \".$data['id']));\n\t\t\t$this->EE->session->set_flashdata('message_success', lang('properties_updated'));\n\t\t\t$ret = ($this->EE->input->post('update_and_return')) ? $this->_base_url : $this->_base_url.AMP.'method=edit_tree'.AMP.'tree_id='.$data['id'];\n\t\t\t$this->EE->functions->redirect($ret);\t\n\t\t}\n\t\t// if not then create the new tree table\n\t\telse\n\t\t{\n\t\t\tunset($data['id']);\n\t\t\t$this->EE->db->query($this->EE->db->insert_string('exp_taxonomy_trees', $data));\n\t\t\t$tree_id = $this->EE->db->insert_id();\n\t\t\t// build our tree table\n\t\t\t$this->EE->ttree->build_tree_table($tree_id);\n\t\t\t// notify of success and redirect\n\t\t\t$this->EE->session->set_flashdata('message_success', lang('tree_added'));\n\t\t\t$ret = ($this->EE->input->post('update_and_return')) ? $this->_base_url : $this->_base_url.AMP.'method=edit_tree'.AMP.'tree_id='.$tree_id;\n\t\t\t$this->EE->functions->redirect($ret);\t\n\t\t}\n\t\n\t}", "function perform()\n { \n // init variables (see private function below)\n $this->initVars();\n \n // dont proceed if an error occure\n if(isset( $this->dontPerform ))\n {\n return;\n }\n \n // get requested node content\n $this->model->action('navigation','getNode', \n array('result' => & $this->tplVar['node'],\n 'id_node' => (int)$this->current_id_node,\n 'status' => array('>=',2),\n 'fields' => array('title','body','id_node','media_folder')));\n \n // get child nodes content of the requested node\n // only with status=2, means active \n $this->model->action('navigation','getChilds', \n array('result' => & $this->tplVar['childNodes'],\n 'id_node' => (int)$this->current_id_node,\n 'status' => array('>=',2),\n 'fields' => array('title','short_text','id_node')));\n \n // get navigation node branch content of the requested node\n $this->model->action('navigation','getBranch', \n array('result' => & $this->tplVar['nodeBranch'],\n 'id_node' => (int)$this->current_id_node,\n 'fields' => array('title','id_node'))); \n \n // get node related links\n $this->model->action('link','getLinks', \n array('result' => & $this->tplVar['links'],\n 'id_node' => (int)$this->current_id_node,\n 'status' => array('=','2'),\n 'fields' => array('title','url','description'))); \n }", "function process_state($args = array()) {\n\n\tglobal $_REQUIRED_ARGS, $AccountDomain, $AccountName, $DB;\n\n\n\t$tmp = array_shift($args);\n\tunset($tmp);\n\n\tif(ADMIN_DEBUG_MODE === true) {\n\t\techo \"Notice: RUNNING IN DEBUG MODE\\n(modify admin config to turn off)\\n\";\n\t\t$str = var_export($args, true);\n\t\techo \"-- args --\\n\"; echo $str;\n\t\techo \"\\n---------------\\n\";\n\t}\n\n\tif(!isset($args) || count($args) != count($_REQUIRED_ARGS)) {\n\t\treturn INVALID_ARGS;\n\t}\n\n\t$arg_vals = array();\n\tforeach($args as $idx => $arg) {\n\t\t$tmp = explode(\"=\", $arg);\n\t\tif(isset($tmp[1]))\n\t\t\t$arg_vals[strtoupper($tmp[0])] = $tmp[1];\n\t\telse\n\t\t\t$arg_vals[strtoupper($tmp[0])] = null;\n\t}\n\n\tforeach($_REQUIRED_ARGS as $idx => $req_arg) {\n\t\tif(!isset($arg_vals[$req_arg]) || is_null($arg_vals[$req_arg]))\n\t\t\treturn INVALID_ARGS;\n\t}\n\n\tif($arg_vals[\"--ADMINPWD\"] != ADMIN_PWD)\n\t\treturn INVALID_ARGS;\n\n\t$AccountDomain = $arg_vals[\"--DOMAIN\"];\n\t$AccountName = $arg_vals[\"--NAME\"];\n\n\tif(!$DB->Link()) {\n\t\treturn DBCON_FAILURE;\n\t}\n\n\treturn PROCESS_READY;\n}", "public function process_post() {\n\t\t$name = $this->node->attr('name');\n\n\n\t\tif (!empty($_POST) && $this->get_post_value($name)) {\n//\t\t\t$this->value = $this->get_post_value($name);\n\t\t\t$this->value($this->get_post_value($name));\n\t\t}\n\t}", "function get_nodes()\n {\n\n \tif( !isset($this->cache['trees'][$this->tree_id]['nodes']))\n \t{\n \t\tee()->db->select('*');\n\t\t\tee()->db->from( $this->tree_table );\n\t\t\tee()->db->join('channel_titles', 'channel_titles.entry_id = '.$this->tree_table.'.entry_id', 'left');\n\t\t\tee()->db->join('statuses', 'statuses.status = channel_titles.status', 'left');\n \t\t$nodes = ee()->db->get()->result_array();\n\n \t\t// map field names => type\n\t\t\t$cf_map = array();\n\t\t\tforeach( $this->cache['trees'][$this->tree_id]['fields'] as $cf)\n\t\t\t{\n\t\t\t $cf_map[$cf['name']] = $cf['type'];\n\t\t\t}\n\n \t\t// reindex with node ids as keys\n \t\t$node_data = $entry_data = array();\n \t\tforeach($nodes as $node)\n \t\t{\n \t\t\t// if the node is associated with an entry\n \t\t\t// create another index for those\n \t\t\tif($node['entry_id'])\n \t\t\t{\n \t\t\t\t$entry_data[ $node['entry_id'] ] = $node['node_id'];\n \t\t\t}\n\n \t\t\tif($node['type'] != '')\n \t\t\t{\n \t\t\t\t$node['type'] = explode('|', $node['type']);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$node['type'] = array();\n \t\t\t}\n\n \t\t\tif(!empty($node['field_data']))\n \t\t\t{\n \t\t\t\tee()->load->library('taxonomy_field_lib');\n \t\t\t\t$node['field_data'] = json_decode($node['field_data'], TRUE);\n \t\t\t\tforeach($node['field_data'] as $k => $v)\n \t\t\t\t{\n \t\t\t\t\t// this should apply to front end template parsing only \n \t\t\t\t\t$callers = debug_backtrace();\n \t\t\t\t\tif ( isset($callers[2]['function']) && $callers[2]['function'] == 'process_tags' && isset($cf_map[$k]))\n \t\t\t\t\t{\n \t\t\t\t\t\t\n \t\t\t\t\t\t$ft = ee()->taxonomy_field_lib->load($cf_map[$k]);\n \t\t\t\t\t\t// let the fieldtype change the final value\n \t\t\t$v = $ft->replace_value($v);\n \t\t\t// overwrite value\n \t\t\t$node['field_data'][$k] = $v;\n \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$node[$k] = $v;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\t$node_data[ $node['node_id'] ] = $node;\n \t\t\t$node_data[ $node['node_id'] ]['url'] = $this->build_url($node);\n \t\t\t\n \t\t}\n\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_node_id'] = $node_data;\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_entry_id'] = $entry_data;\n \t}\n\n \treturn $this->cache['trees'][$this->tree_id]['nodes'];\n\n }", "static function recreateTree() {\n global $DB;\n\n // Reset the tree\n $DB->update(\n 'glpi_ipnetworks', [\n 'ipnetworks_id' => 0,\n 'level' => 1,\n 'completename' => new \\QueryExpression($DB->quoteName('name'))\n ], [true]\n );\n\n // Foreach IPNetwork ...\n $iterator = $DB->request([\n 'SELECT' => 'id',\n 'FROM' => self::getTable()\n ]);\n\n $network = new self();\n\n while ($network_entry = $iterator->next()) {\n if ($network->getFromDB($network_entry['id'])) {\n $input = $network->fields;\n // ... update it by its own entries\n $network->update($input);\n }\n }\n }", "public function traverse()\n {\n return $this->doTraverse($this->tree);\n }", "protected function populateState() {\n\t\t\n\t $app\t = JFactory::getApplication();\n\t\t/** @var $app JSite **/\n\t \n\t\t$params\t = $app->getParams($this->option);\n\t\t$this->setState('params', $params);\n\t\t\n\t\t// Visitor\n\t\t$visitorId = (int)JFactory::getUser()->get(\"id\");\n\t\t$this->setState($this->option.'.visitor.id', $visitorId);\n\t\t\n\t\t$userId = $app->input->get->getInt(\"id\");\n\t\tif(!$userId) {\n\t\t $userId = (int)JFactory::getUser()->get(\"id\");\n\t\t}\n\t\t$this->setState($this->option.'.profile.user_id', $userId);\n\t\t\n\t $value = ($userId == $visitorId) ? true : false;\n\t $this->setState($this->option.'.visitor.is_owner', $value);\n\t}", "function stateMachine() {\n\t\tif ($_SESSION['order_condition'] == 'RW') {\n\t\t\tswitch($_SESSION['state']) {\n\t\t\t\tcase \"START\":\t\n\t\t\t\t\t$_SESSION['section_order'] = 1;\n\t\t\t\t\t$_SESSION['section_total'] = 27;\n\t\t\t\t\tstateTransition('pages/ethics.html', 'DEMOGRAPHICS');\n\t\t\t\t\t//stateTransition('pages/ethics.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DEMOGRAPHICS\":\n\t\t\t\t\tstateTransition('pages/demographics.html', 'INSTR_EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_SCRIPT\":\n\t\t\t\t\tstateTransition('pages/before_learn_letters.html', 'SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"SCRIPT\":\n\t\t\t\t\tstateTransition('pages/learn_letters.html', 'INSTR_R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_R_TR1\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR1\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR1\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR1\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_R_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR2\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR2\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR2\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR2\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_EXPOSURE3');\n\t\t\t\t\tbreak;\t\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR3\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR3\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR3\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR3\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_R_TEST\":\n\t\t\t\t\tstateTransition('pages/before_reading_test.html', 'R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TEST\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TEST\":\n\t\t\t\t\tstateTransition('pages/before_writing_test.html', 'W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TEST\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'QUESTIONNAIRE');\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\tcase \"QUESTIONNAIRE\":\n\t\t\t\t\tstateTransition('pages/questionnaire.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"END\":\n\t\t\t\t\tstateTransition('pages/end.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tswitch($_SESSION['state']) {\n\t\t\t\tcase \"START\":\t\n\t\t\t\t\t$_SESSION['section_order'] = 1;\n\t\t\t\t\t$_SESSION['section_total'] = 27;\n\t\t\t\t\tstateTransition('pages/ethics.html', 'DEMOGRAPHICS');\n\t\t\t\t\t//stateTransition('pages/ethics.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"DEMOGRAPHICS\":\n\t\t\t\t\tstateTransition('pages/demographics.html', 'INSTR_EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE1\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_SCRIPT\":\n\t\t\t\t\tstateTransition('pages/before_learn_letters.html', 'SCRIPT');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"SCRIPT\":\n\t\t\t\t\tstateTransition('pages/learn_letters.html', 'INSTR_W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_W_TR1\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR1\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR1\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR1');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR1\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE2\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR2\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR2\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TR2');\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase \"INSTR_R_TR2\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR2');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR2\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_EXPOSURE3');\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/before_exposure.html', 'EXPOSURE3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"EXPOSURE3\":\n\t\t\t\t\tstateTransition('pages/learn_words.html', 'INSTR_W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_W_TR3\":\n\t\t\t\t\tstateTransition('pages/before_writing_practice.html', 'W_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TR3\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TR3\":\n\t\t\t\t\tstateTransition('pages/before_reading_practice.html', 'R_TR3');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TR3\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'INSTR_W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tcase \"INSTR_W_TEST\":\n\t\t\t\t\tstateTransition('pages/before_writing_test.html', 'W_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"W_TEST\":\n\t\t\t\t\tstateTransition('pages/writing.html', 'INSTR_R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"INSTR_R_TEST\":\n\t\t\t\t\tstateTransition('pages/before_reading_test.html', 'R_TEST');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"R_TEST\":\n\t\t\t\t\tstateTransition('pages/reading.html', 'QUESTIONNAIRE');\n\t\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcase \"QUESTIONNAIRE\":\n\t\t\t\t\tstateTransition('pages/questionnaire.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"END\":\n\t\t\t\t\tstateTransition('pages/end.html', 'END');\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t}\t// switch end\n\t\t}\t// condition end\n\t}", "function reorder_nodes()\n\t{\n\t\t\n\t\t// @todo introduce some tests here to make sure data is a valid nested set etc.\n\t\t// completely reliant on clean outut from js here\n\t\t\n\t\t$tree_id = $this->EE->input->get_post('tree_id');\n\n\t\t$this->EE->ttree->check_tree_table_exists($tree_id);\n\t\t\n\t\t$tree_settings = $this->EE->ttree->get_tree_settings($tree_id);\n\t\t\n\t\t$sent_last_updated = $this->EE->input->get_post('last_updated');\n\n\t\tif($sent_last_updated != $tree_settings['last_updated'])\n\t\t{\n\t\t\t$resp['data'] = 'last_update_mismatch';\t\n\t\t\t$this->EE->output->send_ajax_response($resp);\n\t\t}\n\n\t\t$node_id = '';\n\t\t$lft = '';\n\t\t$rgt = '';\n\n\t\t$taxonomy_order = $this->EE->input->get_post('taxonomy_order');\n\t\t$taxonomy_order = rtrim($taxonomy_order, '|');\n\n\t\tif($taxonomy_order)\n\t\t{\n\t\t\t$m = explode(\"|\", $taxonomy_order);\n\t\t\t\n\t\t\t$lq = \"LOCK TABLE exp_taxonomy_tree_\".$tree_id.\" WRITE\";\n\t\t\t$res = $this->EE->db->query($lq);\n\n\t\t\tforeach($m as $items)\n\t\t\t{\n\n\t\t\t\t$item = explode(',', $items);\n\t\t\t\t\n\t\t\t\tif(isset($item[0]) && $item[0] != '')\n\t\t\t\t{\n\t\t\t\t\t$node_id \t= str_replace(\"id:\", \"\", $item[0]);\n\t\t\t\t\t$lft\t\t= str_replace(\"lft:\", \"\", $item[1]);\n\t\t\t\t\t$rgt \t\t= str_replace(\"rgt:\", \"\", $item[2]);\n\t\t\t\t}\n\n \tif($node_id != 'root')\n \t{\n\t \t $data = array(\n\t\t 'node_id' \t=> $node_id,\n\t\t 'lft' \t\t=> $lft,\n\t\t 'rgt' \t\t=> $rgt\n\t \t);\n\t \t\n\t \t$this->EE->db->where('node_id', $node_id);\n\t\t\t\t\t$this->EE->db->update('exp_taxonomy_tree_'.$tree_id, $data);\n\t \t\n\t }\n\t \n\t if($node_id == 'root')\n \t{\n\t \t $data = array(\n\t\t 'lft' \t\t=> $lft,\n\t\t 'rgt' \t\t=> $rgt\n\t \t);\n\t \t\n\t \t$this->EE->db->where('lft', $lft);\n\t\t\t\t\t$this->EE->db->update('exp_taxonomy_tree_'.$tree_id, $data);\n\t \t\n\t }\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$ulq = \"UNLOCK TABLES\";\n\t\t\t$res = $this->EE->db->query($ulq);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t// update the last_updated timestamp\n\t\t$this->EE->ttree->set_last_update_timestamp($tree_id);\n\t\t\n\t\t// last_updated timestamp has been updated, so fetch again.\n\t\tunset($this->EE->session->cache['taxonomy']['tree'][$tree_id]['settings']);\n\t\t$tree_settings = $this->EE->ttree->get_tree_settings($tree_id);\n\t\t\n\t\t$resp['data'] = 'Node order updated';\n\t\t$resp['last_updated'] = $tree_settings['last_updated'];\n\t\t\n\t\tunset($data);\n\t\t\n\t\t// update our stashed tree array\n\t\t$this->EE->ttree->rebuild_tree_array($tree_id);\n\t\t$this->EE->output->send_ajax_response($resp);\t\n\n\t}", "public function getState(/* ... */)\n {\n return $this->_state;\n }", "public static function __set_state($data);", "private function brokeTree()\n {\n $i = 0;\n foreach ($this->nodeIdList as $node) {\n $this->getDb()->createCommand()->update(\n self::tableName(),\n [\n $this->leftAttribute => ++$i,\n $this->rightAttribute => ++$i,\n $this->depthAttribute => 0,\n '_tree' => $this->globalParentNode,\n ],\n ['=', 'id', $node]\n )->query();\n }\n }", "abstract protected function getCurrentChildren(): array ;", "public function __destruct()\n\t{\n\t\t$this->tree = false;\n\t\t$this->current_category = false;\n\t\t$this->tree_steped_item = false;\n\t\t$this->tree_items = 0;\n\t\t$this->walk_step = 0;\n\t\t$this->parent_data = false;\n\t}", "function _memorizeCleanState() ;", "public function onToggleTreeNode()\n {\n $this->putSession('tree_node_status_' . post('node_id'), post('status') ? 0 : 1);\n return $this->onRefresh();\n }", "public function getStateMachine();", "public static function buildTree($arr, $pid = 0);", "protected function _unmarkInternalTree(): void\n {\n $config = $this->getConfig();\n $this->_table->updateAll(\n function (QueryExpression $exp) use ($config) {\n $leftInverse = clone $exp;\n $leftInverse->setConjunction('*')->add('-1');\n $rightInverse = clone $leftInverse;\n\n return $exp\n ->eq($config['leftField'], $leftInverse->add($config['leftField']))\n ->eq($config['rightField'], $rightInverse->add($config['rightField']));\n },\n fn (QueryExpression $exp) => $exp->lt($config['leftField'], 0)\n );\n }", "private function processState(&$state)\n {\n $filters = self::parseFilterList($this->authproc);\n try {\n while (count($filters) > 0) {\n $filter = array_shift($filters);\n $filter->process($state);\n }\n } catch (\\SimpleSAML\\Error\\Exception $e) {\n // No need to convert the exception\n throw $e;\n } catch (\\Exception $e) {\n /*\n * To be consistent with the exception we return after an redirect,\n * we convert this exception before returning it.\n */\n throw new \\SimpleSAML\\Error\\UnserializableException($e);\n }\n\n // Completed\n }", "function getState()\n {\n\t\treturn $this->_state;\n }", "protected function _getTree(){\n\t\tif (!$this->_tree) {\n\t\t\t$this->_tree = Mage::getResourceModel('megamenu2/menuitem_tree')->load();\n\t\t}\n\t\treturn $this->_tree;\n\t}", "function automap_fetch_tree($dir, $MAPCFG, $params, &$saved_config, $obj_name, $layers_left, &$this_tree_lvl) {\n // Stop recursion when the number of layers counted down\n if($layers_left != 0) {\n try {\n global $_BACKEND;\n if($dir == 'childs') {\n if($obj_name == '<<<monitoring>>>') {\n try {\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getHostNamesWithNoParent();\n } catch(BackendConnectionProblem $e) {\n $relations = array();\n }\n } elseif (cfg('global', 'shinken_features')) {\n if ($params['min_business_impact']){\n $tmp_array = array_flip(list_business_impact());\n $min_business_impact = $tmp_array[$params['min_business_impact']];\n }\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectChildDependenciesNamesByHostName($obj_name, $min_business_impact);\n } else {\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectChildNamesByHostName($obj_name);\n }\n } else {\n if (cfg('global', 'shinken_features')) {\n if ($params['min_business_impact']){\n $tmp_array = array_flip(list_business_impact());\n $min_business_impact = $tmp_array[$params['min_business_impact']];\n }\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectParentDependenciesNamesByHostName($obj_name, $min_business_impact);\n } else {\n $relations = $_BACKEND->getBackend($params['backend_id'][0])->getDirectParentNamesByHostName($obj_name);\n }\n }\n } catch(BackendException $e) {\n $relations = array();\n }\n\n foreach($relations AS $rel_name) {\n if (in_array($rel_name, $params['ignore_hosts']) == True){\n continue;\n }\n $obj = automap_obj($MAPCFG, $params, $saved_config, $rel_name);\n\n // Add to tree\n $this_tree_lvl[$obj['object_id']] = $obj;\n\n // < 0 - there is no limit\n // > 0 - there is a limit but it is no reached yet\n if($layers_left < 0 || $layers_left > 0) {\n automap_fetch_tree($dir, $MAPCFG, $params, $saved_config, $rel_name, $layers_left - 1, $this_tree_lvl[$obj['object_id']]['.'.$dir]);\n }\n }\n }\n}", "function pushState(): void\n {\n $this->stateStack[] = [$this->valid, $this->offset, $this->index, $this->current];\n }", "public function getTreeSource();", "function printState() {\n\t\t$state = $this->getState();\n\t\techo $state;\n\n\t\n\t}" ]
[ "0.59861684", "0.59835136", "0.57236385", "0.56152904", "0.5594084", "0.5570806", "0.5570806", "0.5513232", "0.5508735", "0.5486823", "0.54719937", "0.54672635", "0.5447323", "0.54247606", "0.53693056", "0.5359117", "0.533816", "0.533816", "0.53379697", "0.52581286", "0.52428883", "0.5242522", "0.52149564", "0.5214503", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.5212655", "0.52118695", "0.51867694", "0.518049", "0.517812", "0.5153544", "0.5135063", "0.5134808", "0.51339424", "0.51318634", "0.51097256", "0.5094707", "0.50946647", "0.5088493", "0.5086987", "0.5074794", "0.5063342", "0.50568473", "0.505373", "0.5043389", "0.5024328", "0.5016376", "0.5015569", "0.49879253", "0.49831906", "0.49645066", "0.49620745", "0.49366146", "0.49304995", "0.49279454", "0.4925434", "0.49210215", "0.49068725", "0.49022737", "0.48929155", "0.48901284", "0.48752266", "0.4873063", "0.48647264", "0.48627996", "0.4861219", "0.48465294", "0.4844094", "0.48438796", "0.48337665", "0.48259214", "0.48246604", "0.48214814", "0.47990316", "0.47976935", "0.47871074", "0.47824788", "0.47793615", "0.47736728", "0.47730553", "0.47728086", "0.4770127", "0.47637114", "0.4754773", "0.47363922", "0.4733646", "0.4730909", "0.47294658" ]
0.7104994
0
Method to process breadcrumb for tree
protected function _processBreadcrumb(array &$tree, array &$result) { try { if(isset($tree['childnodes'])) { foreach($tree['childnodes'] as &$item) { if($item['state'] > 0) { $result[] =& $item; if(isset($item['childnodes'])) { $this->_processBreadcrumb($item, $result); } break; } } unset($item, $node, $status); } unset($tree, $result); } catch(\Exception $exception) { throw new \RuntimeException(\Glue\Helper\General::replace(array('method' => __METHOD__), GLUE_EXCEPTION_METHOD_FAILED), NULL, $exception); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BreadCrumb(){}", "function eo_bbpm_get_breadcrumb() {\n}", "public function trail() {\n\n\t\t$breadcrumb = '';\n\t\t$item_count = count( $this->items );\n\t\t$item_position = 0;\n\n\t\tif ( 0 < $item_count ) {\n\n\t\t\tif ( true === $this->args['show_browse'] )\n\t\t\t\t$breadcrumb .= sprintf( '<h2 class=\"trail-browse\">%s</h2>', $this->labels['browse'] );\n\n\t\t\t$breadcrumb .= '<ol class=\"breadcrumb '.$this->args['classes'].'\" itemscope itemtype=\"http://schema.org/BreadcrumbList\">';\n\n\t\t\t$breadcrumb .= sprintf( '<meta name=\"numberOfItems\" content=\"%d\" />', absint( $item_count ) );\n\t\t\t$breadcrumb .= '<meta name=\"itemListOrder\" content=\"Ascending\" />';\n\n\t\t\tforeach ( $this->items as $item ) {\n\n\t\t\t\t++$item_position;\n\n\t\t\t\tpreg_match( '/(<a.*?>)(.*?)(<\\/a>)/i', $item, $matches );\n\n\t\t\t\t$item = !empty( $matches ) ? sprintf( '%s<span itemprop=\"name\">%s</span>%s', $matches[1], $matches[2], $matches[3] ) : sprintf( '<span itemprop=\"name\">%s</span>', $item );\n\n\t\t\t\t$item_class = 'breadcrumb-item';\n\n\t\t\t\tif ( $item_count === $item_position )\n\t\t\t\t\t$item_class .= ' active';\n\n\t\t\t\t$attributes = 'itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\" class=\"' . $item_class . '\"';\n\n\t\t\t\t$meta = sprintf( '<meta itemprop=\"position\" content=\"%s\" />', absint( $item_position ) );\n\n\t\t\t\t$breadcrumb .= sprintf( '<li %s>%s%s</li>', $attributes, $item, $meta );\n\t\t\t}\n\n\t\t\t$breadcrumb .= '</ol>';\n\n\t\t\t$breadcrumb = sprintf(\n\t\t\t\t'<%1$s role=\"navigation\" aria-label=\"%2$s\" class=\"breadcrumbs\" itemprop=\"breadcrumb\">%3$s%4$s%5$s</%1$s>',\n\t\t\t\ttag_escape( $this->args['container'] ),\n\t\t\t\tesc_attr( $this->labels['aria_label'] ),\n\t\t\t\t$this->args['before'],\n\t\t\t\t$breadcrumb,\n\t\t\t\t$this->args['after']\n\t\t\t);\n\t\t}\n\n\t\tif ( false === $this->args['echo'] )\n\t\t\treturn $breadcrumb;\n\n\t\techo $breadcrumb;\n\t}", "function _update_breadcrumb_line()\n {\n $tmp = Array();\n\n $tmp[] = Array\n (\n MIDCOM_NAV_URL => \"/\",\n MIDCOM_NAV_NAME => $this->_l10n->get('index'),\n );\n\n $_MIDCOM->set_custom_context_data('midcom.helper.nav.breadcrumb', $tmp);\n }", "public function process(BreadcrumbableModelInterface $entity): Breadcrumb;", "protected function breadcrumbForIndex()\n {\n $breadcrumbTree = new ullPhoneBreadcrumbTree();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "function Breadcrumb2010 () {\n$pathinfo = $_SERVER[REQUEST_URI];\n$divider = \">\";\n$pre_path = \"/docs\";\n$more_path= \"/\";\n$pathinfo = chop ($pathinfo, \"/\");\n$path = split (\"/\", $pathinfo);\n print \"<span class=\\\"crumb\\\"><a href=\\\"/lib/\\\">Library Homepage</a></span>\";\n $count = count($path);\n $less = $count-1;\n\n \nif (preg_match(\"/^index\\./\",\"$path[$less]\",$matches)) \n {\n array_pop($path);\n // $count = $count-2;\n $count = count($path);\n } \n\n for ($i=1; $i<$count; $i++) {\n $dir = $path[$i];\n $fn = \"$pre_path$more_path$dir/breadcrumb.data\";\n if (file_exists($fn)) {\n if ($file = fopen(\"$fn\", \"r\")) {\n\t$line=fgetss($file,255);\n\tif (preg_match(\"/\\\"(.+)\\\"/\",$line,$matches)) { \n\t $line = preg_replace(\"/\\s+/\",\"&nbsp;\",$matches[1]); \n\t}\n\tprint \" $divider <span class=\\\"crumb\\\"><a href=\\\"$more_path$dir/\\\">$line</a></span>\";\n\tfclose($file);\n } // end if file opens\n } //end if file exists\n $more_path .= \"$dir/\";\n } // end for\n}", "function the_breadcrumb() {\n\t global $post;\n\t $separator = '<span class=\"breadcrumb-divider\"><svg width=\"16\" height=\"17\" viewBox=\"0 0 16 17\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M16 8.49993L13.4394 5.93933V7.99599H0V9.00394H13.4394V11.0606L16 8.49993Z\" fill=\"#121212\" /></svg></span>';\n\t echo '<nav aria-label=\"breadcrumb\"><ol class=\"breadcrumb\">';\n\t if (!is_home()) {\n\t\t\t echo '<li class=\"breadcrumb-item\"><a href=\"';\n\t\t\t echo get_option('home');\n\t\t\t echo '\">';\n\t\t\t echo __( 'Home', 'thegrapes' );\n\t\t\t echo '</a></li>' . $separator;\n\t\t\t if ( is_category() ) {\n\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">';\n\t\t\t\t\t the_category(' </li>' . $separator . '<li class=\"breadcrumb-item\"> ');\n\t\t\t } elseif ( is_single() ) {\n echo '<li class=\"breadcrumb-item\">';\n echo '<a href=\"' . get_post_type_archive_link( 'post' ) . '\">';\n echo get_the_title( get_option('page_for_posts', true) );\n echo '</a>';\n echo '</li>' . $separator . '<li class=\"breadcrumb-item active\">';\n the_title();\n echo '</li>';\n } elseif ( is_page() ) {\n\t\t\t\t\t if($post->post_parent){\n\t\t\t\t\t\t\t $anc = get_post_ancestors( $post->ID );\n\t\t\t\t\t\t\t $title = get_the_title();\n\t\t\t\t\t\t\t foreach ( $anc as $ancestor ) {\n\t\t\t\t\t\t\t\t\t $output = '<li class=\"breadcrumb-item\"><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>' . $separator;\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t echo $output;\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.$title.'</li>';\n\t\t\t\t\t } else {\n\t\t\t\t\t\t\t echo '<li class=\"breadcrumb-item active\">'.get_the_title().'</li>';\n\t\t\t\t\t }\n\t\t\t }\n\t }\n\t elseif (is_tag()) {single_tag_title();}\n\t elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n\t elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n\t elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n\t elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n\t elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n\t elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n\t echo '</ol></nav>';\n}", "function Breadcrumb ($pathinfo) {\n if (strlen($pathinfo)<1) { $pathinfo = $REQUEST_URI; } \n $divider = \">>\";\n print \"<p id=\\\"breadcrumbs\\\" style=\\\"clear: both; margin-left: 8ex; text-indent:-8ex\\\">\\n\";\n $pre_path = \"/docs\";\n $more_path= \"/\";\n $path = split (\"/\", $pathinfo);\n print \"Return to: <a href=\\\"/lib/\\\">Library Homepage</a>\";\n \n $count = count($path);\n $less = $count-1;\n \n if (preg_match(\"/^index\\./\",\"$path[$less]\",$matches)) {\n array_pop($path);\n // $count = $count-2;\n $count = count($path);\n } \n /*\n print \"<!-- COUNT ME: $count -->\";\n print \"<!--\";\n print_r($path);\n print \"-->\";\n */\n\n for ($i=1; $i<$count; $i++) {\n $dir = $path[$i];\n $fn = \"$pre_path$more_path$dir/breadcrumb.data\";\n if (file_exists($fn)) {\n if ($file = fopen(\"$fn\", \"r\")) {\n\t$line=fgetss($file,255);\n\tif (preg_match(\"/\\\"(.+)\\\"/\",$line,$matches)) { \n\t $line = preg_replace(\"/\\s+/\",\"&nbsp;\",$matches[1]); \n\t}\n\tprint \" $divider <a href=\\\"$more_path$dir/\\\">$line</a>\";\n\tfclose($file);\n } // end if file opens\n } //end if file exists\n $more_path .= \"$dir/\";\n } // end for\n}", "function breadcrumb_navigation( $page, $ref = array() ){\n\t$breadcrumb = $ref;\n\tif( !count( $breadcrumb ) ){\n\t\tarray_unshift( $breadcrumb, array( $page->post_title ) );\n\t} else {\n\t\tarray_unshift( $breadcrumb, array( $page->post_title, get_permalink( $page->ID ) ) );\n\t}\n\tif( $page->post_parent ){\n\t\tbreadcrumb_navigation( get_page( $page->post_parent ), $breadcrumb );\n\t\treturn;\n\t} else {\n\t\t/// process the breadcrumb\n\t\t$output = '<li class=\"home\"><a href=\"' . get_home_url() . '\">' . __( 'Home', '_supply_ontario' ) . '</a></li>';\n\t\tfor( $q = 0; $q < count( $breadcrumb ); ++$q ){\n\t\t\tif( count( $breadcrumb[$q] ) > 1 ){\n\t\t\t\t$output .= '<li><a href=\"' . $breadcrumb[$q][1] . '\">' . $breadcrumb[$q][0] . '</a></li>';\n\t\t\t} else {\n\t\t\t\t$output .= '<li class=\"current\">' . $breadcrumb[$q][0] . '</li>';\n\t\t\t}\n\t\t}\n\t\techo '<ul class=\"breadcrumb\">' . $output . '</ul>';\n\t}\n}", "function YOUR_THEME_easy_breadcrumb($variables) {\n\n $breadcrumb = $variables['breadcrumb'];\n $segments_quantity = $variables['segments_quantity'];\n\n $breadcrumb_items = [];\n $link_options = [\n 'attributes' => [\n 'class' => [\n 'ecl-breadcrumbs__link',\n ],\n ],\n 'html' => TRUE\n ];\n $breadcrumb_items = [];\n $menu_breadcrumb = menu_tree_page_data('menu-breadcrumb-menu');\n $i = 0;\n foreach ($menu_breadcrumb as $item) {\n $breadcrumb_item = [\n 'data' => l($item['link']['link_title'], $item['link']['link_path'], $link_options),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n if ($i == 0) {\n $breadcrumb_item['class'][] = 'ecl-breadcrumbs__segment--first';\n }\n $breadcrumb_items[] = $breadcrumb_item;\n $i++;\n }\n\n if ($segments_quantity > 0) {\n\n for ($i = 0, $s = $segments_quantity - 1; $i < $segments_quantity; ++$i) {\n $it = $breadcrumb[$i];\n $content = decode_entities($it['content']);\n if (isset($it['url'])) {\n $breadcrumb_item = [\n 'data' => l($content, $it['url'], $link_options),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n } else {\n $breadcrumb_item = [\n 'data' => filter_xss($content),\n 'class' => [\n 'ecl-breadcrumbs__segment',\n ],\n ];\n }\n if ($i == $segments_quantity) {\n $breadcrumb_item['class'][] = 'ecl-breadcrumbs__segment--last';\n }\n\n $breadcrumb_items[] = $breadcrumb_item;\n }\n }\n\n $items = [\n 'items' => $breadcrumb_items,\n 'type' => 'ol',\n 'attributes' => [\n 'class' => [\n 'ecl-breadcrumbs__segments-wrapper',\n ],\n ],\n ];\n\n return theme('item_list', $items);\n}", "protected function breadcrumbForList()\n {\n $breadcrumbTree = new ullPhoneBreadcrumbTree();\n $breadcrumbTree->addDefaultListEntry();\n $this->setVar('breadcrumb_tree', $breadcrumbTree, true);\n }", "public function getBreadcrumbs();", "function megatron_ubc_clf_breadcrumbs($variables) {\n $title = drupal_set_title();\n $output = '';\n $output .= '<ul class=\"breadcrumb expand\">';\n\n if (theme_get_setting('clf_crumbumbrellaunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbumbrellawebsite') . '\">' . theme_get_setting('clf_crumbumbrellaunit') . '</a><span class=\"divider\">/</span>';\n }\n if (theme_get_setting('clf_crumbunit')) {\n $output .= '<li><a href=\"' . theme_get_setting('clf_crumbwebsite') . '\">' . theme_get_setting('clf_crumbunit') . '</a><span class=\"divider\">/</span>';\n }\n $output .= '<li>' . $title . '</li></ul>';\n return $output;\n}", "private function buildBreadCrumb() {\n if (is_array($this->breadcrumb)) {\n foreach ($this->breadcrumb as $index => $value) {\n $breadcrumb .= ! is_null($breadcrumb) ? \"<li>&#8250;&nbsp;</li>\" : NULL;\n if (is_string($index))\n $breadcrumb .= sprintf(\"<li><a class='current_page' href='%s' title='%s' alt='%s'>%s</a></li>\", $value, $index, $index, $index);\n else\n $breadcrumb .= sprintf(\"<li>%s</li>\", $value);\n }\n }\n return $breadcrumb;\n }", "protected function prepareCrumbs(){\n $crumbs = $this->_crumbs;\n $_helper = Mage::helper('rulletka/breadcrumbs');\n if($_helper->isItProductPage() /*&& !$_helper->hasCurrentCategory()*/){\n $catPath = $_helper->getCategoryPath();\n foreach($crumbs as $_crumbName => $_crumbInfo){\n if(strstr($_crumbName, 'product')){\n unset($crumbs[$_crumbName]);\n }\n }\n $crumbs += $catPath;\n }\n $this->_crumbs = $crumbs;\n }", "function print_breadcrumb()\n{\n $breadcrumbs = get_breadcrumb();\n for ($i = 0; $i < sizeof($breadcrumbs); $i++) {\n echo '<li class=\"breadcrumb-path breadcrumb-level-' . $i . '\">';\n echo '<a href=\"' . $breadcrumbs[$i]['url'] . '\">' . $breadcrumbs[$i]['title'] . '</a>';\n echo '</li>';\n }\n}", "private function weblink_cat_breadcrumbs($weblink_cat_index) {\n\n /* Make an infinity traverse */\n function breadcrumb_arrays($index, $webid) {\n $crumb = [];\n if (isset($index[get_parent($index, $webid)])) {\n $_name = dbarray(dbquery(\"SELECT weblink_cat_id, weblink_cat_name, weblink_cat_parent FROM \".DB_WEBLINK_CATS.\" WHERE weblink_cat_id='\".$webid.\"' AND weblink_cat_status='1' AND \".groupaccess(\"weblink_cat_visibility\").(multilang_table(\"WL\") ? \" AND \".in_group('weblink_cat_language', LANGUAGE) : \"\").\"\"));\n $crumb = [\n \"link\" => INFUSIONS.\"weblinks/weblinks.php?cat_id=\".$_name['weblink_cat_id'],\n \"title\" => $_name['weblink_cat_name']\n ];\n if (isset($index[get_parent($index, $webid)])) {\n if (get_parent($index, $webid) == 0) {\n return $crumb;\n }\n $crumb_1 = breadcrumb_arrays($index, get_parent($index, $webid));\n $crumb = array_merge_recursive($crumb, $crumb_1); // convert so can comply to Fusion Tab API.\n }\n }\n\n return $crumb;\n }\n\n // then we make a infinity recursive function to loop/break it out.\n $crumb = breadcrumb_arrays($weblink_cat_index, $this->cat_id);\n $title_count = !empty($crumb['title']) && is_array($crumb['title']) ? count($crumb['title']) > 1 : 0;\n // then we sort in reverse.\n if ($title_count) {\n krsort($crumb['title']);\n krsort($crumb['link']);\n }\n if ($title_count) {\n foreach ($crumb['title'] as $wbi => $value) {\n BreadCrumbs::getInstance()->addBreadCrumb([\"link\" => $crumb['link'][$wbi], \"title\" => $value]);\n if ($wbi == count($crumb['title']) - 1) {\n add_to_title(self::$locale['global_201'].$value);\n }\n }\n } else if (isset($crumb['title'])) {\n add_to_title(self::$locale['global_201'].$crumb['title']);\n BreadCrumbs::getInstance()->addBreadCrumb([\"link\" => $crumb['link'], \"title\" => $crumb['title']]);\n }\n }", "public function _BuildBreadCrumbs()\n {\n\n // Build the arrays that will contain the category names to build the trails\n $count = 0;\n\n\t\t\t$link_params = $params = $this->searchterms; // assinging the parameters \n\t\t\tunset($link_params['subcategory'],$link_params['series']); // unsetting the subcategory parameter as it not required in link\n\t\t\t$mmy_links = $this->GetYMMLinks($link_params); // getting ymm links\n\t\t\t$mmy_links .= $this->GetOtherLinks($link_params); // getting ymm links\n\n $GLOBALS['BreadCrumbs'] = \"\";\n $breadcrumbitems = \"\";\n \n //$categories = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('RootCategories');\n if(isset($GLOBALS['ISC_SRCH_CATG_NAME'])) {\n \n $GLOBALS['BreadCrumbs'] .= \"<div class='Block Moveable Breadcrumb' id='ProductBreadcrumb'>\";\n \n $GLOBALS['CatTrailLink'] = $GLOBALS['ShopPath'];\n $GLOBALS['CatTrailName'] = GetLang('Home');\n \n $GLOBALS['BreadcrumbItems'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItem\");\n \n $catg_id_selected = $GLOBALS['ISC_SRCH_CATG_ID'];\n $catg_selected = $GLOBALS['ISC_SRCH_CATG_NAME'];\n \n if ($GLOBALS['EnableSEOUrls'] == 1)\n\t\t\t\t\t$GLOBALS['CatTrailLink'] = $GLOBALS['ShopPath'].$mmy_links;\n\t\t\t\telse\n\t\t\t\t\t$GLOBALS['CatTrailLink'] = $GLOBALS['ShopPath'].\"/search.php?search_query=\".$mmy_links;\n\n $GLOBALS['CatTrailName'] = $GLOBALS['ISC_SRCH_CATG_NAME'];\n \n if(isset($params['subcategory']) && !empty($params['subcategory'])) {\n \n $breadcrumbitems .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItem\");\n $GLOBALS['CatTrailName'] = $params['subcategory'];\n /**$query = sprintf(\"SELECT categoryid, catparentid, catname FROM [|PREFIX|]categories WHERE categoryid IN (%s)\", $_REQUEST['sub_category']);\n $result = $GLOBALS['ISC_CLASS_DB']->Query($query);\n while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {\n $GLOBALS['CatTrailName'] = $row['catname'];\n }**/\n \n $GLOBALS['BreadcrumbItems'] .= $breadcrumbitems.$GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItemCurrent\");\n $GLOBALS['BreadCrumbs'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductBreadCrumb\"); \n \n } else {\n \n $GLOBALS['BreadcrumbItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"BreadcrumbItemCurrent\"); \n $GLOBALS['BreadCrumbs'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet(\"ProductBreadCrumb\"); \n \n }\n \n $GLOBALS['BreadCrumbs'] .= \"</div>\";\n \n }\n\n\n }", "function thim_learnpress_breadcrumb() {\n\t\tif ( is_front_page() || is_404() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Get the query & post information\n\t\tglobal $post;\n\n\t\t// Build the breadcrums\n\t\techo '<ul itemprop=\"breadcrumb\" itemscope itemtype=\"http://schema.org/BreadcrumbList\" id=\"breadcrumbs\" class=\"breadcrumbs\">';\n\n\t\t// Home page\n\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_html( get_home_url() ) . '\" title=\"' . esc_attr__( 'Home', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'Home', 'eduma' ) . '</span></a></li>';\n\n\t\tif ( is_single() ) {\n\n\t\t\t$categories = get_the_terms( $post, 'course_category' );\n\n\t\t\tif ( get_post_type() == 'lp_course' ) {\n\t\t\t\t// All courses\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\t\t\t} else {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_permalink( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\" title=\"' . esc_attr( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '\"><span itemprop=\"name\">' . esc_html( get_the_title( get_post_meta( $post->ID, '_lp_course', true ) ) ) . '</span></a></li>';\n\t\t\t}\n\n\t\t\t// Single post (Only display the first category)\n\t\t\tif ( isset( $categories[0] ) ) {\n\t\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_term_link( $categories[0] ) ) . '\" title=\"' . esc_attr( $categories[0]->name ) . '\"><span itemprop=\"name\">' . esc_html( $categories[0]->name ) . '</span></a></li>';\n\t\t\t}\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( get_the_title() ) . '\">' . esc_html( get_the_title() ) . '</span></li>';\n\n\t\t} else if ( is_tax( 'course_category' ) || is_tax( 'course_tag' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Category page\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr( single_term_title( '', false ) ) . '\">' . esc_html( single_term_title( '', false ) ) . '</span></li>';\n\t\t} else if ( !empty( $_REQUEST['s'] ) && !empty( $_REQUEST['ref'] ) && ( $_REQUEST['ref'] == 'course' ) ) {\n\t\t\t// All courses\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><a itemprop=\"item\" href=\"' . esc_url( get_post_type_archive_link( 'lp_course' ) ) . '\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\"><span itemprop=\"name\">' . esc_html__( 'All courses', 'eduma' ) . '</span></a></li>';\n\n\t\t\t// Search result\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'Search results for:', 'eduma' ) . ' ' . esc_attr( get_search_query() ) . '\">' . esc_html__( 'Search results for:', 'eduma' ) . ' ' . esc_html( get_search_query() ) . '</span></li>';\n\t\t} else {\n\t\t\techo '<li itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\"><span itemprop=\"name\" title=\"' . esc_attr__( 'All courses', 'eduma' ) . '\">' . esc_html__( 'All courses', 'eduma' ) . '</span></li>';\n\t\t}\n\n\t\techo '</ul>';\n\t}", "function CreateBreadcrumb($categoryid, $tagtype='<a>') // or '<li>'\n{\n global $DB, $userinfo, $mainsettings, $pages_md_arr, $pages_parents_md_arr;\n\n if(!isset($pages_parents_md_arr)) return;\n $categories = array();\n $cat_id = $categoryid;\n while(!empty($cat_id))\n {\n if(isset($pages_md_arr[$cat_id]))\n {\n $cat = $pages_md_arr[$cat_id];\n array_unshift($categories, $cat);\n $cat_id = $cat['parentid'];\n }\n else\n {\n break;\n }\n }\n\n if(empty($categories))\n {\n return '';\n }\n\n $Breadcrumb = '';\n $count = count($categories);\n $idx = 1;\n // $categories is array with pages for a specific parent page\n foreach($categories as $category_arr)\n {\n // $category_arr contains actual page row (either cached or from DB)\n $category_name = strlen($category_arr['title'])?$category_arr['title']:$category_arr['name'];\n $category_link = strlen($category_arr['link']) ? $category_arr['link'] : RewriteLink('index.php?categoryid=' . $category_arr['categoryid']);\n $category_target = strlen($category_arr['target']) ? ' target=\"' . $category_arr['target'] . '\"' : '';\n switch($idx)\n {\n case 1 : $class ='class=\"first\" '; break;\n case $count: $class ='class=\"last\" '; break;\n default : $class = '';\n }\n //SD370: allow list items output\n //if($tagtype == '<li>') $Breadcrumb .= '<li>';\n if($category_arr['categoryid'] == $categoryid){\n $Breadcrumb .= '<li>'.$category_name.'</li>';\n }\n else{\n $Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n }\n //$Breadcrumb .= '<li><a '.$class.'href=\"'.$category_link.'\" '.$category_target.'>'.$category_name.'</a></li>';\n //if($tagtype == '<li>') $Breadcrumb .= '</li>';\n $idx++;\n }\n $Breadcrumb .= '<div style=\"clear:both;\"></div>'.\"\\n\";\n\n return $Breadcrumb;\n\n}", "function mpcth_display_breadcrumb() {\r\n\tglobal $post;\r\n\t$id = $post->ID;\r\n\t$return = '<a href=\"/\">' . __('Home', 'mpcth') . '</a>';\r\n\r\n\tif(is_front_page()) {\r\n\t\t// do nothing\r\n\t} elseif(is_page()) {\r\n\t\t$page = get_post($id);\r\n\r\n\t\t$parent_pages = array();\r\n\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> ' . $page->post_title . \"\\n\";\r\n\r\n\t\twhile ($page->post_parent) {\r\n\t\t\t$page = get_post($page->post_parent);\r\n\t\t\t$parent_pages[] = ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_permalink($page->ID) . '\">' . $page->post_title . '</a>';\r\n\t\t}\r\n\r\n\t\t$parent_pages = array_reverse($parent_pages);\r\n\r\n\t\tforeach ($parent_pages as $parent) {\r\n\t\t\t$return .= $parent;\r\n\t\t}\r\n\t} elseif(is_single()) {\r\n\t\tif($post->post_type == 'post') {\r\n\t\t\t$category = get_the_category($id);\r\n\r\n\t\t\tif(!empty($category)){\r\n\t\t\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data, 0, -strlen(' <span class=\"mpcth-header-devider\">/</span> '));\r\n\t\t\t}\r\n\t\t} elseif($post->post_type == 'portfolio') {\r\n\t\t\t$terms = get_the_terms($id, 'mpcth_portfolio_category');\r\n\t\t\t\r\n\t\t\tif(!empty($terms)){\r\n\t\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ';\r\n\r\n\t\t\t\tforeach ($terms as $term) {\r\n\t\t\t\t\t$return .= ' <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($term !== end($terms))\r\n\t\t\t\t\t\t$return .= ', ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . $post->post_title . \"\\n\";\r\n\t} elseif(is_category()) {\r\n\t\t$category = get_the_category($id);\r\n\t\t$data = get_category_parents($category[0]->cat_ID, true, ' <span class=\"mpcth-header-devider\">/</span> ');\r\n\r\n\t\tif(!empty($category)){\r\n\t\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> ' . substr($data,0,-8);\r\n\t\t}\r\n\t} elseif(is_tax()) {\r\n\t\t$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));\r\n\t\t$return .= ' <span class=\"mpcth-header-devider\">/</span> <a href=\"' . get_term_link($term) . '\">' . $term->name . '</a>';\r\n\t}\r\n\r\n\treturn $return;\r\n}", "function create_crumbs() {\n\t\n\t\t$breadcrumb = '';\n\t\t$args = $this->args;\n\n\t\t// Get the items based on page context \n\t\t$trail = $this->get_trail();\n\n\t\t// If items are found, build the trail \n\t\tif ( !empty( $trail ) && is_array( $trail ) ) {\n\n\t\t\t// Wrap the trail and add the 'Before' element\n\t\t\t$breadcrumb = '<'.$args['container']. ' class=\"breadcrumb-trail breadcrumbs\">';\n\t\t\t$breadcrumb .= ( !empty( $args['before'] ) ? '<span class=\"trail-before\">' . $args['before'] . '</span> ' : '' );\n\t\t\t\n\t\t\t// Adds the 'trail-end' class around last item \n\t\t\tarray_push( $trail, '<span class=\"trail-end\">' . array_pop( $trail ) . '</span>' );\n\t\t\t\n\t\t\t// Format the separator \n\t\t\t$separator = ( !empty( $args['separator'] ) ? $args['separator'] : '' );\n\n\t\t\t// Join the individual trail items into a single string \n\t\t\t$breadcrumb .= join( \" {$separator} \", $trail );\n\n\t\t\t// Close the breadcrumb trail containers \n\t\t\t$breadcrumb .= '</' . $args['container'] . '>';\n\t\t}\n\n\t\t// Return the formatted breadcrumbs\n\t\treturn $breadcrumb;\n\t}", "function rella_breadcrumb( $args = array() ) {\n\n\t$breadcrumb = new Rella_Breadcrumb( $args );\n\n\treturn $breadcrumb->trail();\n}", "function YOURTHEME_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n $crumbs = '<ul class=\"breadcrumbs\">';\n\n foreach($breadcrumb as $value) {\n $crumbs .= '<li class=\"changes\">'.$value.'</li>';\n }\n $crumbs .= '</ul>';\n }\n return $crumbs;\n }", "function wiki_breadcrumbs($chain, $current_title = null, $final_link = false, $links = true, $this_link_virtual_root = false)\n{\n $segments = array();\n $token = strtok($chain, '/');\n $rebuild_chain = '';\n while ($token !== false) {\n $next_token = strtok('/');\n\n if ($rebuild_chain != '') {\n $rebuild_chain .= '/';\n }\n $rebuild_chain .= $token;\n\n $link_id = ($this_link_virtual_root && ($next_token === false)) ? $token : $rebuild_chain;\n\n if (is_numeric($token)) {\n $id = intval($token);\n } else {\n $url_moniker_where = array('m_resource_page' => 'wiki', 'm_moniker' => $token);\n $_id = $GLOBALS['SITE_DB']->query_select_value_if_there('url_id_monikers', 'm_resource_id', $url_moniker_where);\n if ($_id === null) {\n return array();\n }\n $id = intval($_id);\n }\n\n $page_link = build_page_link(array('page' => 'wiki', 'type' => 'browse', 'id' => $link_id) + (($this_link_virtual_root && ($next_token === false)) ? array('keep_wiki_root' => $id) : array()), get_module_zone('wiki'));\n\n if ($next_token !== false) { // If not the last token (i.e. not the current page)\n $title = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $id));\n if (is_null($title)) {\n continue;\n }\n $token_title = get_translated_text($title);\n $segments[] = $links ? array($page_link, $token_title) : array('', $token_title);\n } else {\n if (is_null($current_title)) {\n $_current_title = $GLOBALS['SITE_DB']->query_select_value_if_there('wiki_pages', 'title', array('id' => $id));\n $current_title = is_null($_current_title) ? do_lang('MISSING_RESOURCE', 'wiki_page') : get_translated_text($_current_title);\n }\n if ($final_link) {\n $segments[] = array($page_link, $current_title);\n } else {\n $segments[] = array('', $current_title);\n }\n }\n\n $token = $next_token;\n }\n\n return $segments;\n}", "function x_breadcrumbs() {\n\n\tif ( x_get_option( 'x_breadcrumb_display', '1' ) ) {\n\n\t GLOBAL $post;\n\n\t $is_ltr = ! is_rtl();\n\t $stack = x_get_stack();\n\t $delimiter = x_get_breadcrumb_delimiter();\n\t $home_text = x_get_breadcrumb_home_text();\n\t $home_link = home_url();\n\t $current_before = x_get_breadcrumb_current_before();\n\t $current_after = x_get_breadcrumb_current_after();\n\t $page_title = get_the_title();\n\t $blog_title = get_the_title( get_option( 'page_for_posts', true ) );\n\n\t if ( ! is_404() ) {\n\t\t$post_parent = $post->post_parent;\n\t } else {\n\t\t$post_parent = '';\n\t }\n\n\t if ( X_WOOCOMMERCE_IS_ACTIVE ) {\n\t\t//$shop_url = x_get_shop_link();\n\t\t$shop_url = home_url() . 'products';\n\t\t$shop_title = x_get_option( 'x_' . $stack . '_shop_title', __( 'The Shop', '__x__' ) );\n\t\t$shop_link = '<a href=\"'. $shop_url .'\">' . $shop_title . '</a>';\n\t }\n\n\t echo '<div class=\"x-breadcrumbs\"><a href=\"' . $home_link . '\">' . $home_text . '</a>' . $delimiter;\n\n\t\tif ( is_home() ) {\n\n\t\t echo $current_before . $blog_title . $current_after;\n\n\t\t} elseif ( is_category() ) {\n\n\t\t $the_cat = get_category( get_query_var( 'cat' ), false );\n\t\t if ( $the_cat->parent != 0 ) echo get_category_parents( $the_cat->parent, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\n\t\t} elseif ( x_is_product_category() ) {\n\t\t\n\t\t $the_cat = get_queried_object();\n\t\t if ( $the_cat->parent != 0 ) echo x_get_taxonomy_parents( $the_cat->parent, $the_cat->taxonomy, TRUE, $delimiter );\n\t\t echo $current_before . single_cat_title( '', false ) . $current_after;\n\t\t\n\t\t /*\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_cat_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_cat_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t */\n\t\t\n\t\t} elseif ( x_is_product_tag() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . single_tag_title( '', false ) . $current_after;\n\t\t } else {\n\t\t\techo $current_before . single_tag_title( '', false ) . $current_after . $delimiter . $shop_link;\n\t\t }\n\n\t\t} elseif ( is_search() ) {\n\n\t\t echo $current_before . __( 'Search Results for ', '__x__' ) . '&#8220;' . get_search_query() . '&#8221;' . $current_after;\n\n\t\t} elseif ( is_singular( 'post' ) ) {\n\n\t\t if ( get_option( 'page_for_posts' ) == is_front_page() ) {\n\t\t\techo $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\tif ( $is_ltr ) {\n\t\t\t echo '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t\t} else {\n\t\t\t echo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . get_permalink( get_option( 'page_for_posts' ) ) . '\">' . $blog_title . '</a>';\n\t\t\t}\n\t\t }\n\n\t\t} elseif ( x_is_portfolio() ) {\n\n\t\t echo $current_before . get_the_title() . $current_after;\n\n\t\t} elseif ( x_is_portfolio_item() ) {\n\n\t\t $link = x_get_parent_portfolio_link();\n\t\t $title = x_get_parent_portfolio_title();\n\n\t\t if ( $is_ltr ) {\n\t\t\techo '<a href=\"' . $link . '\">' . $title . '</a>' . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . '<a href=\"' . $link . '\">' . $title . '</a>';\n\t\t }\n\n\t\t} elseif ( x_is_product() ) {\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $shop_link . $delimiter . $current_before . $page_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter . $shop_link;\n\t\t }\n\t\t \n\t\t} elseif ( x_is_buddypress() ) {\n\n\t\t if ( bp_is_group() ) {\n\t\t\techo '<a href=\"' . bp_get_groups_directory_permalink() . '\">' . x_get_option( 'x_buddypress_groups_title', __( 'Groups', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } elseif ( bp_is_user() ) {\n\t\t\techo '<a href=\"' . bp_get_members_directory_permalink() . '\">' . x_get_option( 'x_buddypress_members_title', __( 'Members', '__x__' ) ) . '</a>' . $delimiter . $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t } else {\n\t\t\techo $current_before . x_buddypress_get_the_title() . $current_after;\n\t\t }\n\n\t\t} elseif ( x_is_bbpress() ) {\n\n\t\t remove_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t if ( bbp_is_forum_archive() ) {\n\t\t\techo $current_before . bbp_get_forum_archive_title() . $current_after;\n\t\t } else {\n\t\t\techo bbp_get_breadcrumb();\n\t\t }\n\n\t\t add_filter( 'bbp_no_breadcrumb', '__return_true' );\n\n\t\t} elseif ( is_page() && ! $post_parent ) {\n\n\t\t echo $current_before . $page_title . $current_after;\n\n\t\t} elseif ( is_page() && $post_parent ) {\n\n\t\t $parent_id = $post_parent;\n\t\t $breadcrumbs = array();\n\n\t\t if ( is_rtl() ) {\n\t\t\techo $current_before . $page_title . $current_after . $delimiter;\n\t\t }\n\n\t\t while ( $parent_id ) {\n\t\t\t$page = get_page( $parent_id );\n\t\t\t$breadcrumbs[] = '<a href=\"' . get_permalink( $page->ID ) . '\">' . get_the_title( $page->ID ) . '</a>';\n\t\t\t$parent_id = $page->post_parent;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\t$breadcrumbs = array_reverse( $breadcrumbs );\n\t\t }\n\n\t\t for ( $i = 0; $i < count( $breadcrumbs ); $i++ ) {\n\t\t\techo $breadcrumbs[$i];\n\t\t\tif ( $i != count( $breadcrumbs ) -1 ) echo $delimiter;\n\t\t }\n\n\t\t if ( $is_ltr ) {\n\t\t\techo $delimiter . $current_before . $page_title . $current_after;\n\t\t }\n\n\t\t} elseif ( is_tag() ) {\n\n\t\t echo $current_before . single_tag_title( '', false ) . $current_after;\n\n\t\t} elseif ( is_author() ) {\n\n\t\t GLOBAL $author;\n\t\t $userdata = get_userdata( $author );\n\t\t echo $current_before . __( 'Posts by ', '__x__' ) . '&#8220;' . $userdata->display_name . $current_after . '&#8221;';\n\n\t\t} elseif ( is_404() ) {\n\n\t\t echo $current_before . __( '404 (Page Not Found)', '__x__' ) . $current_after;\n\n\t\t} elseif ( is_archive() ) {\n\n\t\t if ( x_is_shop() ) {\n\t\t\techo $current_before . $shop_title . $current_after;\n\t\t } else {\n\t\t\techo $current_before . __( 'Archives ', '__x__' ) . $current_after;\n\t\t }\n\n\t\t}\n\n\t echo '</div>';\n\n\t}\n}", "function _get_breadcrumbs($starting_page, $container = array())\n{\n\n //make sure you're working with an object\n $sp = (!is_object($starting_page)) ? get_post($starting_page) : $starting_page;\n\n //make sure to insert starting page only once\n if (!in_array(get_permalink($sp->ID), $container)) {\n $container[get_permalink($sp->ID)] = get_the_title($sp->ID);\n }\n\n //if parent, recursion!\n if ($sp->post_parent > 0) {\n $container[get_permalink($sp->post_parent)] = get_the_title($sp->post_parent);\n $container = _get_breadcrumbs($sp->post_parent, $container);\n }\n\n return $container;\n}", "function breadcrumb()\r\n\t{\r\n\t\t$breadcrumbs = array();\r\n\t\tpr($this->Link);\r\n\t\t//$cLink = ClassRegistry::init('JavanLink');pr($cLink);\r\n\t\t//$conditions = array(\"controller\"=>$this->info['controller'], \"action\"=>$this->info['action']);\r\n\t\t//$link = $cLink->find(\"first\", array(\"conditions\"=>$conditions, \"recursive\"=>-1));\r\n\t\t//if(!$link){\r\n\t\t//\t//trigger_error(__('Alamat yang Anda akses tidak terdaftar.', true), E_USER_WARNING);\r\n\t\t//\treturn false ;\r\n\t\t//}else{\r\n\t\t//\t$breadcrumbs = $cLink->getpath($link['Link']['id']);\r\n\t\t//}\r\n\t\treturn $breadcrumbs;\r\n\t}", "function breadcrumbs(): void\n{\n\tif (function_exists('yoast_breadcrumb')) {\n\t\tyoast_breadcrumb(\n\t\t\t'<nav aria-label=\"You are here:\" role=\"navigation\" xmlns:v=\"http://rdf.data-vocabulary.org/#\">\n\t\t\t\t<ul class=\"breadcrumbs\">',\n\t\t\t'</ul></nav>'\n\t\t);\n\t}\n}", "public function testBreadcrumb() {\n\t\t$this->assertNull($this->Html->getCrumbs());\n\n\t\t$this->Html->addCrumb('First', '#first');\n\t\t$this->Html->addCrumb('Second', '#second');\n\t\t$this->Html->addCrumb('Third', '#third');\n\n\t\t$result = $this->Html->getCrumbs();\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->getCrumbs(' &gt; ');\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t' &gt; ',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t' &gt; ',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$this->Html->addCrumb('Fourth', null);\n\n\t\t$result = $this->Html->getCrumbs();\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t\t'&raquo;',\n\t\t\t'Fourth'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\n\t\t$result = $this->Html->getCrumbs('-', 'Start');\n\t\t$expected = array(\n\t\t\tarray('a' => array('href' => '/')),\n\t\t\t'Start',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#first')),\n\t\t\t'First',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#second')),\n\t\t\t'Second',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\tarray('a' => array('href' => '#third')),\n\t\t\t'Third',\n\t\t\t'/a',\n\t\t\t'-',\n\t\t\t'Fourth'\n\t\t);\n\t\t$this->assertTags($result, $expected);\n\t}", "function hudson_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n $output = '';\n\n // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('zen_breadcrumb');\n if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('zen_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $zen_breadcrumb_separator = theme_get_setting('zen_breadcrumb_separator');\n $breadcrumb_separator = '<span class=\"separator\">&nbsp;' . $zen_breadcrumb_separator . '&nbsp;</span>';\n $trailing_separator = $title = '';\n if (theme_get_setting('zen_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $breadcrumb[] = check_plain($item['title']);\n }\n else {\n $breadcrumb[] = drupal_get_title();\n }\n }\n elseif (theme_get_setting('zen_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users.\n if (empty($variables['title'])) {\n $variables['title'] = t('You are here');\n }\n // Unless overridden by a preprocess function, make the heading invisible.\n if (!isset($variables['title_attributes_array']['class'])) {\n $variables['title_attributes_array']['class'][] = 'element-invisible';\n }\n\n // Build the breadcrumb trail.\n $output = '<nav class=\"breadcrumb\" role=\"navigation\">';\n $output .= '<h2' . drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . '</h2>';\n $output .= '<ol><li>' . implode($breadcrumb_separator . '</li><li>', $breadcrumb) . $trailing_separator . '</li></ol>';\n $output .= '</nav>';\n }\n }\n\n return $output;\n}", "function ou_df_easy_breadcrumb($variables) {\n\n $breadcrumb = $variables['breadcrumb'];\n $segments_quantity = $variables['segments_quantity'];\n $separator = $variables['separator'];\n\n $html = '';\n\n if ($segments_quantity > 0) {\n\n $html .= '<dl class=\"breadcrumb\"><dt>You are here:</dt><dd>';\n\n for ($i = 0, $s = $segments_quantity - 1; $i < $segments_quantity; ++$i) {\n $it = $breadcrumb[$i];\n $content = decode_entities($it['content']);\n if (isset($it['url'])) {\n $html .= l($content, $it['url'], array('attributes' => array('class' => $it['class'])));\n } else {\n $class = implode(' ', $it['class']);\n $html .= '<span class=\"' . $class . '\">'\t. $content . '</span>';\n }\n if ($i < $s) {\n $html .= '<span class=\"easy-breadcrumb_segment-separator\"> ' . $separator . ' </span>';\n }\n }\n\n $html .= '</dd></dl>';\n }\n\n return $html;\n}", "function gwt_drupal_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n $output = '';\n\n // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('gwt_drupal_breadcrumb');\n if ($show_breadcrumb == 'yes' || $show_breadcrumb == 'admin' && arg(0) == 'admin') {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('gwt_drupal_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $breadcrumb_separator = filter_xss_admin(theme_get_setting('gwt_drupal_breadcrumb_separator'));\n $trailing_separator = $title = '';\n if (theme_get_setting('gwt_drupal_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $breadcrumb[] = check_plain($item['title']);\n }\n else {\n $breadcrumb[] = drupal_get_title();\n }\n }\n elseif (theme_get_setting('gwt_drupal_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users.\n if (empty($variables['title'])) {\n $variables['title'] = t('You are here');\n }\n $variables['title_attributes_array']['class'][] = 'breadcrumbs-here-label';\n\n // Build the breadcrumb trail.\n $output = '<nav role=\"navigation\">';\n $output .= '<ol class=\"breadcrumbs\">'.\n '<li'.drupal_attributes($variables['title_attributes_array']) . '>' . $variables['title'] . ':</li>'.\n '<li>' . implode('</li>'.\n '<li>', $breadcrumb) . '</li>'.\n '</ol>';\n $output .= '</nav>';\n }\n }\n\n return $output;\n}", "function the_breadcrumb() {\n global $post;\n echo '<ol class=\"breadcrumb\">';\n if (!is_home()) {\n echo '<li><a href=\"';\n echo get_option('home');\n echo '\">';\n echo 'Home';\n echo '</a></li>';\n if (is_category() || is_single()) {\n echo '<li>';\n the_category('</li><li> ');\n if (is_single()) {\n echo '</li><li>';\n the_title();\n echo '</li>';\n }\n } elseif (is_page()) {\n if($post->post_parent){\n $anc = get_post_ancestors( $post->ID );\n $title = get_the_title();\n foreach ( $anc as $ancestor ) {\n $output = '<li><a href=\"'.get_permalink($ancestor).'\" title=\"'.get_the_title($ancestor).'\">'.get_the_title($ancestor).'</a></li>';\n }\n echo $output;\n echo '<strong title=\"'.$title.'\"> '.$title.'</strong>';\n } else {\n echo '<li><strong>'.get_the_title().'</strong></li>';\n }\n }\n }\n elseif (is_tag()) {single_tag_title();}\n elseif (is_day()) {echo\"<li>Archive for \"; the_time('F jS, Y'); echo'</li>';}\n elseif (is_month()) {echo\"<li>Archive for \"; the_time('F, Y'); echo'</li>';}\n elseif (is_year()) {echo\"<li>Archive for \"; the_time('Y'); echo'</li>';}\n elseif (is_author()) {echo\"<li>Author Archive\"; echo'</li>';}\n elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {echo \"<li>Blog Archives\"; echo'</li>';}\n elseif (is_search()) {echo\"<li>Search Results\"; echo'</li>';}\n echo '</ol>';\n}", "function okcdesign_breadcrumb($variables) {\n $html = theme_plugins_invoke(__FUNCTION__, $variables);\n if ($html) return $html;\n return theme_breadcrumb($variables);\n}", "protected function getBreadcrumbsPart()\n {\n ?>\n <?php\n //breadCrums\n $bc = $this->getBreadcrumbs();\n ?>\n\n <ol class=\"breadcrumb\" style=\"\">\n <?php\n\n foreach ($bc as $item):\n ?>\n <li><a href=\"<?= $item['url'] ?>\"><?= $item['name'] ?></a></li>\n <?php\n endforeach;\n ?>\n </ol>\n\n <?php\n }", "private function _buildBreadcrumbsHtml()\n {\n // Get active elements\n $nodes = $this->_getActiveElements();\n\n // Do we have custom nodes?\n $customNodes = $this->_getParam('customNodes', false);\n if ($customNodes && is_array($customNodes) && count($customNodes)) {\n $nodes = array_merge($nodes, $customNodes);\n }\n\n // Create breadcrumbs\n $length = count($nodes);\n $breadcrumbs = \"\\n\" . sprintf('<%1$s%2$s%3$s xmlns:v=\"http://rdf.data-vocabulary.org/#\">',\n $this->_getParam('wrapper', 'ol'),\n $this->_getParam('id', false) ? ' id=\"' . $this->_getParam('id', '') . '\"' : '',\n $this->_getParam('class', false) ? ' class=\"' . $this->_getParam('class', '') . '\"' : ''\n );\n\n // Before text\n if ($this->_getParam('beforeText', false)) {\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s><span>%2$s</span></li>',\n $this->_getParam('classDefault', false) ? ' class=\"' . $this->_getParam('classDefault', '') . '\"' : '',\n $this->_getParam('beforeText', '')\n );\n }\n\n foreach ($nodes as $index => $node) {\n $nodeTitle = is_array($node) ? (isset($node['title']) ? $node['title'] : Craft::t('Unknown')) : $node->__toString();\n $nodeUrl = is_array($node) ? (isset($node['url']) ? $node['url'] : '') : $node->url;\n\n // Gather node classes\n $childClasses = array();\n if ($this->_getParam('classDefault', false)) {\n $childClasses[] = $this->_getParam('classDefault', '');\n }\n\n // First\n if ($index == 0) {\n $childClasses[] = $this->_getParam('classFirst', 'first');\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s typeof=\"v:Breadcrumb\"><a href=\"%2$s\" title=\"%3$s\" rel=\"v:url\" property=\"v:title\">%3$s</a></li>',\n $childClasses ? ' class=\"' . implode(' ', $childClasses) . '\"' : '',\n $nodeUrl,\n $this->_getParam('renameHome', $nodeTitle)\n );\n }\n // Last\n elseif ($index == $length - 1)\n {\n $childClasses[] = $this->_getParam('classLast', 'last');\n $breadcrumb = sprintf('<span property=\"v:title\">%1$s</span>',\n $nodeTitle\n );\n if ($this->_getParam('lastIsLink', false)) {\n $breadcrumb = sprintf('<a href=\"%1$s\" title=\"%2$s\" rel=\"v:url\" property=\"v:title\">%2$s</a>',\n $nodeUrl,\n $nodeTitle\n );\n }\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s typeof=\"v:Breadcrumb\">%2$s</li>',\n $childClasses ? ' class=\"' . implode(' ', $childClasses) . '\"' : '',\n $breadcrumb\n );\n }\n else {\n $breadcrumbs .= sprintf(\"\\n\" . '<li%1$s typeof=\"v:Breadcrumb\"><a href=\"%2$s\" title=\"%3$s\" rel=\"v:url\" property=\"v:title\">%3$s</a></li>',\n $childClasses ? ' class=\"' . implode(' ', $childClasses) . '\"' : '',\n $nodeUrl,\n $nodeTitle\n );\n }\n }\n $breadcrumbs .= \"\\n\" . sprintf('</%1$s>',\n $this->_getParam('wrapper', 'ol')\n );\n return TemplateHelper::getRaw($breadcrumbs);\n }", "protected function _generateBreadcrumb()\r\n {\r\n $links = null;\r\n $texthomelink = $this->view->translate('id_menu_home');\r\n // id_title_overseas = 'Overseas Representatives'\r\n $title = $this->view->translate('id_title_overseas');\r\n $links = array(\r\n $texthomelink => $this->view->baseUrl('/'),\r\n $title => '',\r\n );\r\n $this->view->pageTitle = $title;\r\n\r\n Zend_Registry::set('breadcrumb', $links);\r\n }", "function bbpress_crumbs() {\n\t\t\n\t\t// Setup the trail\n\t\t$bbp_trail = array();\n\t\t\n\t\t// If it is the forum root, just display \"Forums\"\n\t\tif ( bbp_is_forum_archive() ) {\n\t\t\t$bbp_trail[] = 'Forums';\n\t\t\treturn $bbp_trail;\n\t\t}\n\t\t\t\t\t\n\t\t// Otherwise link to the root forums\n\t\t$bbp_trail[] = '<a href=\"' . get_post_type_archive_link( 'forum' ) . '\">Forums</a>';\n\t\t\n\t\t// Recent topics page \n\t\tif ( bbp_is_topic_archive() ) :\n\t\t\t$bbp_trail[] = 'Recent Topics';\n\t\t\n\t\t// Topic tag archives \n\t\telseif ( bbp_is_topic_tag() ) :\n\t\t\t$bbp_trail[] = bbp_get_topic_tag_name();\n\t\t\n\t\t// Editing a topic tag\n\t\telseif ( bbp_is_topic_tag_edit() ) :\n\t\t\t$bbp_trail[] = '<a href=\"' . bbp_get_topic_tag_link() . '\">' . bbp_get_topic_tag_name() . '</a>';\n\t\t\t$bbp_trail[] = 'Edit';\n\t\t\n\t\t// Single topic \n\t\telseif ( bbp_is_single_topic() ) :\t\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_topic_forum_id( $topic_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_topic_title( $topic_id );\n\t\t\t\t\n\t\t// If it's a split, merge, or edit, link back to the topic \n\t\telseif ( bbp_is_topic_split() || bbp_is_topic_merge() || bbp_is_topic_edit() ) :\n\t\t\t$topic_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $topic_id ) );\n\t\t\n\t\t\tif ( bbp_is_topic_split() ) \t\t: $bbp_trail[] = 'Split Topic';\n\t\t\telseif ( bbp_is_topic_merge() ) \t: $bbp_trail[] = 'Merge Topic';\n\t\t\telseif ( bbp_is_topic_edit() ) \t\t: $bbp_trail[] = 'Edit Topic';\n\t\t\tendif;\n\t\t\t\n\t\t// Single reply \n\t\telseif ( bbp_is_single_reply() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = bbp_get_reply_title( $reply_id );\n\t\t\n\t\t// Single reply edit \n\t\telseif ( bbp_is_reply_edit() ) :\n\t\t\t$reply_id = get_queried_object_id();\n\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( bbp_get_reply_topic_id( $reply_id ) ) );\n\t\t\t$bbp_trail[] = 'Edit Reply';\n\t\t\t\n\t\t// Single forum \n\t\telseif ( bbp_is_single_forum() ) :\n\t\t\n\t\t\t// Get the queried forum ID and its parent forum ID. \n\t\t\t$forum_id \t\t\t= get_queried_object_id();\n\t\t\t$forum_parent_id \t= bbp_get_forum_parent_id( $forum_id );\n\t\t\t\n\t\t\t// Get the forum parents\n\t\t\tif ( 0 != $forum_parent_id) \n\t\t\t\t$bbp_trail = array_merge( $bbp_trail, $this->trail_parents( $forum_parent_id ) );\n\t\t\t\t\n\t\t\t// Give the forum title\n\t\t\t$bbp_trail[] = bbp_get_forum_title( $forum_id );\n\t\t\n\t\tendif;\n\t\t\n\t\t// Return the bbPress trail \n\t\treturn $bbp_trail;\n\t}", "function atwork_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb']; // Determine if we are to display the breadcrumb.\n $show_breadcrumb = theme_get_setting('atwork_breadcrumb');\n if ($show_breadcrumb == 'yes' || ($show_breadcrumb == 'admin' && arg(0) == 'admin')) {\n\n // Optionally get rid of the homepage link.\n $show_breadcrumb_home = theme_get_setting('atwork_breadcrumb_home');\n if (!$show_breadcrumb_home) {\n array_shift($breadcrumb);\n }\n\n // Return the breadcrumb with separators.\n if (!empty($breadcrumb)) {\n $breadcrumb_separator = theme_get_setting('atwork_breadcrumb_separator');\n $trailing_separator = $title = '';\n if (theme_get_setting('atwork_breadcrumb_title')) {\n $item = menu_get_item();\n if (!empty($item['tab_parent'])) {\n // If we are on a non-default tab, use the tab's title.\n $title = check_plain($item['title']);\n }\n else {\n $title = drupal_get_title();\n }\n if ($title) {\n $trailing_separator = $breadcrumb_separator;\n }\n }\n elseif (theme_get_setting('atwork_breadcrumb_trailing')) {\n $trailing_separator = $breadcrumb_separator;\n }\n\n return '<h2 class=\"breadcrumb\">' . implode($breadcrumb_separator, $breadcrumb) . $trailing_separator . $title . '</h2>';\n }\n }\n // Otherwise, return an empty string.\n return '';\n}", "private function addBreadcrumb(DataContainer $dc): void\n {\n /** @var AttributeBagInterface $session */\n $session = $this->requestStack->getSession()->getBag('contao_backend');\n\n // Set a new node\n if (isset($_GET['nn'])) {\n // Check the path\n if (Validator::isInsecurePath(Input::get('nn', true))) {\n throw new \\RuntimeException('Insecure path '.Input::get('nn', true));\n }\n\n $session->set(self::BREADCRUMB_SESSION_KEY, Input::get('nn', true));\n Controller::redirect(preg_replace('/&nn=[^&]*/', '', Environment::get('request')));\n }\n\n if (($nodeId = $session->get(self::BREADCRUMB_SESSION_KEY)) < 1) {\n return;\n }\n\n // Check the path\n if (Validator::isInsecurePath($nodeId)) {\n throw new \\RuntimeException('Insecure path '.$nodeId);\n }\n\n $ids = [];\n $links = [];\n $user = BackendUser::getInstance();\n\n // Generate breadcrumb trail\n if ($nodeId) {\n $id = $nodeId;\n\n do {\n $node = $this->db->fetchAssociative(\"SELECT * FROM {$dc->table} WHERE id=?\", [$id]);\n\n if (!$node) {\n // Currently selected node does not exist\n if ((int) $id === (int) $nodeId) {\n $session->set(self::BREADCRUMB_SESSION_KEY, 0);\n\n return;\n }\n\n break;\n }\n\n $ids[] = $id;\n\n // No link for the active node\n if ((int) $node['id'] === (int) $nodeId) {\n $links[] = $this->onLabelCallback($node, '', null, '', true).' '.$node['name'];\n } else {\n $links[] = $this->onLabelCallback($node, '', null, '', true).' <a href=\"'.Backend::addToUrl('nn='.$node['id']).'\" title=\"'.StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['selectNode']).'\">'.$node['name'].'</a>';\n }\n\n // Do not show the mounted nodes\n if (!$user->isAdmin && $user->hasAccess($node['id'], 'nodeMounts')) {\n break;\n }\n\n $id = $node['pid'];\n } while ($id > 0 && 'root' !== $node['type']);\n }\n\n // Check whether the node is mounted\n if (!$user->hasAccess($ids, 'nodeMounts')) {\n $session->set(self::BREADCRUMB_SESSION_KEY, 0);\n\n throw new AccessDeniedException('Node ID '.$nodeId.' is not mounted.');\n }\n\n // Limit tree\n $GLOBALS['TL_DCA'][$dc->table]['list']['sorting']['root'] = [$nodeId];\n\n // Add root link\n $links[] = Image::getHtml($GLOBALS['TL_DCA'][$dc->table]['list']['sorting']['icon']).' <a href=\"'.Backend::addToUrl('nn=0').'\" title=\"'.StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['selectAllNodes']).'\">'.$GLOBALS['TL_LANG']['MSC']['filterAll'].'</a>';\n $links = array_reverse($links);\n\n // Insert breadcrumb menu\n $GLOBALS['TL_DCA'][$dc->table]['list']['sorting']['breadcrumb'] = '\n\n<nav aria-label=\"'.$GLOBALS['TL_LANG']['MSC']['breadcrumbMenu'].'\">\n <ul id=\"tl_breadcrumb\">\n <li>'.implode(' › </li><li>', $links).'</li>\n </ul>\n</nav>';\n }", "function html_breadcrumb($hierarchy = null, $sep = ', ', $end = ' : ') {\n\t\tif(!is_array($hierarchy))\n\t\t\t$hierarchy = $this->hierarchy('page', PAGE_PATH);\n\t\t$nbr = count($hierarchy);\n\n\t\t$html = $plain = '';\n\t\tforeach($hierarchy as $id => $p) {\n\t\t\t// separators\n\t\t\tif($nbr > 1) {\n\t\t\t\tif($id < $nbr - 1) {\n\t\t\t\t\tif($id) {\n\t\t\t\t\t\t$plain.= $sep;\n\t\t\t\t\t\t$html .= $sep;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$plain.= $end;\n\t\t\t\t\t$html .= $end;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// titles\n\t\t\t$ttl = $this->page_title($p);\n\t\t\t$plain.= $ttl;\n\t\t\tif($id < $nbr-1)\n\t\t\t\t$html .= $this->parse_link($p);\n\t\t\telse\n\t\t\t\t$html .= '<strong><a id=\"title\" href=\"#top\">' . $ttl . '</a></strong>';\n\t\t}\n\t\treturn array('plain' => $plain, 'html' => $html);\n\t}", "function buildBreadCrumbs(&$pageInformationArray){\n //This Function builds the breadcrumbs on every page except the home page\n if (!(Count($pageInformationArray) > 0)){\n return;\n } ?>\n\n <div class=\"breadcrumbs\">\n <div class=\"container\">\n <ol class=\"breadcrumb breadcrumb1 animated wow slideInLeft animated\" data-wow-delay=\".5s\" style=\"visibility: visible; animation-delay: 0.5s; animation-name: slideInLeft;\">\n <li><a href=\"index.php\"><span class=\"glyphicon glyphicon-home\" aria-hidden=\"true\"></span>Home</a></li>\n<?php //Loop through array passed in which will create the multiple breadcrumbs\n for($index = 0; $index < Count($pageInformationArray); $index++){\n if( $index < (Count($pageInformationArray) - 1)){ ?>\n <li><a href=\"<?php echo $pageInformationArray[$index][0];?>\"><?php echo $pageInformationArray[$index][1];?></a></li>\n <?php } else{ ?>\n <li class=\"active\"><?php echo $pageInformationArray[$index][1];?></li>\n <?php } \n } ?>\n </ol>\n </div>\n </div>\n<?php }", "public function getBreadCrumbs($page){\n\t\tif(substr($page, -3) == \" VN\"){\n\t\t\t$query = \"[[$page]]|?\".MODELLINKPROPERTY;\n\t\t\t$result = $this->askAPI->ask($query);\n\t\t\t$page = $result['query']['results'][$page]['printouts'][MODELLINKPROPERTY][0]['fulltext'];\n\t\t}\n\t\t\n\t\tif(!$page)\n\t\t\treturn;\t//if page is empty or not set, quit.\n\t\t\n\t\t//create empty trailset\n\t\t$trailset=array();\n\t\t\n\t\t//fill trailset\n\t\t$this->getTrails( array( new Node($page, false) ), $trailset);\n\t\t\n\t\t//extract the bread crumb trails from the trails found\n\t\tforeach($trailset as $trail){\n\t\t\t$bcTrail = array();\t\t\t\t\t\t\t\t\t\t\t//start with an empty array!\n\t\t\tforeach($trail as $node){\n\t\t\t\t$bc = $node->getBreadCrumb();\t\t\t\t\t\t\t//NB bc may be an array\n\t\t\t\tif( is_array($bc) )\n\t\t\t\t\t$bc = $bc[0];\t//assume there is only one! FIXME?: use all? -But a practice always has at most one context\n\t\t\t\tif(is_a($bc, \"Node\") && $bc->getUrl()){\t\t\t\t\t//the starting $node has value false for url (see getTrails call a few lines above) \n\t\t\t\t\t$name = $bc->getName();\n\t\t\t\t\t$url = $bc->getUrl();\n\n\t\t\t\t\t//change to VN url if available\n\t\t\t\t\t$query = \"[[\".MODELLINKPROPERTY.\"::$name]]\";\t\t//get all (VN) pages that refer to this page through MODELLINK\n\t\t\t\t\t$result = $this->askAPI->ask($query);\t\t\t\t//check with code Thijs (search engine, how VN's are found)\n\t\t\t\t\t$result = array_pop($result['query']['results']);\t//assume there is only one (always take first VN page found)\n\t\t\t\t\tif($result){\n\t\t\t\t\t\t$url = $result['fullurl'];\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Change name to 'heading <lng>' property value, if available\n\t\t\t\t\t//FIXME: this is duplicate code, from function setPagetitle() in helper.php \n\t\t\t\t\t//Mooiere oplossing: zie todo regel 12 helper.php: elke link die de skin laat zien moet door het page naming algorithm worden gehaald\n\t\t\t\t\t$langCode=\"NL\";\n\t\t\t\t\t$page = $name;\n\t\t\t\t\t$parheadpluslang = PARHEADINGPROPERTY.strtolower($langCode);\n\t\t\t\t\t$query = \"[[\".$page.\"]]|?\".$parheadpluslang; \t//get value(s!) of heading property on page $pagename\n\t\t\t\t\t$result = APIAsker::getInstance()->ask($query);\n\t\t\t\t\t$result = array_shift($result['query']['results']);\n\t\t\t\t\t$paragraphHeading = $result['printouts'][$parheadpluslang][0];\n\t\t\t\t\tif($paragraphHeading)\n\t\t\t\t\t\t$name = $paragraphHeading;\n\t\t\t\t\t\n\t\t\t\t\t$bcTrail[$name] = $url;\t\t\t\t\t\t\t\t//this eliminates doubles in the bcTrail! That's a good thing!\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( !in_array(array_reverse($bcTrail), $bcTrailSet) )\n\t\t\t\t$bcTrailSet[] = array_reverse($bcTrail);\n\t\t}\n\n\t\t/*FIXME/TODO some thoughts:\n\t\t- l. {$bcTrail[$name] = $url;} eliminates doubles in $bcTrail (by page name): however: structures with doubles are wrong models? Notification of this?\n\t\t- l. is_a() needed because of Ontwerpen van een kleidijk (Activity), see textEdit, $bc may still contain: \"practice\"\n\t\t- l. {$bcTrail = array();} is very important: start looping over nodes with an empty array!\n\t\t- this code may also result in empty arrays $bcTrail in $bcTrailSet... (e.g. Building_with_Nature_interventies_VN)\n\t\t- also tested with (incl VN): Delta-ecosysteem, Ameland, Waterkering, Zeeweringen_Begrippen_VN\n\t\t- VN checking of links should be done automatically and generally for all links by the skin (i.e. for search results too, etc?)\n\t\t- page naming algorithm should be used for linklabels too\n\t\t- prevent doubles in the trailset bij the finishing if(!array())...?\n\t\t- Moet er nog in volgens bauke: broader en part-of - Duinsuppletie - hans? for now: used SKOSEMBROADER property, see getNodeParents()\n\t\t- ...\n\t\t*/\n\t\t\n\t\treturn $bcTrailSet;\n\t}", "public static function getCrumbsHtml()\n {\n $html = \"\\n\";\n $glue = ' <span class=\"glyphicon glyphicon-chevron-right\"></span> ';\n $trail = [];\n $menuArray = self::getMenuArray();\n\n // get pagePath (only from site-root), and adjust to the same format as how the $menu_array paths are defined\n $pagePath = self::pagePathFromSiteRoot(''); // '' = no extension as per $menu_array path definitions\n if(substr($pagePath,-5)=='index') $pagePath = substr($pagePath,0,strlen($pagePath)-5); // also remove /path/\"index\" as per $menu_array path definitions\n #dmsg('pagePath',$pagePath,'crumbs');\n\n // prepare home link for beginning of trail\n $homeLink = '<a href=\"' . self::_menuLink2href(self::homePath()) . '\">Home</a>';\n\n // search the menu array for matching path\n if ( self::findPageInMenu( $pagePath, $menuArray, $trail ) ) {\n $trail[] = $homeLink;\n dmsg('trail',$trail,'crumbs');\n $html .= implode( $glue, array_reverse( $trail ) );\n } else {\n // not in menuArray, use this pages dir components to build a virtual trail\n $trail = explode('/', trim(self::$pathComponentDirs,'/')); if(isset($trail[0]) && $trail[0]=='') $trail=[];\n #$trail[] = '<a href=\"' . self::_menuLink2href($pagePath) . '\">'.self::pageFilename('').'</a>';\n $trail[] = self::pageFilename(''); // dont href self\n array_unshift($trail, $homeLink);\n dmsg('trail',$trail,'crumbs');\n $html .= '<span class=\"capitalize\">' . implode( $glue, $trail ) . '</span>';\n }\n return $html;\n }", "function get_breadcrumb() {\n\n // Outputs home breadcrumb \n echo '<a href=\"'.home_url().'\" rel=\"nofollow\">Home</a>';\n\n // Retrievea post categories.\n $category = get_the_category();\n\n // Checks if page template is category or single \n if (is_category() || is_single() || is_tag() || is_date()) {\n\n // Outputs arrows\n echo \"&nbsp;&nbsp;&#187;&nbsp;&nbsp;\";\n\n // Checks if category array is not empty\n if ( $category[0] ) {\n // Outputs current category of post (NOTE: only outputs one category)\n echo '<a href=\"' . get_category_link( $category[0]->term_id ) . '\">' . $category[0]->cat_name . '</a>';\n }\n\n // Determines whether the query is for an existing single post\n if (is_single()) {\n // Outputs arrows \n echo \" &nbsp;&nbsp;&#187;&nbsp;&nbsp; \";\n // Outputs the title\n the_title();\n }\n\n } \n}", "function issues_prepare_parent_breadcrumbs($issue) {\n\tif ($issue && $issue->parent_guid) {\n\t\t$parents = array();\n\t\t$parent = get_entity($issue->parent_guid);\n\t\twhile ($parent) {\n\t\t\tarray_push($parents, $parent);\n\t\t\t$parent = get_entity($parent->parent_guid);\n\t\t}\n\t\twhile ($parents) {\n\t\t\t$parent = array_pop($parents);\n\t\t\telgg_push_breadcrumb($parent->title, $parent->getURL());\n\t\t}\n\t}\n}", "public function getBreadcrumb()\n {\n return $this->breadcrumb;\n }", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "public function breadCrumb()\n\t{\n\t\treturn parent::breadCrumb().\" \".$GLOBALS['super']->config->crumbSeperator.\" \".$this->getName();\n\t}", "function print_breadcrumb() {\n\t?>\n\t<div class=\"breadcrumb-wrapper\">\n\t\t<nav aria-label=\"breadcrumb\">\n\t\t\t<ol class=\"breadcrumb\">\n\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"<?php echo esc_url( site_url() ); ?>\">Home</a></li>\n\t\t\t\t<?php if ( is_page() ) : ?>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_home() ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">Insights</li>\n\t\t\t\t<?php elseif ( is_singular( 'post' ) ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item\"><a href=\"<?php echo esc_url( get_permalink( get_option( 'page_for_posts' ) ) ); ?>\">Insights</a></li>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_singular( 'service' ) ) : ?>\n\t\t\t\t\t<?php $term = get_the_terms( get_the_ID(), 'service-category' )[0]; ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">\n\t\t\t\t\t\t<?php echo wp_kses_post( $term->name ); ?>\n\t\t\t\t\t</li>\n\t\t\t\t<?php elseif ( is_singular() ) : ?>\n\t\t\t\t\t<?php\n\t\t\t\t\tglobal $post;\n\t\t\t\t\t$post_type = get_post_type( $post );\n\t\t\t\t\t$post_type_object = get_post_type_object( $post_type );\n\t\t\t\t\t?>\n\t\t\t\t\t<li class=\"breadcrumb-item\">\n\t\t\t\t\t\t<a href=\"<?php echo esc_url( get_post_type_archive_link( $post_type ) ); ?>\">\n\t\t\t\t\t\t\t<?php echo wp_kses_post( $post_type_object->label ); ?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</li>\n\t\t\t\t\t<?php the_title( '<li class=\"breadcrumb-item active\">', '</li>' ); ?>\n\t\t\t\t<?php elseif ( is_tax() ) : ?>\n\t\t\t\t\t<li class=\"breadcrumb-item active\">\n\t\t\t\t\t\t<?php echo wp_kses_post( get_queried_object()->name ); ?>\n\t\t\t\t\t</li>\n\t\t\t\t<?php endif; ?>\n\t\t\t</ol>\n\t\t</nav>\n\t</div>\n\t<?php\n}", "function get_breadcrumb() {\n // Settings\n $separator = '<i class=\"fa fa-angle-right\"></i>';\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = 'Home';\n \n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)\n $custom_taxonomy = 'product_cat';\n \n // Get the query & post information\n global $post,$wp_query;\n \n // Do not display on the homepage\n if ( !is_front_page() ) {\n \n // Build the breadcrums\n echo '<ul id=\"' . $breadcrums_id . '\" class=\"' . $breadcrums_class . '\">';\n \n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . $home_title . '\">' . $home_title . '</a></li>';\n echo '<li class=\"separator separator-home\"> ' . $separator . ' </li>';\n \n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n \n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . post_type_archive_title($prefix, false) . '</strong></li>';\n \n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive . '\" title=\"' . $post_type_object->labels->name . '\">' . $post_type_object->labels->name . '</a></li>';\n echo '<li class=\"separator\"> ' . $separator . ' </li>';\n \n }\n \n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . $custom_tax_name . '</strong></li>';\n \n } else if ( is_single() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive . '\" title=\"' . $post_type_object->labels->name . '\">' . $post_type_object->labels->name . '</a></li>';\n echo '<li class=\"separator\"> ' . $separator . ' </li>';\n \n }\n \n // Get post category info\n // $category = get_the_category();\n \n // if(!empty($category)) {\n \n // // Get last category post is in\n // $last_category = end(array_values($category));\n \n // // Get parent any categories and create array\n // $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n // $cat_parents = explode(',',$get_cat_parents);\n \n // // Loop through parent categories and store in variable $cat_display\n // $cat_display = '';\n // foreach($cat_parents as $parents) {\n // $cat_display .= '<li class=\"item-cat\">'.$parents.'</li>';\n // $cat_display .= '<li class=\"separator\"> ' . $separator . ' </li>';\n // }\n \n // }\n \n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n \n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n \n }\n \n // Check if the post is in a category\n if(!empty($last_category)) {\n echo $cat_display;\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n \n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n \n echo '<li class=\"item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '\"><a class=\"bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '\" href=\"' . $cat_link . '\" title=\"' . $cat_name . '\">' . $cat_name . '</a></li>';\n echo '<li class=\"separator\"> ' . $separator . ' </li>';\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n \n } else {\n \n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n \n }\n \n } else if ( is_category() ) {\n \n // Category page\n echo '<li class=\"item-current item-cat\"><strong class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</strong></li>';\n \n } else if ( is_page() ) {\n \n // Standard page\n if( $post->post_parent ){\n \n // If child page, get parents \n $anc = get_post_ancestors( $post->ID );\n \n // Get parents in the right order\n $anc = array_reverse($anc);\n \n // Parent page loop\n if ( !isset( $parents ) ) $parents = null;\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . $ancestor . '\"><a class=\"bread-parent bread-parent-' . $ancestor . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n $parents .= '<li class=\"separator separator-' . $ancestor . '\"> ' . $separator . ' </li>';\n }\n \n // Display parent pages\n echo $parents;\n \n // Current page\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong title=\"' . get_the_title() . '\"> ' . get_the_title() . '</strong></li>';\n \n } else {\n \n // Just display current page if not parents\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\"> ' . get_the_title() . '</strong></li>';\n \n }\n \n } else if ( is_tag() ) {\n \n // Tag page\n \n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n \n // Display the tag name\n echo '<li class=\"item-current item-tag-' . $get_term_id . ' item-tag-' . $get_term_slug . '\"><strong class=\"bread-current bread-tag-' . $get_term_id . ' bread-tag-' . $get_term_slug . '\">' . $get_term_name . '</strong></li>';\n \n } elseif ( is_day() ) {\n \n // Day archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . $separator . ' </li>';\n \n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('m') . '\"> ' . $separator . ' </li>';\n \n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><strong class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';\n \n } else if ( is_month() ) {\n \n // Month Archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . $separator . ' </li>';\n \n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><strong class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</strong></li>';\n \n } else if ( is_year() ) {\n \n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><strong class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</strong></li>';\n \n } else if ( is_author() ) {\n \n // Auhor archive\n \n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n \n // Display author name\n echo '<li class=\"item-current item-current-' . $userdata->user_nicename . '\"><strong class=\"bread-current bread-current-' . $userdata->user_nicename . '\" title=\"' . $userdata->display_name . '\">' . 'Author: ' . $userdata->display_name . '</strong></li>';\n \n } else if ( get_query_var('paged') ) {\n \n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><strong class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"Page ' . get_query_var('paged') . '\">'.__('Page') . ' ' . get_query_var('paged') . '</strong></li>';\n \n } else if ( is_search() ) {\n \n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><strong class=\"bread-current bread-current-' . get_search_query() . '\" title=\"Search results for: ' . get_search_query() . '\">Search results for: ' . get_search_query() . '</strong></li>';\n \n } elseif ( is_404() ) {\n \n // 404 page\n echo '<li>' . 'Error 404' . '</li>';\n }\n \n echo '</ul>';\n \n }\n \n}", "public function bread_menu()\n\t{\n\t\t// get current url address\n\t\t$VarServer = $_SERVER['REQUEST_URI'];\n\n\t\t// we trimed back slash left part of url to equal the string provided by the current address\n\t\t$trimed_server_name = ltrim($VarServer, '/');\n\t\t$xploded = explode('/', $trimed_server_name);\n\n\t\t\t// need to evaluate if there's extension to our url, if extended. we must trim the last part of url to find match in our query stated below\n\t\t\tif(count($xploded) > 2)\n\t\t\t{\n\t\t\t\t// url has extension\n\t\t\t\t// this should be match \n\t\t\t\t$on_the_go_url = $xploded[0].\"/\".$xploded[1];\n\t\t\t\t// this is the last part or the main display page name of breadcrumbs\n\t\t\t\t$bread_extend = $xploded[count($xploded)-1];\n\t\t\t} else\n\t\t\t{\n\t\t\t\t// no url extension, *condition\n\t\t\t\t$on_the_go_url = $xploded[0].\"/\".$xploded[1];\n\t\t\t\t$bread_extend = '';\n\t\t\t}\n\n\t\t// our main selecion query\n\t $module_name = $this->where('url', $on_the_go_url)->get();\n\n\t\t\tif(count($module_name) > 0)\n\t\t\t{\n\t\t\t\t// get database selection output\n\t\t\t\tforeach ($module_name as $tinapay) {\n\t\t\t\t\t$urls = '/'.$tinapay->url;\n\t\t\t\t\t$name_mod = $tinapay->name; \n\t\t\t\t}\n\n\t\t\t\t//main keyword functions or output generation if our breadcrumbs :D\n\t\t\t\tBreadcrumb::addbreadcrumb('Home', '/home/dashboard');\n\t\t\t\tBreadcrumb::addbreadcrumb($name_mod, $urls);\n\t\t\t\t// this is the extension name/display name\n\t\t\t\tif($bread_extend != null){\n\t\t\t\t\tBreadcrumb::addbreadcrumb($bread_extend);\n\t\t\t\t}\n\t\t\t\t// as you can see, it is a separator defined by itself :D\n\t\t\t\tBreadcrumb::setSeparator('>');\n\n\t\t\t\t// returns output of this method\n\t\t \treturn Breadcrumb::generate(); //Breadcrumbs UL is generated and stored in an array.\n\t\t\t}\n\t}", "function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {\n $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n\n // This will build our \"base URL\" ... Also accounts for HTTPS :)\n $base = ($_SERVER['HTTPS'] ? 'https' : 'http') . '://' . $_SERVER['HTTP_HOST'] . '/';\n\n // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL)\n $breadcrumbs = array(\"<a href=\\\"$base\\\">$home</a>\");\n\n // Initialize crumbs to track path for proper link\n $crumbs = '';\n\n // Find out the index for the last value in our path array\n $last = @end(array_keys($path));\n\n // Build the rest of the breadcrumbs\n foreach ($path as $x => $crumb) {\n // Our \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n $title = ucwords(str_replace(array('.php', '_', '%20'), array('', ' ', ' '), $crumb));\n\n // If we are not on the last index, then display an <a> tag\n if ($x != $last) {\n $breadcrumbs[] = \"<a href=\\\"$base$crumbs$crumb\\\">$title</a>\";\n $crumbs .= $crumb . '/';\n }\n // Otherwise, just display the title (minus)\n else {\n $breadcrumbs[] = $title;\n }\n\n }\n\n // Build our temporary array (pieces of bread) into one big string :)\n return implode($separator, $breadcrumbs);\n}", "function thumbwhere_contentcollectionitem_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollectionItem'), 'admin/content'),\n l(t('ContentCollectionItem'), 'admin/thumbwhere/thumbwhere_contentcollectionitems'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function thumbwhere_contentcollection_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('ContentCollection'), 'admin/content'),\n l(t('ContentCollection'), 'admin/thumbwhere/thumbwhere_contentcollections'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "function breadcrumbs_view($delim = '<b>&raquo;</b>') {\n\tglobal $file_name, $file, $root_filename;\n\t$temp_breadcrumb_path = '';\n\t$temp_breadcrumb_url = '';\n\t$directory_names = explode('/', $file);\n\tunset($directory_names[sizeof($directory_names)-1]);\n\tforeach($directory_names as $directory_name) {\n\t\t$temp_breadcrumb_path .= $directory_name.'/';\n\t\t$temp_breadcrumb_url = substr($temp_breadcrumb_path, 0, -1);\n\t\t$temp_breadcrumb .= $delim.' <a href=\"'.url($temp_breadcrumb_url,'dir').'\">'.$directory_name.'</a> ';\n\t}\n\treturn \"<a href=\\\"\".url('home', 'dir').\"\\\">Home</a> $temp_breadcrumb $delim <b>$file_name</b>\";\n}", "public function getBreadcrumb() \r\n {\r\n if(!empty($this->_current_cms_seo)) {\r\n return isset($this->_current_cms_seo['breadcrumb']) ? $this->_current_cms_seo['breadcrumb'] : '';\r\n }\r\n }", "public static function add_to_breadcrumb($title)\n {\n $new_url = self::get_new_url();\n $_breadcrumb = self::get_session($new_url, $title);\n\n // *shh* Check Does New Breadcrumb is Member of Master URLs\n if (self::does_need_reset($new_url)) {\n self::reset($new_url, $title);\n return [];\n }\n\n // todo : comment\n// var_dump( $_step = self::is_familiar_url_with_old_ones($_breadcrumb,$new_url) );\n// die();\n if ($_step = self::is_familiar_url_with_old_ones($_breadcrumb,$new_url))\n return self::make_new_broken_familiar_breadcrumb($_breadcrumb, $new_url, $title, $_step);\n\n // *shh* check Is New Breadcrumb now Exist In Breadcrumb or Not,\n // If Now Its Exist, We Could Delete The Newer Breadcrumbs until The New Url($new_url) and Call ( make_new_broken_breadcrumb() )\n // And If Its The New BC, We Add It In The Last Child Of 'before_url' nested arrays. Calling ( make_new_breadcrumb() )\n return (self::does_new_url_exist_in_current_breadcrumb($_breadcrumb, $new_url)) ?\n self::make_new_broken_breadcrumb($_breadcrumb, $new_url) : self::make_new_breadcrumb($_breadcrumb, $new_url, $title);\n }", "function appointment_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Content'), 'admin/content'),\n l(t('Appointment'), 'admin/content/appointment'),\n );\n \n drupal_set_breadcrumb($breadcrumb);\n}", "function Steps_prepare_parent_breadcrumbs($Step) {\n\tif ($Step && $Step->parent_guid) {\n\t\t$parents = array();\n\t\t$parent = get_entity($Step->parent_guid);\n\t\twhile ($parent) {\n\t\t\tarray_push($parents, $parent);\n\t\t\t$parent = get_entity($parent->parent_guid);\n\t\t}\n\t\twhile ($parents) {\n\t\t\t$parent = array_pop($parents);\n\t\t\telgg_push_breadcrumb($parent->title, $parent->getURL());\n\t\t}\n\t}\n}", "function wimbase_breadcrumb($variables) {\n if (module_exists('hansel')) {\n $hansel_breadcrumb = hansel_get_breadcrumbs();\n $breadcrumb = $hansel_breadcrumb['breadcrumb'];\n }\n else {\n $breadcrumb = $variables['breadcrumb'];\n }\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $title = '<p id=\"breadcrums-nav-title\" class=\"element-invisible\">'\n . t('You are here') . '</p>';\n $output = '<nav class=\"breadcrumb\" aria-labelledby=\"breadcrums-nav-title\"\">'\n . $title . implode(' / ', $breadcrumb) . '</nav>';\n return $output;\n }\n}", "function breadcrumbs($separator = ' &raquo; ', $home = 'Home') {\n\t // This gets the REQUEST_URI (/path/to/file.php), splits the string (using '/') into an array, and then filters out any empty values\n\t $path = array_filter(explode('/', parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)));\n\t //pre($path);\n\t // This will build our \"base URL\" ... Also accounts for HTTPS :)\n\t $base = base_url();\n\t \n\t // Initialize a temporary array with our breadcrumbs. (starting with our home page, which I'm assuming will be the base URL)\n\t $breadcrumbs = Array(\"<a href=\\\"$base\\\">$home</a>\");\n\t \n\t // Find out the index for the last value in our path array\n\t $last = end(array_keys($path));\n\t \n\t // Build the rest of the breadcrumbs\n\t foreach ($path AS $x => $crumb) {\n\t // Our \"title\" is the text that will be displayed (strip out .php and turn '_' into a space)\n\t $title = ucwords(str_replace(Array('.php', '_'), Array('', ' '), $crumb));\n\t \n\t // If we are not on the last index, then display an <a> tag\n\t if ($x != $last)\n\t $breadcrumbs[] = \"<a href=\\\"$base$crumb\\\">$title</a>\";\n\t // Otherwise, just display the title (minus)\n\t else\n\t $breadcrumbs[] = $title;\n\t }\n\t \n\t // Build our temporary array (pieces of bread) into one big string :)\n\t return implode($separator, $breadcrumbs);\n\t}", "function hbreadcrumbs()\n\t{\n\t\t$uri = luri_get();\n\t\t$html = \"\";\n\n\t\t$cat = lconf_dbget(\"default_uri\");\n\t\t$cat = mcategories_read($cat);\n\t\t$html = $cat[\"name\"];\n\n\t\tif (strlen($uri[0]))\n\t\t{\n\t\t\t$html = '<a href=\"' . hanchor_shref() . '\">' . $html . '</a>';\n\n\t\t\tfor($i = 0; $i < count($uri); $i++)\n\t\t\t{\n\t\t\t\t$cat = mcategories_read($uri[$i]);\n\t\t\t\tif ($i < count($uri) - 1 && $cat) $html .= ' &gt; <a href=\"' . hanchor_href(\"main/index/content\", mcategories_read_path($uri[$i], false)) . '\">' . $cat[\"name\"] . '</a>';\n\t\t\t\telse if ($cat) $html .= ' &gt; <span>' . $cat[\"name\"] . '</span>';\n\t\t\t}\n\t\t}\n\t\telse $html = '<span>' . $html . '</span>';\n\n\t\treturn $html;\n\t}", "public function breadCrumbs()\n {\n $menu = Menu::new()\n ->addClass('m-subheader__breadcrumbs m-nav m-nav--inline')\n ->add(\n Link::toRoute('home', '<i class=\"m-nav__link-icon la la-home\"></i>')\n ->addClass('m-nav__link m-nav__link--icon')\n ->addParentClass('m-nav__item m-nav__item--home')\n )\n ;\n\n foreach ($this->crumbs($this->sections()) as $item) {\n $menu\n ->add(\n Html::raw('>')\n ->addParentClass('m-nav__separator')\n )\n ->add(\n Link::to($item['link'], '<span class=\"m-nav__link-text\">'. $item['text'] . '</span>')\n ->addClass('m-nav__link')\n ->addParentClass('m-nav__item')\n )\n ;\n }\n\n return $menu;\n }", "function opensky_islandora_breadcrumbs_alter(&$data, $context) {\n // only make change if there is a collection param\n if (!isset($_GET['collection'])) {\n return;\n }\n $collection = $_GET['collection'];\n\n // Look for the collection_breadcrumb - it has a \"collection-crumb\" class so\n // we just look for that string\n foreach ($data as $crumb) {\n if (strpos($crumb, 'collection-crumb') !== false) {\n // our work is done - we've already added the collection breadcrumb\n return;\n }\n }\n $collection_breadcrumb = opensky_collection_breadcrumb($_GET);\n\n // splice it into existing breadcrums\n array_splice ($data, 1, 0, $collection_breadcrumb);\n}", "public static function breadcrumbs() {\n\t\tif(!self::has_breadcrumbs()) return;\n\t\t?>\n\t\t\t<h6 id=\"header-breadcrumbs\">\n\t\t\t\t<?php dimox_breadcrumbs('&middot;') ?>\n\t\t\t</h6>\n\t\t<?php\n\t}", "function the_breadcrumb() {\n\tif (!is_home()) {\n\t\techo '<span title=\"';\n\t\techo get_option('home');\n\t echo '\">';\n\t\tbloginfo('name');\n\t\techo \"</span> » \";\n\t\tif (is_page_template()) {\n\t\t\t\techo \" » \";\n echo the_title();\n\n \n \t\n\t\t} elseif (is_single()) {\n\t\t\techo the_title();\n\t\t}\n\t}\n}", "function apoc_breadcrumbs( $args = array() ) {\n\t$crumbs = new Apoc_Breadcrumbs( $args );\n\techo $crumbs->crumbs;\n}", "function custom_breadcrumbs() {\n\n // Settings\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = 'TOP';\n\n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. care_cat)\n $custom_taxonomy = 'knowledge-cat';\n\n // Get the query & post information\n global $post;\n\n // Do not display on the Home\n if ( !is_front_page() ) {\n\n // Build the breadcrums\n echo '<ul id=\"' . $breadcrums_id . '\" class=\"' . $breadcrums_class . '\">';\n\n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . $home_title . '\"><i class=\"fa fa-home\" aria-hidden=\"true\"></i>' . $home_title . '</a></li>';\n\n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . post_type_archive_title($prefix, false) . '</strong></li>';\n\n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n // If it is a custom post type display name and link\n \t\t\t\t\t\t if($post_type == 'post') {\n $post_type_object = get_post_type_object($post_type);\n\n\t\t\t\t\t\t\t $post_type_archive_label = \"整骨院・接骨院・整体・鍼灸院\";\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_category_link(get_category_by_slug('clinic')->term_id);\n\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n }\n\n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><strong class=\"bread-current bread-archive\">' . $custom_tax_name . '</strong></li>';\n\n } else if ( is_single() ) {\n\n // If post is a custom post type\n $post_type = get_post_type();\n\n if( $post_type == 'post' ) {\n $clinic_cat = get_the_category(get_the_ID())[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if( $post_type == 'hikikomori' || $post_type == 'violence' || $post_type == 'voice' || $post_type == 'question' ) {\n $clinic_id = $clinic_page->ID;\n $clinic_cat = get_the_category($clinic_id)[0];\n $post_type_archive_label = $clinic_cat->name;\n $post_type_archive_link = get_category_link($clinic_cat->term_id);\n echo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\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$post_type_object = get_post_type_object($post_type);\n\t\t\t\t\t\t\t\t$post_type_archive_label = $post_type_object->label;\n\t\t\t\t\t\t\t\t$post_type_archive_link = get_post_type_archive_link( $post_type );\n\t\t\t\t\t\t\t\techo '<li class=\"item-cat item-custom-post-type-' . $post_type . '\"><a class=\"bread-cat bread-custom-post-type-' . $post_type . '\" href=\"' . $post_type_archive_link . '\" title=\"' . $post_type_archive_label . '\">' . $post_type_archive_label . '</a></li>';\n\t\t\t\t\t\t\t}\n\n // Get post category info\n $category = get_the_category();\n\n if(!empty($category)) {\n\n // Get last category post is in\n $last_category = end(array_values($category));\n\n // Get parent any categories and create array\n $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n $cat_parents = explode(',',$get_cat_parents);\n\n // Loop through parent categories and store in variable $cat_display\n $cat_display = '';\n // foreach($cat_parents as $parents) {\n \t\t\t\t\t\t\t\t// \t $cat_display .= '<li class=\"item-cat\">'.$parents.'</li>';\n // }\n \t\t\t\t\t\t\t\t $cat_display .= '<li class=\"item-cat\">'.$cat_parents[0].'</li>';\n\n }\n\n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n\n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n\n }\n\n // Check if the post is in a category\n if(!empty($last_category)) {\n // echo $cat_display;\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n\n echo '<li class=\"item-cat item-cat-' . $cat_id . ' item-cat-' . $cat_nicename . '\"><a class=\"bread-cat bread-cat-' . $cat_id . ' bread-cat-' . $cat_nicename . '\" href=\"' . $cat_link . '\" title=\"' . $cat_name . '\">' . $cat_name . '</a></li>';\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n } else {\n\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_category() ) {\n\n // Category page\n echo '<li class=\"item-current item-cat\"><strong class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</strong></li>';\n\n } else if ( is_page() ) {\n\n // Standard page\n if( $post->post_parent ){\n\n // If child page, get parents\n $anc = get_post_ancestors( $post->ID );\n\n // Get parents in the right order\n $anc = array_reverse($anc);\n\n // Parent page loop\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . $ancestor . '\"><a class=\"bread-parent bread-parent-' . $ancestor . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n }\n\n // Display parent pages\n echo $parents;\n\n // Current page\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong title=\"' . get_the_title() . '\"> ' . get_the_title() . '</strong></li>';\n\n } else {\n\n // Just display current page if not parents\n echo '<li class=\"item-current item-' . $post->ID . '\"><strong class=\"bread-current bread-' . $post->ID . '\"> ' . get_the_title() . '</strong></li>';\n\n }\n\n } else if ( is_tag() ) {\n // Tag page\n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n\n // Display the tag name\n echo '<li class=\"item-current item-tag-' . $get_term_id . ' item-tag-' . $get_term_slug . '\"><strong class=\"bread-current bread-tag-' . $get_term_id . ' bread-tag-' . $get_term_slug . '\">' . $get_term_name . '</strong></li>';\n\n } elseif ( is_day() ) {\n // Day archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</a></li>';\n\n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><strong class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_month() ) {\n\n // Month Archive\n\n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</a></li>';\n\n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><strong class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . ' Archives</strong></li>';\n\n } else if ( is_year() ) {\n\n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><strong class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . ' Archives</strong></li>';\n\n } else if ( is_author() ) {\n\n // Auhor archive\n\n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n\n // Display author name\n echo '<li class=\"item-current item-current-' . $userdata->user_nicename . '\"><strong class=\"bread-current bread-current-' . $userdata->user_nicename . '\" title=\"' . $userdata->display_name . '\">' . 'Author: ' . $userdata->display_name . '</strong></li>';\n\n } else if ( get_query_var('paged') && !is_search() ) {\n\n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><strong class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"Page ' . get_query_var('paged') . '\">'.__('Page') . ' ' . get_query_var('paged') . '</strong></li>';\n\n } else if ( is_search() ) {\n\n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><strong class=\"bread-current bread-current-' . get_search_query() . '\" title=\"検索結果: ' . get_search_query() . '\">検索結果: ' . get_search_query() . '</strong></li>';\n\n } elseif ( is_404() ) {\n\n // 404 page\n echo '<li>' . 'Error 404' . '</li>';\n }\n echo '</ul>';\n }\n }", "function breadcrumb(){\n\t global $view;\n\t \n \t$view_header = ucfirst($view);\n\treturn \"<ul class='breadcrumb'>\n\t <li>System</li>\n\t <li class='active'>$view_header</li>\n\t\t </ul>\";\n }", "function ento_cdn_breadcrumb($variables) {\n // Use the Path Breadcrumbs theme function if it should be used instead.\n //if (_bootstrap_use_path_breadcrumbs()) {\n // return path_breadcrumbs_breadcrumb($variables);\n //}\n\n $output = '';\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n // Provide a navigational heading to give context for breadcrumb links to\n // screen-reader users. Make the heading invisible with .element-invisible.\n $output = '<h2 class=\"element-invisible\">' . t('You are here') . '</h2>';\n $crumbs = '<ol class=\"breadcrumb\">';\n $array_size = count($breadcrumb);\n $i = 0;\n while ( $i < $array_size) {\n $crumbs .= '<li';\n if ($i+1 == $array_size) {\n $crumbs .= ' class=\"active\"';\n }\n $crumbs .= '>';\n if ($i+1 == $array_size) {\n $crumbs .= ' <strong>' . $breadcrumb[$i] . '</strong>' . '</li>';\n } else {\n \t$crumbs .= $breadcrumb[$i] . '</li>';\n }\n $i++;\n }\n $crumbs .= '</ol>';\n return $crumbs;\n }\n\n // Determine if we are to display the breadcrumb.\n/* $bootstrap_breadcrumb = bootstrap_setting('breadcrumb');\n if (($bootstrap_breadcrumb == 1 || ($bootstrap_breadcrumb == 2 && arg(0) == 'admin')) && !empty($breadcrumb)) {\n $output = theme('item_list', array(\n 'attributes' => array(\n 'class' => array('breadcrumb'),\n ),\n 'items' => $breadcrumb,\n 'type' => 'ol',\n ));\n }\n return $output;*/\n}", "public function menu_get_active_breadcrumb()\n {\n return menu_get_active_breadcrumb();\n }", "public function buildViewBreadCrumb(\\Symfony\\Component\\Routing\\Route $route)\n {\n $routeDefaults = $route->getDefaults();\n // By setting a \"cache context\" to the \"url\", each requested URL gets it's own cache.\n // This way a single breadcrumb isn't cached for all pages on the site.\n $this->breadcrumb->addCacheContexts([\n \"url\"\n ]);\n // By adding \"cache tags\" for this specific node, the cache is invalidated when the node is edited.\n $this->breadcrumb->addCacheTags([\n \"view:\" . $routeDefaults['view_id'] . $routeDefaults['display_id']\n ]);\n $currentRoute = \\Drupal::routeMatch()->getRouteName();\n $r = $route->getPath();\n // Add \"Home\" breadcrumb link.\n $this->breadcrumb->addLink(Link::createFromRoute($this->t('Home'), '<front>'));\n if ($currentRoute == 'view.temoignage.page_1' && $route->getPath() == '/maigrir/la-communaute/temoignages') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Ils en parlent', Url::fromUri('base:/ils-en-parlent'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.livres_des_experts.page_1' && $route->getPath() == '/maigrir/livres/livres-des-experts') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Méthode', Url::fromUri('base:/methode-maigrir-sans-regime'))\n );\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Experts et coachs', Url::fromUri('base:/maigrir/nos-experts/nos-experts-maigrir-sans-regime'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.ils_en_parle.page_1' && $route->getPath() == '/maigrir/methode/maigrir-sans-regime-revue-presse') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Ils en parlent', Url::fromUri('base:/ils-en-parlent'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.ils_en_parle.page_2' && $route->getPath() == '/paroles-utilisateurs') {\n $this->breadcrumb->addLink(\n Link::fromTextAndUrl('Ils en parlent', Url::fromUri('base:/ils-en-parlent'))\n );\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.chat_historique.page_1' || $route->getPath() == '/maigrir/la-communaute/temoignages' || $route->getPath() == '/maigrir/la-communaute/chat-historique' ) {\n\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Community'), Url::fromUri('base:/maigrir/la-communaute')));\n if ($route->getPath() == '/maigrir/la-communaute/chat-historique') {\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Chat avec les experts'), Url::fromUri('base:/maigrir/la-communaute/chat-direct')));\n }\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n elseif ($currentRoute == 'view.blog.blog_all' && $route->getPath() == '/blog') {\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Community'), Url::fromUri('base:/maigrir/la-communaute')));\n }\n elseif ($currentRoute == 'view.blog.blog_user_all' && $route->getPath() == '/blog/{arg_0}') {\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t('Community'), Url::fromUri('base:/maigrir/la-communaute')));\n $this->breadcrumb->addLink(Link::fromTextAndUrl($this->t(\"Member's blog\"), Url::fromUri('base:/blog')));\n }\n elseif ($route->getPath() != '/maigrir/la-communaute/temoignages'&& $route->getPath() !='/paroles-utilisateurs') {\n // /add current view title\n $this->breadcrumb->addLink(Link::createFromRoute($routeDefaults['_title'], '<none>'));\n }\n return $this->breadcrumb;\n }", "public function getBreadCrumb()\n {\n $aPaths = array();\n $aPath = array();\n $iBaseLanguage = oxRegistry::getLang()->getBaseLanguage();\n $sSelfLink = $this->getViewConfig()->getSelfLink();\n\n $aPath['title'] = oxRegistry::getLang()->translateString('MY_ACCOUNT', $iBaseLanguage, false);\n $aPath['link'] = oxRegistry::get(\"oxSeoEncoder\")->getStaticUrl($sSelfLink . 'cl=account');\n $aPaths[] = $aPath;\n\n $aPath['title'] = oxRegistry::getLang()->translateString('ORDER_HISTORY', $iBaseLanguage, false);\n $aPath['link'] = $this->getLink();\n $aPaths[] = $aPath;\n\n return $aPaths;\n }", "function dimox_breadcrumbs() {\n\t\t$text['home'] = 'Home'; // text for the 'Home' link\n\t\t$text['category'] = '%s'; // text for a category page\n\t\t$text['search'] = 'Wyniki wyszukiwania dla \"%s\"'; // text for a search results page\n\t\t$text['404'] = 'Błąd 404'; // text for the 404 page\n\t\t$text['page'] = '%s'; // text 'Page N'\n\t\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\t\t$wrap_before = '<div class=\"breadcrumbs\" itemscope itemtype=\"htt://schema.org/BreadCrumbList\">'; // the opening wrapper tag\n\t\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t\t$sep = '›'; // separator between crumbs\n\t\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t\t$sep_after = '</span>'; // tag after separator\n\t\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t\t$show_on_home = 0; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t\t$after = '</span>'; // tag after the current crumb\n\t\t/* === END OF OPTIONS === */\n\t\tglobal $post;\n\t\t$home_link = home_url('/');\n\t\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t\t$link_after = '</span>';\n\t\t$link_attr = ' itemprop=\"url\"';\n\t\t$link_in_before = '<span itemprop=\"title\">';\n\t\t$link_in_after = '</span>';\n\t\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t\t$frontpage_id = get_option('page_on_front');\n\t\t$parent_id = $post->post_parent;\n\t\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\t\tif (is_home() || is_front_page()) {\n\t\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>' . $wrap_after;\n\t\t} else {\n\t\t\techo $wrap_before;\n\t\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\t\t\tif ( is_category() ) {\n\t\t\t\t$cat = get_category(get_query_var('cat'), false);\n\t\t\t\tif ($cat->parent != 0) {\n\t\t\t\t\t$cats = get_category_parents($cat->parent, TRUE, $sep);\n\t\t\t\t\t$cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $cats;\n\t\t\t\t}\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\t$cat = $cat->cat_ID;\n\t\t\t\t\techo $sep . sprintf($link, get_category_link($cat), get_cat_name($cat)) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . sprintf($text['category'], single_cat_title('', false)) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_search() ) {\n\t\t\t\tif (have_posts()) {\n\t\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\t\tif ($show_current) echo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\t\techo $before . sprintf($text['search'], get_search_query()) . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\t\tprintf($link, $home_link . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t\t} else {\n\t\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t\techo $cats;\n\t\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\t\techo $sep . sprintf($link, get_permalink(), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t// custom post type\n\t\t\t} elseif ( !is_single() && !is_page() && get_post_type() != 'post' && !is_404() ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\tif ( get_query_var('paged') ) {\n\t\t\t\t\techo $sep . sprintf($link, get_post_type_archive_link($post_type->name), $post_type->label) . $sep . $before . sprintf($text['page'], get_query_var('paged')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $sep . $before . $post_type->label . $after;\n\t\t\t\t}\n\t\t\t} elseif ( is_page() && !$parent_id ) {\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t$breadcrumbs = array();\n\t\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, get_permalink($page->ID), get_the_title($page->ID));\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t\t}\n\t\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} elseif ( is_404() ) {\n\t\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\t\t\t} elseif ( has_post_format() && !is_singular() ) {\n\t\t\t\tif ($show_home_link) echo $sep;\n\t\t\t\techo get_post_format_string( get_post_format() );\n\t\t\t}\n\t\t\techo $wrap_after;\n\t\t}\n\t}", "public function drawBreadcrumb($guid = false){\n\t\t global $db, $siteID, $page;\n\t\t $guid = ($guid) ? $guid : $this->guid;\n\t\t $html = '';\n\t\t $link = array();\n\t\t \n\t\t \t// current page\n\t\t \t$link[] = $this->drawTitleByGUID($guid);\n\t\t \n\t\t \t// add all precedings parents to the array\n\t\t\twhile($parent = $this->getParentByGUID($guid)){\n\t\t\t\t$pagetitle=$this->drawTitleByGUID($parent);\n\t\t\t\t$pagetitle=(strtolower($pagetitle)==\"home\")?$page->drawLabel(\"home\", \"Home\"):$pagetitle;\n\t\t\t\t$link[] = '<a href=\"'. $this->drawLinkByGUID($parent) .'\">'.ucfirst($pagetitle).'</a>';\n\t\t\t\t$guid = $parent;\n\t\t \t}\n\t\t \n\t\t \tif($link){\n\t\t\t\tkrsort($link);\n\t\t \t}\n\t\t \n\t\t \t// Add a home link\n\t\t\t$last = sizeof($link);\n\t\t\t$pagetitle=$this->drawTitleByGUID($siteID);\n\t\t\t$pagetitle=(strtolower($pagetitle)==\"home\")?$page->drawLabel(\"home\", \"Home\"):$pagetitle;\n\t\t \t$link[$last-1] = '<a href=\"'. $this->drawLinkByGUID($siteID) .'\">'.$pagetitle.'</a>';\n\t\t \t// this is a microsite so remove the first (duplicate) link\n\t\t \tif($link[$last-1] == $link[$last-2]){\n\t\t\t\tunset($link[$last-1]);\n\t\t \t}\n\n\t\t \t$html = join(' &gt; ',$link); // add the separator\n\t\t \n\t\t \treturn $html; \n\t\t}", "function arlo_fn_breadcrumbs() {\n \n // Settings\n $separator = '<span></span>';\n $breadcrums_id = 'breadcrumbs';\n $breadcrums_class = 'breadcrumbs';\n $home_title = esc_html__('Home', 'arlo');\n \n // If you have any custom post types with custom taxonomies, put the taxonomy name below (e.g. product_cat)\n $custom_taxonomy = '';\n \n // Get the query & post information\n global $post,$wp_query;\n \n // Do not display on the homepage\n if ( !is_front_page() ) {\n \t\n\t\techo '<div class=\"arlo_fn_breadcrumbs\">';\n // Build the breadcrums\n echo '<ul id=\"' . esc_attr($breadcrums_id) . '\" class=\"' . esc_attr($breadcrums_class) . '\">';\n \n // Home page\n echo '<li class=\"item-home\"><a class=\"bread-link bread-home\" href=\"' . get_home_url() . '\" title=\"' . esc_attr($home_title) . '\">' . esc_html($home_title) . '</a></li>';\n echo '<li class=\"separator separator-home\"> ' . wp_kses_post($separator) . ' </li>';\n \n if ( is_archive() && !is_tax() && !is_category() && !is_tag() ) {\n \n\t\t\t echo '<li class=\"item-current item-archive\"><span class=\"bread-current bread-archive\">' . esc_html__('Archive', 'arlo') . '</span></li>';\n\t\t\t\n } else if ( is_archive() && is_tax() && !is_category() && !is_tag() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . esc_attr($post_type) . '\"><a class=\"bread-cat bread-custom-post-type-' . esc_attr($post_type) . '\" href=\"' . esc_url($post_type_archive) . '\" title=\"' . esc_attr($post_type_object->labels->name) . '\">' . esc_attr($post_type_object->labels->name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n \n }\n \n $custom_tax_name = get_queried_object()->name;\n echo '<li class=\"item-current item-archive\"><span class=\"bread-current bread-archive\">' . esc_html($custom_tax_name) . '</span></li>';\n \n } else if ( is_single() ) {\n \n // If post is a custom post type\n $post_type = get_post_type();\n \n // If it is a custom post type display name and link\n if($post_type != 'post') {\n \n $post_type_object = get_post_type_object($post_type);\n $post_type_archive = get_post_type_archive_link($post_type);\n \n echo '<li class=\"item-cat item-custom-post-type-' . esc_attr($post_type) . '\"><a class=\"bread-cat bread-custom-post-type-' . esc_attr($post_type) . '\" href=\"' . esc_url($post_type_archive) . '\" title=\"' . esc_attr($post_type_object->labels->name) . '\">' . esc_html($post_type_object->labels->name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n \n }\n \n // Get post category info\n $category = get_the_category();\n \n if(!empty($category)) {\n \n // Get last category post is in\n $last_category = end(array_values($category));\n \n // Get parent any categories and create array\n $get_cat_parents = rtrim(get_category_parents($last_category->term_id, true, ','),',');\n $cat_parents = explode(',',$get_cat_parents);\n \n // Loop through parent categories and store in variable $cat_display\n $cat_display = '';\n foreach($cat_parents as $parents) {\n $cat_display .= '<li class=\"item-cat\">'.esc_html($parents).'</li>';\n $cat_display .= '<li class=\"separator\"> ' . esc_html($separator) . ' </li>';\n }\n \n }\n \n // If it's a custom post type within a custom taxonomy\n $taxonomy_exists = taxonomy_exists($custom_taxonomy);\n if(empty($last_category) && !empty($custom_taxonomy) && $taxonomy_exists) {\n $taxonomy_terms = get_the_terms( $post->ID, $custom_taxonomy );\n $cat_id = $taxonomy_terms[0]->term_id;\n $cat_nicename = $taxonomy_terms[0]->slug;\n $cat_link = get_term_link($taxonomy_terms[0]->term_id, $custom_taxonomy);\n $cat_name = $taxonomy_terms[0]->name;\n \n }\n \n // Check if the post is in a category\n if(!empty($last_category)) {\n echo wp_kses_post($cat_display);\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n // Else if post is in a custom taxonomy\n } else if(!empty($cat_id)) {\n \n echo '<li class=\"item-cat item-cat-' . esc_attr($cat_id) . ' item-cat-' . esc_attr($cat_nicename) . '\"><a class=\"bread-cat bread-cat-' . esc_attr($cat_id) . ' bread-cat-' . esc_attr($cat_nicename) . '\" href=\"' . esc_url($cat_link) . '\" title=\"' . esc_attr($cat_name) . '\">' . esc_html($cat_name) . '</a></li>';\n echo '<li class=\"separator\"> ' . wp_kses_post($separator) . ' </li>';\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n } else {\n \n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\" title=\"' . get_the_title() . '\">' . get_the_title() . '</span></li>';\n \n }\n \n } else if ( is_category() ) {\n \n // Category page\n echo '<li class=\"item-current item-cat\"><span class=\"bread-current bread-cat\">' . single_cat_title('', false) . '</span></li>';\n \n } else if ( is_page() ) {\n \n // Standard page\n if( $post->post_parent ){\n \n // If child page, get parents \n $anc = get_post_ancestors( $post->ID );\n \n // Get parents in the right order\n $anc = array_reverse($anc);\n \n // Parent page loop\n if ( !isset( $parents ) ) $parents = null;\n foreach ( $anc as $ancestor ) {\n $parents .= '<li class=\"item-parent item-parent-' . esc_attr($ancestor) . '\"><a class=\"bread-parent bread-parent-' . esc_attr($ancestor) . '\" href=\"' . get_permalink($ancestor) . '\" title=\"' . get_the_title($ancestor) . '\">' . get_the_title($ancestor) . '</a></li>';\n $parents .= '<li class=\"separator separator-' . esc_attr($ancestor) . '\"> ' . wp_kses_post($separator) . ' </li>';\n }\n \n // Display parent pages\n echo wp_kses_post($parents);\n \n // Current page\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span title=\"' . get_the_title() . '\"> ' . get_the_title() . '</span></li>';\n \n } else {\n \n // Just display current page if not parents\n echo '<li class=\"item-current item-' . esc_attr($post->ID) . '\"><span class=\"bread-current bread-' . esc_attr($post->ID) . '\"> ' . get_the_title() . '</span></li>';\n \n }\n \n } else if ( is_tag() ) {\n \n // Tag page\n \n // Get tag information\n $term_id = get_query_var('tag_id');\n $taxonomy = 'post_tag';\n $args = 'include=' . $term_id;\n $terms = get_terms( $taxonomy, $args );\n $get_term_id = $terms[0]->term_id;\n $get_term_slug = $terms[0]->slug;\n $get_term_name = $terms[0]->name;\n \n // Display the tag name\n echo '<li class=\"item-current item-tag-' . esc_attr($get_term_id) . ' item-tag-' . esc_attr($get_term_slug) . '\"><span class=\"bread-current bread-tag-' . esc_attr($get_term_id) . ' bread-tag-' . esc_attr($get_term_slug) . '\">' . esc_html($get_term_name) . '</span></li>';\n \n } elseif ( is_day() ) {\n \n // Day archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Month link\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><a class=\"bread-month bread-month-' . get_the_time('m') . '\" href=\"' . get_month_link( get_the_time('Y'), get_the_time('m') ) . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('m') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Day display\n echo '<li class=\"item-current item-' . get_the_time('j') . '\"><span class=\"bread-current bread-' . get_the_time('j') . '\"> ' . get_the_time('jS') . ' ' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_month() ) {\n \n // Month Archive\n \n // Year link\n echo '<li class=\"item-year item-year-' . get_the_time('Y') . '\"><a class=\"bread-year bread-year-' . get_the_time('Y') . '\" href=\"' . get_year_link( get_the_time('Y') ) . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</a></li>';\n echo '<li class=\"separator separator-' . get_the_time('Y') . '\"> ' . wp_kses_post($separator) . ' </li>';\n \n // Month display\n echo '<li class=\"item-month item-month-' . get_the_time('m') . '\"><span class=\"bread-month bread-month-' . get_the_time('m') . '\" title=\"' . get_the_time('M') . '\">' . get_the_time('M') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_year() ) {\n \n // Display year archive\n echo '<li class=\"item-current item-current-' . get_the_time('Y') . '\"><span class=\"bread-current bread-current-' . get_the_time('Y') . '\" title=\"' . get_the_time('Y') . '\">' . get_the_time('Y') . esc_html__(' Archives', 'arlo').'</span></li>';\n \n } else if ( is_author() ) {\n \n // Auhor archive\n \n // Get the author information\n global $author;\n $userdata = get_userdata( $author );\n \n // Display author name\n echo '<li class=\"item-current item-current-' . esc_attr($userdata->display_name) . '\"><span class=\"bread-current bread-current-' . esc_attr($userdata->display_name) . '\" title=\"' . esc_attr($userdata->display_name) . '\">' . esc_html__('Author: ', 'arlo') . esc_html($userdata->display_name) . '</span></li>';\n \n } else if ( get_query_var('paged') ) {\n \n // Paginated archives\n echo '<li class=\"item-current item-current-' . get_query_var('paged') . '\"><span class=\"bread-current bread-current-' . get_query_var('paged') . '\" title=\"'.esc_attr__('Page ', 'arlo') . get_query_var('paged') . '\">'.esc_html__('Page', 'arlo') . ' ' . get_query_var('paged') . '</span></li>';\n \n } else if ( is_search() ) {\n \n // Search results page\n echo '<li class=\"item-current item-current-' . get_search_query() . '\"><span class=\"bread-current bread-current-' . get_search_query() . '\" title=\"'.esc_attr__('Search results for: ', 'arlo'). get_search_query() . '\">' .esc_html__('Search results for: ', 'arlo') . get_search_query() . '</span></li>';\n \n } elseif ( is_404() ) {\n \n // 404 page\n echo '<li>' . esc_html__('Error 404', 'arlo') . '</li>';\n }\n \n echo '</ul>';\n\t\techo '</div>';\n \n }\n \n}", "function buddypress_crumbs() {\n\t\n\t\t// Setup the trail\n\t\t$bp_trail = array();\n\t\t\t\t\n\t\t// User Profiles\n\t\tif ( bp_is_user() ) : \n\t\t\n\t\t\t// Your own profile\n\t\t\tif ( bp_is_my_profile() ) :\n\t\t\t\t $bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"Your Profile\">Your Profile</a>';\n\t\t\t\t \n\t\t\t// Someone else's profile\n\t\t\telse :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_members_directory_permalink() .'\" title=\"Members Directory\">Members</a>';\n\t\t\t\t$bp_trail[] = '<a href=\"'.bp_displayed_user_domain().'\" title=\"'.bp_get_displayed_user_fullname(). '\">' . bp_get_displayed_user_fullname() . '</a>';\n\t\t\tendif;\n\n\t\t\t// Display the current component\n\t\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\t\n\t\t// Guild Profile\n\t\telseif ( bp_is_group() ) :\n\t\t\t$bp_trail[] = '<a href=\"'. bp_get_groups_directory_permalink() .'\" title=\"Groups and Guilds Directory\">Groups</a>';\n\t\t\t\n\t\t\t// Group Creation\n\t\t\tif ( bp_is_group_create() ) :\n\t\t\t\t$bp_trail[] = 'Create New Group';\n\t\t\t\t\n\t\t\t// Group Profile Home\n\t\t\telseif ( 'home' == bp_current_action() ) :\n\t\t\t\t$bp_trail[] = bp_get_group_name();\n\t\t\t\t\n\t\t\t// Group Profile Sub-Component\n\t\t\telseif ( bp_current_action() != 'forum' ) : \n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\t\t\t$bp_trail[] = ucfirst( bp_current_action() );\n\t\t\tendif;\n\t\t\t\t\n\t\t\tif ( bp_current_action() == 'forum' ) :\n\t\t\t\t$bp_trail[] = '<a href=\"'. bp_get_group_permalink() .'\" title=\"'.bp_get_current_group_name().'\">'.bp_get_current_group_name().'</a>';\n\t\t\t\t$bp_trail = array_merge( $bp_trail, $this->group_forum_crumbs() );\n\t\t\tendif;\n\n\t\t// Directories\n\t\telseif ( bp_is_directory() ) :\t\n\t\t\tif ( bp_is_activity_component() ) \t\t$bp_trail[] = 'Sitewide Activity';\n\t\t\telseif ( bp_is_members_component() )\t$bp_trail[] = 'Members Directory';\n\t\t\telseif ( bp_is_groups_component() )\t\t$bp_trail[] = 'Guilds Directory';\n\t\t\telse \t\t\t\t\t\t\t\t\t$bp_trail[] = ucfirst( bp_current_component() );\n\t\t\t\n\t\telseif ( bp_is_register_page() || bp_is_activation_page() ) :\n\t\t\t$bp_trail[] = 'New User Registration';\n\t\t\t\t\n\t\t// Backup Placeholder\n\t\telse :\n\t\t\t$bp_trail[] = '404 Page Not Found';\n\t\tendif;\n\t\t\t\n\t\t// Return the BuddyPress trail\n\t\treturn $bp_trail;\n\t}", "function renderBreadcrumbs(array $links, $pre_links = '')\n {\n global $lang;\n /*\n NOTE: implemented as seen on themes and search. There is a lot of room for improvement UI wise\n\n TODO: search_title_processing.php is using it intesively and at the moment there are differences in terms of \n rendered HTML between themes/ search and search_title_processing.php. We should refactor all places were breadcrumbs\n are being created and make sure they all use this function (or any future related functions - like generateBreadcrumb() ).\n */\n\n if(0 === count($links))\n {\n return;\n }\n ?>\n <div class=\"SearchBreadcrumbs\">\n <?php\n if('' !== $pre_links && $pre_links !== strip_tags($pre_links))\n {\n echo $pre_links . '&nbsp;' . LINK_CARET;\n }\n\n for($i = 0; $i < count($links); $i++)\n {\n if(0 < $i)\n {\n echo LINK_CARET;\n }\n ?>\n <a href=\"<?php echo htmlspecialchars($links[$i]['href']); ?>\" onClick=\"return CentralSpaceLoad(this, true);\">\n <span><?php echo htmlspecialchars($links[$i]['title']); ?></span>\n </a>\n <?php\n }\n ?>\n </div>\n <?php\n\n return;\n }", "function get_breadcrumb() {\n echo '<a href=\"'.home_url().'\" rel=\"nofollow\">Home</a>';\n if (is_category() || is_single()) {\n echo \"&nbsp;&nbsp;&#187;&nbsp;&nbsp;\";\n the_category(' &bull; ');\n if (is_single()) {\n echo \" &nbsp;&nbsp;&#187;&nbsp;&nbsp; \";\n the_title();\n }\n } elseif (is_page()) {\n echo \"&nbsp;&nbsp;&#187;&nbsp;&nbsp;\";\n echo the_title();\n }\n}", "function simple_breadcrumb() {\n global $post;\n global $staticVars;\n // print_r(has_term($staticVars['industryNewTypeID'], 'new-type', $post));exit;\n $sep = ' / ';\n\techo '<a href=\"'.pll_home_url().'\">'.pll__('Lietuvos kino centras').'</a>'.$sep;\n\t//echo '<a href=\"'.pll_home_url().'\">'.get_bloginfo('name').'</a>'.$sep;\n\n/*\tif ( is_category() || is_single() ) {\n\t\tthe_category(', ');\n\t\tif ( is_single() ) {\n\t\t\techo $sep;\n\t\t\tthe_title();\n\t\t}*/\n\n\tif (is_single()) {\n\t\tif(get_post_type() == 'post'){\n\t\t\tif(has_term($staticVars['industryNewTypeID'], 'new-type', $post)){\n\t\t\t\t$news_link = $staticVars['industryNewsUrl'];\n\t\t\t\t$news_link_text = pll__('Industrijos naujienos');\n\t\t\t} else {\n\t\t\t\t$news_link = $staticVars['newsUrl'];\n\t\t\t\t$news_link_text = pll__('Naujienos');\n\t\t\t}\n\t\t\techo '<a href=\"'.$news_link.'\">';\n\t\t\techo $news_link_text;\n\t\t\techo \"</a>\";\n\t\t} elseif(get_post_type() == 'interesting-fact') {\n\n\t\t\t$pages = get_pages(array(\n\t\t\t 'meta_key' => '_wp_page_template',\n\t\t\t 'meta_value' => 'page-templates/interesting_facts.php',\n\t\t\t 'lang' => pll_current_language('slug')\n\t\t\t //'hierarchical' => 0\n\t\t\t));\n\t\t\t//print_r($pages);\n\n\t\t\techo '<a href=\"'.get_permalink($pages[0]->ID).'\">';\n\t\t\tpll_e('Įdomūs faktai');\n\t\t\techo \"</a>\";\n\t\t} elseif(get_post_type() == 'tribe_events'){\n\t\t\t$url = $staticVars['eventsUrl'];\n\t\t\techo '<a href=\"'.$url.'\">'.pll__('Renginiai').'</a>';\n\t\t} elseif(get_post_type() == 'education-resource'){\n\t\t\t$url = $staticVars['educationResourceUrl'];\n\t\t\t$title = get_the_title(kcsite_getPageByTempate('education_list.php'));\n\t\t\techo '<a href=\"'.$url.'\">'.$title.'</a>';\n\t\t} elseif(get_post_type() == 'film'){\n $url = get_permalink($staticVars['filmRegisterSearchPageId']);\n $title = get_the_title($staticVars['filmRegisterSearchPageId']);\n echo '<a href=\"'.$url.'\">'.$title.'</a>';\n } elseif(get_post_type() == 'lithfilm'){\n\t\t\t$url = get_permalink($staticVars['lithuanianFilmsSearchPageId']);\n\t\t\t$title = get_the_title($staticVars['lithuanianFilmsSearchPageId']);\n\t\t\techo '<a href=\"'.$url.'\">'.$title.'</a>';\n\t\t}\n\t\techo $sep;\n\t\tthe_title();\n\n\t} elseif(!is_single() && get_post_type() == 'tribe_events'){ //event calendar view\n\t\tpll_e('Renginiai');\n\t} elseif ( is_page() && $post->post_parent ) {\n\t\t\n\t\t//checkiing home page is not needed, but dos make no difference, so left\n\t\t$home = get_page_by_title('home');\n\t\t//show all ancestors (parent pages)\n\t\tfor ($i = count($post->ancestors)-1; $i >= 0; $i--) {\n\t\t\tif (($home->ID) != ($post->ancestors[$i])) {\n\t\t\t\techo '<a href=\"';\n\t\t\t\techo get_permalink($post->ancestors[$i]); \n\t\t\t\techo '\">';\n\t\t\t\techo get_the_title($post->ancestors[$i]);\n\t\t\t\techo \"</a>\".$sep;\n\t\t\t}\n\t\t}\n\t\techo the_title();\n\t} elseif (is_page()) {\n\t\techo the_title();\n\t} elseif (is_404()) {\n\t\techo of_get_option_by_lang('kcsite_404_page_title');\n\t}\n}", "function get_uams_breadcrumbs()\n{\n\nglobal $post;\n$ancestors = array_reverse( get_post_ancestors( $post->ID ) );\n$html = '<li><a href=\"http://inside.uams.edu\" title=\"University of Arkansas for Medical Scineces\">Home</a></li>';\nif ( !is_main_site() )\n{\n$html .= '<li' . (is_front_page() ? ' class=\"current\"' : '') . '><a href=\"' . home_url('/') . '\" title=\"' . str_replace(' ', ' ', get_bloginfo('title')) . '\">' . str_replace(' ', ' ', get_bloginfo('title')) . '</a><li>';\n}\n\nif ( is_404() )\n{\n $html .= '<li class=\"current\"><span>Ooops!</span>';\n} else\n\nif ( is_search() )\n{\n $html .= '<li class=\"current\"><span>Search results for ' . get_search_query() . '</span>';\n} else\n\nif ( is_author() )\n{\n $author = get_queried_object();\n $html .= '<li class=\"current\"><span> Author: ' . $author->display_name . '</span>';\n} else\n\nif ( get_queried_object_id() === (Int) get_option('page_for_posts') ) {\n $html .= '<li class=\"current\"><span> '. get_the_title( get_queried_object_id() ) . ' </span>';\n}\n\n// If the current view is a post type other than page or attachment then the breadcrumbs will be taxonomies.\nif( is_category() || is_tax() || is_single() || is_post_type_archive() )\n{\n\n if ( is_post_type_archive() && !is_tax() )\n {\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_post_type_archive_link( $posttype->query_var ) .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n $html .= '<li class=\"current\"><span>'. $posttype->labels->menu_name . '</span>';\n }\n\n if ( is_category() )\n {\n $category = get_category( get_query_var( 'cat' ) );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. get_cat_name($category->term_id ) . '</span>';\n }\n\n if ( is_tax() && !is_post_type_archive() )\n {\n $term = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $tax = get_taxonomy( get_query_var(\"taxonomy\") );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->labels->name .': '. $term->name .'</span>';\n }\n\n if ( is_tax() && is_post_type_archive() )\n {\n $tax = get_term_by(\"slug\", get_query_var(\"term\"), get_query_var(\"taxonomy\") );\n $posttype = get_post_type_object( get_post_type() );\n //$html .= '<li class=\"current\"><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n $html .= '<li class=\"current\"><span>'. $tax->name . '</span>';\n }\n\n if ( is_single() )\n {\n if ( has_category() )\n {\n $thecat = get_the_category( $post->ID );\n $category = array_shift( $thecat ) ;\n $html .= '<li><a href=\"' . get_category_link( $category->term_id ) .'\" title=\"'. get_cat_name( $category->term_id ).'\">'. get_cat_name($category->term_id ) . '</a>';\n }\n if ( uams_is_custom_post_type() )\n {\n $posttype = get_post_type_object( get_post_type() );\n $archive_link = get_post_type_archive_link( $posttype->query_var );\n if (!empty($archive_link)) {\n $html .= '<li><a href=\"' . $archive_link .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n else if (!empty($posttype->rewrite['slug'])){\n $html .= '<li><a href=\"' . site_url('/' . $posttype->rewrite['slug'] . '/') .'\" title=\"'. $posttype->labels->menu_name .'\">'. $posttype->labels->menu_name . '</a>';\n }\n }\n $html .= '<li class=\"current\"><span>'. get_the_title( $post->ID ) . '</span>';\n }\n}\n\n// If the current view is a page then the breadcrumbs will be parent pages.\nelse if ( is_page() )\n{\n\n if ( ! is_home() || ! is_front_page() )\n $ancestors[] = $post->ID;\n\n if ( ! is_front_page() )\n {\n foreach ( array_filter( $ancestors ) as $index=>$ancestor )\n {\n $class = $index+1 == count($ancestors) ? ' class=\"current\" ' : '';\n $page = get_post( $ancestor );\n $url = get_permalink( $page->ID );\n $title_attr = esc_attr( $page->post_title );\n if (!empty($class)){\n $html .= \"<li $class><span>{$page->post_title}</span></li>\";\n }\n else {\n $html .= \"<li><a href=\\\"$url\\\" title=\\\"{$title_attr}\\\">{$page->post_title}</a></li>\";\n }\n }\n }\n\n}\n\nreturn \"<nav class='uams-breadcrumbs' aria-label='breadcrumbs'><ul>$html</ul></nav>\";\n}", "function dimox_breadcrumbs() {\n\n\t/* === OPTIONS === */\n\t$text['home'] = 'Home'; // text for the 'Home' link\n\t$text['category'] = 'Archive by Category \"%s\"'; // text for a category page\n\t$text['search'] = 'Search Results for \"%s\" Query'; // text for a search results page\n\t$text['tag'] = 'Posts Tagged \"%s\"'; // text for a tag page\n\t$text['author'] = 'Articles Posted by %s'; // text for an author page\n\t$text['404'] = 'Error 404'; // text for the 404 page\n\t$text['page'] = 'Page %s'; // text 'Page N'\n\t$text['cpage'] = 'Comment Page %s'; // text 'Comment Page N'\n\n\t$wrap_before = '<div class=\"breadcrumbs\">'; // the opening wrapper tag\n\t$wrap_after = '</div><!-- .breadcrumbs -->'; // the closing wrapper tag\n\t$sep = '>'; // separator between crumbs\n\t$sep_before = '<span class=\"sep\">'; // tag before separator\n\t$sep_after = '</span>'; // tag after separator\n\t$show_home_link = 1; // 1 - show the 'Home' link, 0 - don't show\n\t$show_on_home = 1; // 1 - show breadcrumbs on the homepage, 0 - don't show\n\t$show_current = 1; // 1 - show current page title, 0 - don't show\n\t$before = '<span class=\"current\">'; // tag before the current crumb\n\t$after = '</span>'; // tag after the current crumb\n\t/* === END OF OPTIONS === */\n\n\tglobal $post;\n\tglobal $pre_path;\n\t$home_link = 'https://www.nationalarchives.gov.uk/';\n\t$link_before = '<span itemprop=\"itemListElement\" itemscope itemtype=\"http://schema.org/ListItem\">';\n\t$link_after = '</span>';\n\t$link_attr = ' itemprop=\"url\"';\n\t$link_in_before = '<span itemprop=\"title\">';\n\t$link_in_after = '</span>';\n\t$link = $link_before . '<a href=\"%1$s\"' . $link_attr . '>' . $link_in_before . '%2$s' . $link_in_after . '</a>' . $link_after;\n\t$frontpage_id = get_option('page_on_front');\n\t$parent_id = $post->post_parent;\n\t$sep = ' ' . $sep_before . $sep . $sep_after . ' ';\n\n\tif (is_home() || is_front_page()) {\n\n\t\t// TNA additional breadcrumbs for front page\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\t$numItems = count($pre_crumbs);\n\t\t\t$i = 0;\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\tif (++$i === $numItems) {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span>'. $crumb_name . '</span> ';\n\t\t\t\t} else {\n\t\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tglobal $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_before . '<a href=\"' . $home_link . '\">' . $text['home'] . '</a>';\n\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\tif ($show_on_home) echo $wrap_after;\n\n\t} else {\n\n\t\t// TNA additional breadcrumbs\n\t\tglobal $pre_crumbs;\n\t\tif ( $pre_crumbs ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tforeach ($pre_crumbs as $crumb_name => $crumb_path) {\n\t\t\t\t$pre_crumbs_st .= ' <span class=\"sep\">&gt;</span> <span><a href=\"' . $crumb_path . '\">'. $crumb_name . '</a></span> ';\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_before;\n\n\t\tif ($show_home_link) echo sprintf($link, $home_link, $text['home']);\n\n\t\tif ( is_page() && !$parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_page() && $parent_id ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t$breadcrumbs = array();\n\t\t\t\twhile ($parent_id) {\n\t\t\t\t\t$page = get_page($parent_id);\n\t\t\t\t\tif ($parent_id != $frontpage_id) {\n\t\t\t\t\t\t$breadcrumbs[] = sprintf($link, str_replace(home_url(), $pre_path, get_permalink($page->ID)), get_the_title($page->ID));\n\t\t\t\t\t}\n\t\t\t\t\t$parent_id = $page->post_parent;\n\t\t\t\t}\n\t\t\t\t$breadcrumbs = array_reverse($breadcrumbs);\n\t\t\t\tfor ($i = 0; $i < count($breadcrumbs); $i++) {\n\t\t\t\t\techo $breadcrumbs[$i];\n\t\t\t\t\tif ($i != count($breadcrumbs)-1) echo $sep;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\n\t\t} elseif ( is_404() ) {\n\t\t\tglobal $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($show_home_link && $show_current) echo $sep;\n\t\t\tif ($show_current) echo $before . $text['404'] . $after;\n\n\t\t} elseif ( is_single() && !is_attachment() ) {\n\t\t\tglobal $pre_crumbs_st, $pre_crumbs_post;\n\t\t\tif ($pre_crumbs_st) echo $pre_crumbs_st;\n\t\t\tif ($pre_crumbs_post) echo $pre_crumbs_post;\n\t\t\tif ($show_home_link) echo $sep;\n\t\t\tif ( get_post_type() != 'post' ) {\n\t\t\t\t$post_type = get_post_type_object(get_post_type());\n\t\t\t\t$slug = $post_type->rewrite;\n\t\t\t\tprintf($link, $home_link . '/' . $slug['slug'] . '/', $post_type->labels->singular_name);\n\t\t\t\tif ($show_current) echo $sep . $before . get_the_title() . $after;\n\t\t\t} else {\n\t\t\t\t$cat = get_the_category(); $cat = $cat[0];\n\t\t\t\t$cats = get_category_parents($cat, TRUE, $sep);\n\t\t\t\tif (!$show_current || get_query_var('cpage')) $cats = preg_replace(\"#^(.+)$sep$#\", \"$1\", $cats);\n\t\t\t\t$cats = preg_replace('#<a([^>]+)>([^<]+)<\\/a>#', $link_before . '<a$1' . $link_attr .'>' . $link_in_before . '$2' . $link_in_after .'</a>' . $link_after, $cats);\n\t\t\t\t/*echo $cats;*/\n\t\t\t\tif ( get_query_var('cpage') ) {\n\t\t\t\t\techo $sep . sprintf($link, str_replace(home_url(), $pre_path, get_permalink()), get_the_title()) . $sep . $before . sprintf($text['cpage'], get_query_var('cpage')) . $after;\n\t\t\t\t} else {\n\t\t\t\t\tif ($show_current) echo $before . get_the_title() . $after;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\techo $wrap_after;\n\n\t}\n}", "function susy_breadcrumb($vars) {\n\n $breadcrumb = isset($vars['breadcrumb']) ? $vars['breadcrumb'] : array();\n\n if (theme_get_setting('susy_breadcrumb_hideonlyfront')) {\n $condition = count($breadcrumb) > 1;\n } else {\n $condition = !empty($breadcrumb);\n }\n\n if(theme_get_setting('susy_breadcrumb_showtitle')) {\n $title = drupal_get_title();\n if(!empty($title)) {\n $condition = true;\n $breadcrumb[] = $title;\n }\n }\n\n $separator = theme_get_setting('susy_breadcrumb_separator');\n\n if (!$separator) {\n $separator = '»';\n }\n\n if ($condition) {\n return implode(\" {$separator} \", $breadcrumb);\n }\n}", "function wordpress_crumbs() {\n\t\t\n\t\t// Setup empty trail\n\t\t$trail \t= array();\n\t\t\n\t\t// Get some info\n\t\t$apoc \t\t= apocrypha();\n\t\t$post\t\t= $apoc->queried_object;\n\t\t$post_id\t= $apoc->queried_id;\n\t\tif ( isset( $post ) ) {\n\t\t\t$post_type \t= isset( $post->post_type ) ? $post->post_type : NULL;\n\t\t\t$parent \t= isset( $post->post_parent ) ? absint( $post->post_parent ) : NULL;\n\t\t}\n\n\t\t// Singular Views\n\t\tif ( is_singular() ) :\n\t\t\tswitch( $post_type ) {\n\t\t\t\n\t\t\t\t// Single Posts \n\t\t\t\tcase 'post' :\n\t\t\t\t\n\t\t\t\t\t// Is the post in a category?\n\t\t\t\t\t$categories = get_the_category( $post_id );\n\t\t\t\t\tif ( $categories ) :\n\t\t\t\t\t\n\t\t\t\t\t\t// Just do the first category\n\t\t\t\t\t\t$term = $categories[0];\n\t\t\t\t\n\t\t\t\t\t\t// If the category has a parent, add it to the trail. \n\t\t\t\t\t\tif ( 0 != $term->parent ) \n\t\t\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $term->parent, 'category' ) );\n\n\t\t\t\t\t\t// Add the category archive link to the trail. \n\t\t\t\t\t\t$trail[] = '<a href=\"' . get_term_link( $term ) . '\" title=\"' . esc_attr( $term->name ) . '\">' . $term->name . '</a>';\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\t\t// Does the post have an ancestor?\n\t\t\t\t\tif ( 0 != $parent ) \n\t\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $parent ) );\n\t\t\t\t\t\n\t\t\t\t\t// Editing a comment on this post\n\t\t\t\t\tif ( is_comment_edit() ) :\n\t\t\t\t\t\t$trail[] = '<a href=\"' . get_permalink() . '\" title=\"Return to article\">' . $post->post_title . '</a>';\n\t\t\t\t\t\t$trail[] = 'Edit Comment';\n\t\t\t\t\t\n\t\t\t\t\t// Reading the post\n\t\t\t\t\telse :\n\t\t\t\t\t\t$trail[] = $post->post_title;\n\t\t\t\t\tendif; \n\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t// Single Pages \n\t\t\t\tcase 'page' :\n\t\t\t\t\t\n\t\t\t\t\t// If the page has ancestor pages\n\t\t\t\t\tif ( 0 != $parent ) \n\t\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $parent ) );\n\t\t\t\t\t\n\t\t\t\t\t// Otherwise, viewing the page\n\t\t\t\t\t$trail[] = $post->post_title;\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t// Single Calendar Event \n\t\t\t\tcase 'event' :\n\t\t\t\t\t\n\t\t\t\t\t// I need to rewrite this\n\t\t\t\t\tglobal $allowed_calendar;\n\t\t\t\t\tif ( is_group_calendar( $allowed_calendar->term_id ) ) :\n\t\t\t\t\t\t$group_url = ( 'entropy-rising' == $allowed_calendar->slug ) ? SITEURL . '/entropy-rising/' : SITEURL . '/groups/' . trailingslashit( $slug );\n\t\t\t\t\t\t$trail[] = '<a href=\"'. $group_url .'\" title=\"'. $allowed_calendar->name . ' Guild Page\">'. $allowed_calendar->name .'</a>';\n\t\t\t\t\tendif;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t$trail[] = '<a href=\"'. SITEURL . '/calendar/' . $allowed_calendar->slug . '/\" title=\"'. $allowed_calendar->name . ' Calendar\">Calendar</a>';\n\t\t\t\t\t$trail[] = $post->post_title;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t// Archive Pages\n\t\telseif ( is_archive() ) :\n\t\t\n\t\t\t// Category Archives\n\t\t\tif ( is_category() ) :\n\t\t\t\t$trail[] = 'Categories';\n\n\t\t\t\t// If the category has a parent, add it to the trail. \n\t\t\t\tif ( $post->parent != 0 ) \n\t\t\t\t\t$trail = array_merge( $trail, $this->trail_parents( $post->parent ) );\n\t\t\t\t\n\t\t\t\t// Finish up with the term name\n\t\t\t\t$trail[] = $post->name;\n\t\t\t\n\t\t\t// Author Archive \n\t\t\telseif ( is_author() ) :\n\t\t\t\t$trail[] = 'Authors';\n\t\t\t\t$trail[] = get_the_author_meta( 'display_name', get_query_var( 'author' ) );\n\t\t\t\n\t\t\t\n\t\t\t// Calendar Archive \n\t\t\telseif ( is_calendar() ) :\n\t\t\t\n\t\t\t\t// Is it a group calendar? \n\t\t\t\t$term_id \t= $post->term_id;\n\t\t\t\tif( is_group_calendar( $term_id ) ) :\n\n\t\t\t\t\t// Get the group\n\t\t\t\t\t$slug\t\t= $post->slug;\n\t\t\t\t\t$group_id\t= groups_get_id( $slug );\t\t\n\t\t\t\t\tif ( 'entropy-rising' == $slug ) :\n\t\t\t\t\t\t$trail[] = '<a href=\"'. home_url() . '/entropy-rising/\">Entropy Rising</a>';\n\t\t\t\t\telse :\n\t\t\t\t\t\t$group = groups_get_group( array( 'group_id' => $group_id ) );\n\t\t\t\t\t\t$trail[] = '<a href=\"'. bp_get_groups_directory_permalink() .'\">Guilds</a>';\n\t\t\t\t\t\t$trail[] = '<a href=\"'. bp_get_groups_directory_permalink() . $slug .'\" title=\"'. $group->name . '\">'. $group->name . '</a>';\n\t\t\t\t\tendif;\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\t\t// Otherwise just a standalone calendar\n\t\t\t\t$trail[] = 'Calendar';\n\t\t\tendif;\n\t\t\n\t\t// Search Results\n\t\telseif ( is_search() ) :\n\t\t\t$trail[] = 'Search Results';\n\t\telseif ( is_adv_search() ) :\n\t\t\t$trail[] = 'Advanced Search';\n\t\t\t\n\t\t// Interactive Map\n\t\telseif ( is_interactive_map() ) :\n\t\t\t$trail[] = 'Interactive Map';\n\t\t\t\n\t\t// Page Not Found\n\t\telseif ( is_404() ) : \n\t\t\t$trail[] = '404 Page Not Found';\t\t\n\t\tendif;\n\t\t\t\t\t\n\t\t// Return the trail\n\t\treturn $trail;\t\t\n\t}", "public function breadcrumbs()\n {\n $crumbs = Collection::make(explode(\n DIRECTORY_SEPARATOR, $this->getCurrentPath()\n ));\n\n return $crumbs->reject(function ($crumb) {\n return empty($crumb) || is_null($crumb);\n })->map(function ($crumb, $i) use ($crumbs) {\n $parents = array_slice($crumbs->toArray(), 0, $i);\n $url = implode(DIRECTORY_SEPARATOR, $parents).DIRECTORY_SEPARATOR.$crumb;\n $file = $this->file($this->rootPath($url));\n\n return json_decode(json_encode([\n 'text' => $crumb,\n 'url' => $file->fragment(),\n ]));\n });\n }", "public function setBreadcrumb($value)\n {\n $this->breadcrumb = $value;\n }", "function Forum_getForumBreadcrumbs(&$PAGEDATA, &$id) {\n\t$f=dbRow('select name,parent_id from forums where id='.$id);\n\t$c='&raquo; <a href=\"'.$PAGEDATA->getRelativeUrl().'?forum-f='.$id\n\t\t.'\">'.htmlspecialchars($f['name']).'</a>';\n\tif ($f['parent_id']) {\n\t\t$c=Forum_getForumBreadcrumbs($PAGEDATA, $f['parent_id']).' '.$c;\n\t}\n\treturn $c;\n}", "function breadcrumbs(){\n global $post;\n $seperator = \"/\";\n $home = \"Home\";\n \n echo \"<ul class='breadcrumbs'>\";\n echo \"<li>You are here: </li>\";\n \n if(is_front_page()){\n echo \"<li>\" . $home . \"</li>\";\n }else{\n echo \"<li><a href=\" . get_site_url() . \">\" . $home . \"</a></li>\";\n }\n \n if(is_home() || is_single()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(is_home()){\n echo \"<li>Recipe</li>\";\n }else {\n echo \"<li><a href=\" . get_post_type_archive_link('post') . \">Shop</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n }\n \n if(is_page() && !is_front_page()){\n echo \"<li>\" . $seperator . \"</li>\";\n if(!empty($post->post_parent)){\n echo \"<li>\";\n echo \"<a href=\" . get_permalink($post->post_parent). \">\";\n echo get_the_title($post->post_parent);\n echo \"</a></li>\";\n echo \"<li>\" . $seperator . \"</li>\";\n }\n echo \"<li>\" . $post->post_title . \"</li>\";\n }\n \n echo \"</ul>\";\n }", "function faculty_settings_breadcrumb() { \n faculty_setting_line(faculty_add_color_setting('breadcrumb_font_color', __('Font Color', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_size_setting('breadcrumb_font_size', __('Font Size', FACULTY_DOMAIN)));\n faculty_setting_line(faculty_add_select_setting('breadcrumb_text_transform', __('Text Transform', FACULTY_DOMAIN), 'transform'));\n faculty_setting_line(faculty_add_border_setting('breadcrumb_border', __('Bottom Border', FACULTY_DOMAIN)));\n do_action('faculty_settings_breadcrumb');\n}", "function getBreadcrumbs($dir)\r\n{\r\n\tglobal $root, $bcI, $m3u, $debug, $playMode;\r\n\t// Find last slash in root dir\r\n\t$lastslash = getLastSlash(getDirectory($root));\r\n\t// Treat that the as the home directory\r\n\t$start = substr($dir,$lastslash);\r\n\t// Get the list of subdirectories in the home directory\r\n\t$directories = explode('/',$start);\r\n\t// Count the list of subdirectories\r\n\t$count = count($directories);\r\n\t$breadcrumbs = '<ol class=\"breadcrumb\">';\r\n\t// Global $bcI is called later in displayDirectories() to determine depth of directories\r\n\t$bcI = 0;\r\n\t$path = '';\r\n\tforeach ( $directories as $directory )\r\n\t{\r\n\t\t// Only count actual directories\r\n\t\tif ( !empty($directory) )\r\n\t\t{\r\n\t\t\t$path = '?dir='.rawurlencode(substr($dir,0,strpos($dir,$directory)+strlen($directory)));\r\n\t\t\tif ( !empty($debug) )\r\n\t\t\t{\r\n\t\t\t\t$path .= '&debug=log';\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Make breadcrumb links for all directories\r\n\t\t$breadcrumbs .= '<li><a href=\"'.$path.'\" title=\"Return to this directory\">'.$directory.'</a>';\r\n\t\t// Add a play all tracks link if this is the current directory\r\n\t\tif ( $bcI == $count-1 && $playMode!='random' )\r\n\t\t{\r\n\t\t\t// Add a play all tracks button if there are playable tracks in this directory\r\n\t\t\t$count = getTracksCount($dir);\r\n\t\t\tif ( $count > 0 )\r\n\t\t\t{\r\n\t\t\t\t$breadcrumbs .= '&nbsp;&nbsp;/&nbsp;&nbsp;<a href=\"?dir='.rawurlencode($dir).'&playmode=folder';\r\n\t\t\t\tif ( !empty($debug) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$breadcrumbs .= '&debug=log';\r\n\t\t\t\t}\r\n\t\t\t\t$breadcrumbs .= '\" title=\"Play all tracks in this folder\"><span class=\"glyphicon glyphicon-play\"></span></a>';\r\n\t\t\t\t// If m3u streaming is enabled, add a stream all tracks button as well\r\n\t\t\t\tif ( $m3u==true )\r\n\t\t\t\t{\r\n\t\t\t\t\t$breadcrumbs .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href=\"playlist.php?dir='.rawurlencode($dir).'\" title=\"Stream all tracks in this folder (m3u)\" target=\"_blank\"><span class=\"glyphicon glyphicon-list\"></span></a>';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$breadcrumbs .= '</li>';\r\n\t\t$bcI++;\r\n\t}\r\n\tif ( $playMode == 'random' )\r\n\t{\r\n\t\t$breadcrumbs .= '<li>Random Playlist</li>';\r\n\t}\r\n\t$breadcrumbs .= '</ol>';\r\n\tif ( !empty($debug) )\r\n\t{\r\n\t\t$log = \"getBreadcrumbs(\".$dir.\")\\n----------\\n\";\r\n\t\t$log .= \"breadcrumbs = \".$breadcrumbs.\"\\n\\n\";\r\n\t\tdebugLog($log);\r\n\t}\r\n\treturn $breadcrumbs;\r\n}", "protected static function set_breadcrumb($args) {\n if (!empty($args['redirect_on_success']) && function_exists('hostsite_set_breadcrumb')) {\n $breadcrumb = [$args['redirect_on_success'] => 'Terms'];\n hostsite_set_breadcrumb($breadcrumb);\n }\n }", "function minorite_breadcrumb($variables) {\n $breadcrumb = $variables['breadcrumb'];\n\n if (!empty($breadcrumb)) {\n return '<ul class=\"nav\"><li>' . implode('</li><li>', $breadcrumb) . '</li></ul>';\n }\n}", "function thumbwhere_host_set_breadcrumb() {\n $breadcrumb = array(\n l(t('Home'), '<front>'),\n l(t('Administration'), 'admin'),\n l(t('Host'), 'admin/content'),\n l(t('Host'), 'admin/thumbwhere/thumbwhere_hosts'),\n );\n\n drupal_set_breadcrumb($breadcrumb);\n}", "private static function generateBreadCrumb($xml){\n\n if( empty($xml) ) return null;\n\n //Get controller\n $r['controller'] = (string)$xml->attributes()->title;\n\n $xml = $xml->children();\n if( empty($xml) ) return null;\n\n if( isset($xml->{App::$actionId}) ) $r['action'] = $xml->{App::$actionId}->attributes()->title; else return null;\n\n if( isset($_REQUEST['op']) && isset($xml->{App::$actionId}->{$_REQUEST['op']}) ) $r['op'] = $xml->{App::$actionId}->{$_REQUEST['op']}->attributes()->title;\n\n return $r;\n }", "public function getBreadCrumb()\n {\n $result = [];\n $current = $this->getCurrent();\n while (!\\is_null($current)) {\n array_unshift($result, $current);\n $current = $current->getParent();\n }\n\n return $result;\n }", "function the_breadcrumb() {\r\n\tif (!is_home()) {\r\n\t\techo '<div class=\"breadcrumb\"><a href=\"';\r\n\t\techo get_option('home');\r\n\t\techo '\">'.__('Home','templatic');\r\n\t\techo \"</a>\";\r\n\t\tif (is_category() || is_single() || is_archive()) {\r\n\t\t\tthe_category('title_li=');\r\n\t\t\tif(is_archive())\r\n\t\t\t{\t\t\r\n\t\t\t\techo \" » \";\r\n\t\t\t\tsingle_cat_title();\r\n\t\t\t}\r\n\t\t\tif (is_single()) {\r\n\t\t\t\techo \" » \";\r\n\t\t\t\tthe_title();\r\n\t\t\t}\r\n\t\t} elseif (is_page()) {\r\n\t\t\techo the_title();\r\n\t\t}\t\t\r\n\t\techo \"</div>\";\r\n\t}\t\r\n}", "protected function build_breadcrumb($path) {\n $bread = explode('/', $path);\n $crumbtrail = '';\n foreach ($bread as $crumb) {\n list($id, $name) = $this->explode_node_path($crumb);\n $name = empty($name) ? $id : $name;\n $breadcrumb[] = array(\n 'name' => $name,\n 'path' => $this->build_node_path($id, $name, $crumbtrail)\n );\n $tmp = end($breadcrumb);\n $crumbtrail = $tmp['path'];\n }\n return $breadcrumb;\n }" ]
[ "0.7252127", "0.7116681", "0.6937708", "0.69226134", "0.68615043", "0.65947783", "0.65347284", "0.65316415", "0.6522476", "0.6493446", "0.6475859", "0.64318067", "0.6387936", "0.6372058", "0.63607204", "0.634375", "0.6342324", "0.63270503", "0.6301878", "0.6297311", "0.62950444", "0.6288761", "0.6256162", "0.62450945", "0.6243928", "0.6226161", "0.6214614", "0.6210841", "0.6193893", "0.6182508", "0.6167731", "0.61580586", "0.61342645", "0.6133324", "0.61273", "0.6117806", "0.6110003", "0.6102213", "0.6078592", "0.60771286", "0.60764575", "0.6069616", "0.60684246", "0.60576886", "0.6046893", "0.604556", "0.6023731", "0.6021734", "0.6021045", "0.6017407", "0.6017407", "0.6015181", "0.6006639", "0.600427", "0.6004211", "0.6003388", "0.60017157", "0.5985922", "0.5973785", "0.5971634", "0.59695256", "0.5966034", "0.5962354", "0.59504586", "0.5948942", "0.5945679", "0.5942465", "0.5929315", "0.5910524", "0.5908922", "0.5907771", "0.5907736", "0.5884347", "0.58802664", "0.58781964", "0.58737534", "0.587147", "0.5867731", "0.58626676", "0.5861986", "0.58575886", "0.5855512", "0.58532333", "0.58467823", "0.5846171", "0.5837432", "0.58364964", "0.5829372", "0.58247834", "0.5817226", "0.5805155", "0.580208", "0.57983464", "0.57754296", "0.5775349", "0.5768256", "0.57618964", "0.57562786", "0.5752141", "0.5748355" ]
0.66378415
5
Method to parse tree
protected function &_processTree(array &$tree, array &$root) { try { foreach($tree as $index => $subtree) { if(isset($tree[$index]['@attributes']) && is_array($tree[$index]['@attributes'])) { foreach($tree[$index]['@attributes'] as $key => $value) { $tree[$index][$key] = $value; } unset($tree[$index]['@attributes']); } $tree[$index]['slug'] = (isset($tree[$index]['slug'])) ? \Glue\Helper\Modifier::sluggify($tree[$index]['slug']) : \Glue\Helper\Modifier::sluggify($tree[$index]['title']); $pointer =& $tree[$index]; while(isset($pointer['parent'])) { $pointer = &$pointer['parent']; $tree[$index]['node'] = $pointer['node'] . '/' . $tree[$index]['node']; $tree[$index]['slug'] = $pointer['slug'] . '/' . $tree[$index]['slug']; } $tree[$index]['alias'] = str_replace('/', '.', $tree[$index]['node']); $tree[$index]['visible'] = (!isset($subtree['@attributes']['visible']) || !is_bool($subtree['@attributes']['visible'])) ? true : $subtree['@attributes']['visible']; $tree[$index]['state'] = 0; $tree[$index]['custom'] = array(); $root['nodelist'][$tree[$index]['slug']] =& $tree[$index]; if(isset($subtree['custom'])) { if(isset($subtree['custom']['@attributes']) && is_array($subtree['custom']['@attributes'])) { foreach($subtree['custom']['@attributes'] as $key => $value) { $subtree['custom'][$key] = $value; } unset($subtree['custom']['@attributes']); } $tree[$index]['custom'] = $subtree['custom']; } if(isset($subtree['childnodes']) && is_array($subtree['childnodes']) && count($subtree['childnodes']) > 0) { if(!isset($subtree['childnodes'][0])) { $tree[$index]['childnodes'] = array($tree[$index]['childnodes']); } foreach($tree[$index]['childnodes'] as $index2 => $subtree2) { $tree[$index]['childnodes'][$index2]['parent'] =& $tree[$index]; } $tree[$index]['childnodes'] =& $this->_processTree($tree[$index]['childnodes'], $root); } } return $tree; } catch(\Exception $exception) { throw new \RuntimeException(\Glue\Helper\General::replace(array('method' => __METHOD__), GLUE_EXCEPTION_METHOD_FAILED), NULL, $exception); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function parse()\n {\n $this->parseChildrenNodes($this->_dom, $this->_rootNode);\n }", "static public function parseTree($tree)\n\t{\n\t\t$rtree=array();\n\t\tforeach ($tree as $node)\n\t\t\t$rtree[$node['id']]=isset($node['children'])? self::parseTree($node['children']) : null;\n\t\treturn $rtree;\n\t}", "protected function parse() {}", "protected function _tree($array) {\n\n\t\t\t$root = array(\n\t\t\t\t'children' => array()\n\t\t\t);\n\t\t\t$current = &$root;\n\n\t\t\tforeach ($array as $i => $node) {\n\n\t\t\t\t$result = $this->_tag($node);\n\t\t\t\t\n\t\t\t\tif ($result) {\n\t\t\t\t\t\n\t\t\t\t\tif (isset($result['tag'])) {\n\t\t\t\t\t\t$tag = $result['tag'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$tag = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isset($result['arguments'])) {\n\t\t\t\t\t\t$arguments = $result['arguments'];\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$arguments = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tif ($tag) {\n\t\t\t\t\t\t// If segment does not contain a closer\n\t\t\t\t\t\tif (!$result['closer']) {\n\t\t\t\t\t\t\t// clean up syntax if segment is isolated and \n\t\t\t\t\t\t\t// preceded by an plain text segment\n\t\t\t\t\t\t\t$last = ArrayMethods::last($current['children']);\n\t\t\t\t\t\t\tif ($result['isolated'] && is_string($last)) {\n\t\t\t\t\t\t\t\tarray_pop($current['children']);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t$current = &$current['children'][count($current['children']) - 1];\n\t\t\t\t\t\t} else if (isset($current['tag']) && $result['tag'] == $current['tag']) {\n\t\t\t\t\t\t\t$start = $current['index'] + 1;\n\t\t\t\t\t\t\t$length = $i - $start;\n\t\t\t\t\t\t\t$current['source'] = implode(array_slice($array, $start, $length));\n\t\t\t\t\t\t\t$current = &$current['parent'];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$current['children'][] = array(\n\t\t\t\t\t\t\t'index' => $i,\n\t\t\t\t\t\t\t'parent' => &$current,\n\t\t\t\t\t\t\t'children' => array(),\n\t\t\t\t\t\t\t'raw' => $result['source'],\n\t\t\t\t\t\t\t'tag' => $tag,\n\t\t\t\t\t\t\t'arguments' => $arguments,\n\t\t\t\t\t\t\t'delimiter' => $result['delimiter'],\n\t\t\t\t\t\t\t'number' => count($current['children'])\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$current['children'][] = $node;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $root;\n\t\t}", "public function parse();", "public function parse();", "public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse ();", "function _calculateTree() {\n include_once(\"bitlib/SQL/Tree.php\");\n include_once(\"bitlib/functions/common.php\");\n $db = common::getDB($GLOBALS[\"BX_config\"][\"dsn\"]);\n $t = new SQL_Tree($db);\n $t->FullPath=\"fulluri\";\n $t->Path=\"uri\";\n $t->FullTitlePath=\"fulltitlepath\";\n $t->Title=\"title_de\";\n \n $t->importTree(1);\n }", "public function parse()\n {\n $root = new SyntaxTreeNode('root');\n $nsMapping = new SyntaxTreeNode('nsMappings');\n $nodeTypes = new SyntaxTreeNode('nodeTypes');\n $root->addChild($nsMapping);\n $root->addChild($nodeTypes);\n\n while (!$this->tokenQueue->isEof()) {\n\n $this->debugSection('PARSER CYCLE');\n\n while ($this->checkToken(Token::TK_SYMBOL, '<')) {\n $nsMapping->addChild($this->parseNamespaceMapping());\n }\n\n if (!$this->tokenQueue->isEof()) {\n $nodeTypes->addChild($this->parseNodeTypeDef());\n }\n\n }\n\n return $root;\n }", "protected function loadTreeData() {}", "public function parse()\n\t{\n\t\t$this->parseGroups();\n\t\t$this->parseBadges();\n\t}", "public function parse()\n {\n $parts = explode( '/', $this->url);\n \n $hold = array();\n \n for( $i = 0; $i < count($parts); $i += 2){\n\t $hold[ $parts[$i] ] = $parts[ $i+1 ];\n }\n $this->nodes = $hold;\n \n }", "private function build_tree()\n\t\t{\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul_first\" onkeydown=\"return input_main_key(event,\\''.$this->internal_id.'\\')\">';\n\n\t\t\t//==================================================================\n\t\t\t// Always first this row in tree ( edit mode only )\n\t\t\t//==================================================================\n\t\t\tif ($this->edit_mode)\n\t\t\t{\n\t\t\t\t$this->html_result .= '<div class=\"'.$this->style.'_interow\" id=\"'.$this->internal_id.'INT_0\" OnClick=\"add_new_node(\\''.$this->internal_id.'\\',0)\"></div>';\n\t\t\t}\n\t\t\t//==================================================================\n\t\t\t\n\t\t\t$this->scan_level(0,$this->get_any_child(1));\n\n\t\t\t$this->html_result .= '<ul class=\"'.$this->style.'_ul\">';\n\t\t}", "public function parse(): array\n {\n $this->parseElement();\n $this->parseChildNodes();\n\n return ['dir' => $this->dir,\n 'includes' => $this->includes,\n 'excludes' => $this->excludes];\n }", "function _postProcess() {\r\n $item = current($this->_struct);\r\n \r\n $ret = array('_name'=>$item['tag'], '_attributes'=>array(), '_value'=>null);\r\n\r\n if (isset($item['attributes']) && count($item['attributes'])>0) {\r\n foreach ($item['attributes'] as $key => $data) {\r\n if (!is_null($data)) {\r\n $item['attributes'][$key] = str_replace($this->_replaceWith, $this->_replace, $item['attributes'][$key]);\r\n }\r\n }\r\n $ret['_attributes'] = $item['attributes'];\r\n if ($this->attributesDirectlyUnderParent)\r\n $ret = array_merge($ret, $item['attributes']);\r\n }\r\n\r\n if (isset($item['value']) && $item['value'] != null)\r\n $item['value'] = str_replace($this->_replaceWith, $this->_replace, $item['value']);\r\n \r\n switch ($item['type']) {\r\n case 'open':\r\n $children = array();\r\n while (($child = next($this->_struct)) !== FALSE ) {\r\n if ($child['level'] <= $item['level'])\r\n break;\r\n \r\n $subItem = $this->_postProcess();\r\n \r\n if (isset($subItem['_name'])) {\r\n if (!isset($children[$subItem['_name']]))\r\n $children[$subItem['_name']] = array();\r\n \r\n $children[$subItem['_name']][] = $subItem;\r\n }\r\n else {\r\n foreach ($subItem as $key=>$value) {\r\n if (isset($children[$key])) {\r\n if (is_array($children[$key]))\r\n $children[$key][] = $value;\r\n else\r\n $children[$key] = array($children[$key], $value);\r\n }\r\n else {\r\n $children[$key] = $value;\r\n }\r\n }\r\n }\r\n }\r\n \r\n if ($this->childTagsDirectlyUnderParent)\r\n $ret = array_merge($ret, $this->_condenseArray($children));\r\n else\r\n $ret['_value'] = $this->_condenseArray($children);\r\n \r\n break;\r\n case 'close':\r\n break;\r\n case 'complete':\r\n if (count($ret['_attributes']) > 0) {\r\n if (isset($item['value']))\r\n $ret['_value'] = $item['value'];\r\n }\r\n else {\r\n\t\t\tif (isset($item['value'])) {\r\n\t\t\t\t$ret = array($item['tag']=> $item['value']);\r\n\t\t\t} else {\r\n\t\t\t\t$ret = array($item['tag']=> \"\");\r\n\t\t\t}\r\n }\r\n break;\r\n }\r\n\r\n //added by Dan Coulter\r\n\r\n \r\n /*\r\n foreach ($ret as $key => $data) {\r\n if (!is_null($data) && !is_array($data)) {\r\n $ret[$key] = str_replace($this->_replaceWith, $this->_replace, $ret[$key]);\r\n }\r\n }\r\n */\r\n return $ret;\r\n }", "public function parse()\n {\n // turn the url into an array by nodes\n $this->nodes = explode('/', $this->url);\n \n // slide the controller off the first element\n $this->controller = array_shift($this->nodes);\n\t // break the path apart into its segments\n\t // controller - params ( node will always be empty for restful urls )\n\t //@list( , $this->nodes ) = explode( '/', $this->url, 2 );\n\t\n\t // add params to the to the params array\n/*\n\t if ( !empty( $params ) ) {\n\t \n\t // break apart the params\n\t $params = explode( '/', $params );\n\t\n\t for ( $i = 0; $i < count( $params ); $i++ ) {\n\t $this->params[] = str_replace( KEYWORD_SEPARATOR, ' ', $params[$i]);\n\t }\n\t }\n*/\n \n \n }", "abstract protected function parse($data);", "private function parseParents(): void\n {\n $key1 = $this->tokens->keyByOrdinal(0);\n $key2 = $this->tokens->findFirstToken('{');\n $tokens = $this->tokens->slice($key1, $key2);\n\n $weight = 0;\n $this->parseParentsExtends($tokens, $weight);\n $this->parseParentsInterfaces($tokens, $weight);\n $this->parseParentsTraits($weight);\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function parse()\n {\n }", "public function getTreeSource();", "public function parse()\n {\n }", "protected function _tree($array)\n {\n $root = [\n \"children\" => []\n ];\n $current =& $root;\n\n foreach ($array as $i => $node) {\n $result = $this->_tag($node);\n\n if ($result) {\n $tag = $result[\"tag\"] ?? \"\";\n $arguments = $result[\"arguments\"] ?? \"\";\n\n if ($tag) {\n if (!$result[\"closer\"]) {\n $last = ArrayMethods::last($current[\"children\"]);\n\n if ($result[\"isolated\"] && is_string($last)) {\n array_pop($current[\"children\"]);\n }\n\n $current[\"children\"][] = [\n \"index\" => $i,\n \"parent\" => &$current,\n \"children\" => [],\n \"raw\" => $result[\"source\"],\n \"tag\" => $tag,\n \"arguments\" => $arguments,\n \"delimiter\" => $result[\"delimiter\"],\n \"number\" => sizeof($current[\"children\"])\n ];\n $current =& $current[\"children\"][sizeof($current[\"children\"]) - 1];\n }\n elseif (isset($current[\"tag\"]) && $result[\"tag\"] == $current[\"tag\"]) {\n $start = $current[\"index\"] + 1;\n $length = $i - $start;\n $current[\"source\"] = implode(\" \", array_slice($array, $start, $length));\n $current =& $current[\"parent\"];\n }\n } else {\n $current[\"children\"][] = [\n \"index\" => $i,\n \"parent\" => &$current,\n \"children\" => [],\n \"raw\" => $result[\"source\"],\n \"tag\" => $tag,\n \"arguments\" => $arguments,\n \"delimiter\" => $result[\"delimiter\"],\n \"number\" => sizeof($current[\"children\"])\n ];\n }\n } else {\n $current[\"children\"][] = $node;\n }\n }\n\n return $root;\n }", "public function initializeTreeData() {}", "public function initializeTreeData() {}", "public function getTrees() {}", "public function parse()\n {\n // TODO: Implement parse() method.\n }", "public function parse()\n {\n $this->initProps();\n $this->initParams();\n $this->load();\n }", "public function parse( $contents );", "function transform ($node, $left2 = -1, $lvl = 0)\n\t{ \n\t\tstatic $left;\n\t\t\n\t\t// set depth\n\t\t$lvl++;\n\n\t\t// start value given from outside?\n\t\tif ($left2 > 0) {\n\t\t\t$left = $left2;\n\t\t} \n\t\t// set default value 1 if no value given\n\t\tif (!$left) {\n\t\t\t$left = 1;\n\t\t} \n\n\t\t$node2 = (array)$node;\n\t\t\n\t\t// init structure data\n\t\t// provides additional information about document structure\n\t\t// bitwise:\n\t\t// 1: has attributes\n\t\t// 2: has text element \n\t\t$this->tree[$node2[0]][\"struct\"] = 0;\n\n\t\tif ($parent = $node->parent_node()) {\n\t\t\t$parent = (array)$parent;\n\t\t} \n\n\t\tif ($first = $node->first_child())\n\t\t{\n\t\t\t$first = (array)$first;\n\t\t} \n\n\t\tif ($prev = $node->previous_sibling()) {\n\t\t\t$prev = (array)$prev;\n\t\t} \n\n\t\tif ($next = $node->next_sibling()) {\n\t\t\t$next = (array)$next;\n\t\t} \n\n\t\t$this->tree[$node2[0]][\"content\"] = trim($node->node_value());\n\t\t$this->tree[$node2[0]][\"name\"] = $node->node_name();\n\t\t$this->tree[$node2[0]][\"type\"] = $node->type;\n\t\t$this->tree[$node2[0]][\"depth\"] = $lvl;\n\t\t$this->tree[$node2[0]][\"parent\"] = $parent[0];\n\t\t$this->tree[$node2[0]][\"first\"] = $first[0];\n\t\t$this->tree[$node2[0]][\"prev\"] = $prev[0];\n\t\t$this->tree[$node2[0]][\"next\"] = $next[0];\n\t\t$this->tree[$node2[0]][\"left\"] = $left;\n\t\t$left++;\n\n\t\t// write attributes to sub-array\n\t\tif ($node->has_attributes())\n\t\t{\n\t\t\t$data = \"\";\n\t\t\t\n\t\t\tforeach ($node->attributes() as $attribute)\n\t\t\t{\n\t\t\t\t$data[$attribute->name] = $attribute->value;\n\t\t\t}\n\n\t\t\t$this->tree[$node2[0]][\"attr_list\"] = $data;\n\t\t\t$this->tree[$node2[0]][\"struct\"] += 1;\n\t\t}\n\n\t\t// check if one child is a text_node\n\t\tforeach ($node->child_nodes() as $child)\n\t\t{\n\t\t\tif ($child->node_type() == XML_TEXT_NODE)\n\t\t\t{\n\t\t\t\t$this->tree[$node2[0]][\"struct\"] += 2;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// recursive call\n\t\t// please don't merge this loop with the one above together! \n\t\tforeach ($node->child_nodes() as $child)\n\t\t{\n\t\t\t$this->transform($child, $left, $lvl);\n\t\t}\n\t\t\n\t\t$this->tree[$node2[0]][\"right\"] = $left;\n\t\t$left++;\n\t}", "public function parse($data);", "public function parse($data);", "public function parse($data);", "protected function parse()\n {\n if($this->isRelationalKey()){\n $this->parsedValue = $this->makeRelationInstruction();\n } \n else {\n $this->parsedValue = $this->parseFlatValue($this->value);\n } \n }", "private function parse_directory_tree()\r\n {\r\n foreach ($this->tc_step_data_list as $tc_index => $testcase_node)\r\n {\r\n $first_level = $testcase_node->get_first_level();\r\n $first_id = null;\r\n $second_level = $testcase_node->get_second_level();\r\n $second_id = null;\r\n $third_level = $testcase_node->get_third_level();\r\n $third_id = null;\r\n $fourth_level = $testcase_node->get_fourth_level();\r\n $fourth_id = null;\r\n $fifth_level = $testcase_node->get_fifth_level();\r\n $fifth_id = null;\r\n \r\n if ($first_level != null && $first_level != \"\" && trim($first_level) != \"\")\r\n {\r\n $first_id = $this->parse_directory_level(1, $first_level, \r\n $tc_index, $testcase_node, null);\r\n }\r\n \r\n if ($second_level != null && $second_level != \"\" && trim($second_level) != \"\")\r\n {\r\n $second_id = $this->parse_directory_level(2, $second_level,\r\n $tc_index, $testcase_node, $first_id);\r\n }\r\n else \r\n {\r\n // no second level dic, means testcase in first dic\r\n $tc_parent = $this->directory_array[1][$first_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($third_level != null && $third_level != \"\" && trim($third_level) != \"\")\r\n {\r\n $third_id = $this->parse_directory_level(3, $third_level,\r\n $tc_index, $testcase_node, $second_id);\r\n }\r\n else\r\n {\r\n // no third level dic, means testcase in second dic\r\n $tc_parent = $this->directory_array[2][$second_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($fourth_level != null && $fourth_level != \"\" && trim($fourth_level) != \"\")\r\n {\r\n $fourth_id = $this->parse_directory_level(4, $fourth_level,\r\n $tc_index, $testcase_node, $third_id);\r\n }\r\n else\r\n {\r\n // no fourth level dic, means testcase in third dic\r\n $tc_parent = $this->directory_array[3][$third_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n continue;\r\n }\r\n \r\n if ($fifth_level != null && $fifth_level != \"\" || trim($fifth_level) != \"\")\r\n {\r\n // the last level dic\r\n $fifth_id = $this->parse_directory_level(5, $fifth_level,\r\n $tc_index, $testcase_node, $fourth_id);\r\n $tc_parent = $this->directory_array[5][$fifth_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n }\r\n else\r\n {\r\n // no fifth level dic, means testcase in fourth dic\r\n $tc_parent = $this->directory_array[4][$fourth_id];\r\n $tc_parent->add_tc_step($tc_index);\r\n }\r\n }\r\n }", "public function calc_tree()\n\t{\n\t\t$this->readTree(TRUE);\t\t\t// Make sure we have accurate data\n\t\tforeach ($this->class_parents as $cp)\n\t\t{\n\t\t\t$rights = array();\n\t\t\t$this->rebuild_tree($cp,$rights);\t\t// increasing rights going down the tree\n\t\t}\n\t}", "public function tree_get($ns = false) {\n $root = $this->tree_get_parent();\n $parent = $this->element_read($root);\n\n if (!$root) {\n // Root-Knoten nicht gefunden\n $this->error = \"ERR_ROOT_NOT_FOUND\";\n return false;\n }\n\n $editable = 0;\n\n if ($ns == false) {\n // Gespeicherten Baum ausgeben\n\n // Nicht bearbeitbar da nicht live\n $editable = 1;\n\t\t$nestedset_ar = array();\n\t\t$nestedset_ar[] = array(\n\t\t\t\"id\" \t\t=> $root,\n\t\t\t\"title\"\t\t=> $parent[\"V1\"],\n\t\t\t\"childs\"\t=> $this->node_create_nestedset($root)\n\t\t);\n\n $ns = array();\n // $nestedset_ar als Nested-Set nach -> $nestedset\n $this->tree_create_nestedset_from_array($nestedset_ar, $ns);\n }\n $result = array();\n $parents = array();\n $parent = $ns[0];\n $parent[\"kidcount\"] = ($parent[\"RGT\"] - $parent[\"LFT\"] - 1) / 2;\n $parent[\"haskids\"] = ($parent[\"kidcount\"] > 0 ? true : false);\n $parent[\"is_first\"] = 1; $parent[\"is_last\"] = 1; $parent[\"level\"] = 0;\n //$parent[\"childs_done\"] = 0;\n for ($i = 1; $i < count($ns); $i++) {\n $ns[$i][\"editable\"] = $editable;\n $ns[$i][\"kidcount\"] = ($ns[$i][\"RGT\"] - $ns[$i][\"LFT\"] - 1) / 2;\n $ns[$i][\"haskids\"] = ($ns[$i][\"kidcount\"] > 0 ? true : false);\n $ns[$i][\"is_first\"] = (($parent[\"LFT\"]+1) == $ns[$i][\"LFT\"] ? 1 : 0);\n $ns[$i][\"is_last\"] = 0;\n $ns[$i][\"index\"] = $i-1;\n $ns[$i][\"level\"] = $parent[\"level\"]+1;\n\n //echo(\"ELE (\".count($parents).\")\".$ns[$i][\"ID_KAT\"].\" | \".$ns[$i][\"RGT\"].\" -> \".$parent[\"RGT\"].\"<br />\");\n if ($ns[$i][\"RGT\"] == ($parent[\"RGT\"]-1)) {\n $ns[$i][\"is_last\"] = 1;\n $parent = array_pop($parents);\n while ((count($parents) > 1) && ($parents[count($parents)-1]) && ($parent[\"RGT\"] == ($parents[count($parents)-1][\"RGT\"]-1))) {\n //echo(\"PAR2 (\".count($parents).\")\".$parent[\"ID_KAT\"].\" | \".$parent[\"RGT\"].\" -> \".$parents[count($parents)-1][\"RGT\"].\"<br />\");\n $result[$parent[\"index\"]][\"is_last\"] = 1;\n $parent = array_pop($parents);\n }\n }\n $result[$i-1] = array_merge($this->element_read($ns[$i][\"ID_KAT\"]), $ns[$i]);\n\n if ($ns[$i][\"kidcount\"] > 0) {\n // Es folgen Kind-Elemente dieses Knotens\n $parents[] = $parent;\n $parent = $ns[$i];\n }\n }\n //die(ht(dump($result)));\n return $result;\n }", "public function parse(?Tree $oldTree, Input $input): Tree\n {\n return API::ffi()->ts_parser_parse($this->data, $oldTree->data, $input->data);\n }", "public function parse($html);", "public function parse($html);", "function parseCategories($tree, $root = 0) {\n\n\n $return = [];\n # Traverse the tree and search for direct children of the root\n foreach($tree as $key => $value) {\n # A direct child is found\n if($value[\"parent_id\"] == $root) {\n \n # Remove item from tree (we don't need to traverse this again)\n unset($tree[$key]);\n # Append the child into result array and parse its children\n $return[] = array(\n 'value' => $value,\n 'children' => parseCategories($tree, $value[\"id\"])\n );\n }\n }\n \n return empty($return) ? null : $return;\n}", "abstract public function parse(\\SHH\\Parser &$parser);", "function buildTree ($a_node = \"\")\n\t{\n\t\tif (empty($a_node)) {\n\t\t\t$a_node = $this->doc;\n\t\t}\n\t\t\n\t\t$this->transform($a_node,1);\n\t\t\n\t\treturn $this->tree;\n\t}", "public function parse()\n {\n if (isset($this->schema->cmd)) {\n foreach ($this->schema->cmd as $key => $val) {\n if ($key === \"addNamespaces\") {\n $this->registerNamespaces($val);\n } elseif ($key === \"removeEmptyValues\") {\n $this->removeEmptyValues = $val ? true : false;\n } elseif ($key === \"sortResult\") {\n $this->sort = $val ? true : false;\n }\n }\n }\n\n $array = $this->parseRecursive($this->schema);\n\n if ($this->sort) {\n ksort($array);\n }\n\n return $array;\n }", "function getChildNodes() ;", "public function getParseTree( $text ) {\n\t\tglobal $wgVisualEditorParserCmd, $wgServer, $wgScriptPath;\n\n\t\t// TODO This is probably not very portable to non-Unix OS. There's a lot of code in wfShellExec to make\n\t\t// that portable and secure on Windows etc. In any case the existing PHP-based parser calls out to an external script to do \n\t\t// HTML-tidy anyway, in a similar manner, without any shell escapes...\n\t\t$cmd = join( \" \", array( \n\t\t\t$wgVisualEditorParserCmd, \n\t\t\t'--wgScriptPath', wfEscapeShellArg( $wgServer . $wgScriptPath ),\n\t\t) );\n\n\t\t$parserIn = 0;\n\t\t$parserOut = 1;\n\t\t$parserErr = 2;\n\n\t\t$descriptorSpec = array(\n\t\t\t$parserIn => array( 'pipe', 'r' ), // child reads from stdin, we write\n\t\t\t$parserOut => array( 'pipe', 'w' ), // child writes to stdout, we read\n\t\t\t$parserErr => array( 'pipe', 'w' ) // child writes to stderr, we read\n\t\t);\n\n\t\t$pipes = array();\n\n\t\t$process = proc_open( $cmd, $descriptorSpec, $pipes );\n\n\t\t$ret = array( 'contents' => null );\n\n\t\tif ( is_resource( $process ) ) {\n\t\t\t// Theoretically, this style of communication could cause a deadlock\n\t\t\t// here. If the stdout buffer fills up, then writes to stdin could\n\t\t\t// block. \n\t\t\t//\n\t\t\t// TODO This might be an opportune time to give the parser all the subtemplates it's going to need,\n\t\t\t// such that we can. The DB does have a mapping of title to templates used.\n\t\t\t// Would need a convention for indicating multiple files in the text we write to the parser, like mime multipart\n\t\t\tfwrite( $pipes[$parserIn], $text );\n\t\t\tfclose( $pipes[$parserIn] );\n\t\t\n\t\t\t$ret['contents'] = FormatJson::decode( self::readFilehandle( $pipes[$parserOut] ) );\n\n\t\t\t$errors = self::readFilehandle( $pipes[$parserErr] );\n\t\t\tif ( $errors != '' and $errors != null ) {\n\t\t\t\t$ret['errors'] = $errors;\n\t\t\t}\n\n\t\t\t$retval = proc_close( $process );\n\t\t\tif ( $retval != 0 ) {\n\t\t\t\twfWarn( \"Parser process returned $retval\" );\n\t\t\t\tif ( !$ret['errors'] ) {\n\t\t\t\t\t$ret['errors'] = 'External parser process returned error code, check server logs';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\twfWarn( \"Unable to start external parser process\" );\n\t\t\t$ret['errors'] = \"Unable to start external parser process, check server logs\";\n\t\t}\n\n\t\treturn $ret;\n\t}", "function parse()\n {\n $params=$this->layoutManager->getPluginParams(\"L\");\n $tLang=$params[\"lang\"];\n $el=$this->getSubElements();\n $id=$el[\"ID\"][\"text\"];\n $textNode=$el[\"C\"][\"node\"];\n $layoutContents=$textNode->contents;\n $nContents=count($layoutContents);\n if($nContents==0)\n return;\n\n $curVar=1;\n $phpCode=array();\n $newContents=array();\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n /* Supongamos una lista de layoutContents del tipo HTML - PHP - HTML : ej: a <?php echo \"p\";?> b\n * Para buscar la traduccion, hay que actuar como si fuera 1 solo layoutContent de tipo a %1 b\n * Por eso, el resultado debe ser 1 solo layoutcontent de tipo HTML, aunque dentro, contenga codigo php.\n * \n */\n $html=\"\";\n for($k=0;$k<$nContents;$k++)\n { \n if($layoutContents[$k][\"TYPE\"]==\"HTML\")\n {\n $html.=$layoutContents[$k][\"TEXT\"];\n }\n else\n {\n if($layoutContents[$k][\"TYPE\"]==\"PHP\")\n {\n $html.=\"{%\".$curVar.\"}\";\n $phpCode[$curVar]=$layoutContents[$k][\"TEXT\"];\n $curVar++;\n }\n else\n {\n // Se traduce el nodo HTML actual\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n // Se copia el nodo que hemos encontrado, tal cual (no es ni PHP ni HTML)\n $newContents[]=$layoutContents[$k];\n // Se crea el siguiente nodo HTML.\n $currentNode=array(\"TYPE\"=>\"HTML\",\"TEXT\"=>\"\");\n $newContents[]=$currentNode;\n $html=\"\";\n $phpCode=array();\n $curVar=1;\n }\n \n }\n } \n // Al llegar aqui, nos queda el ultimo nodo HTML creado.Hay que parsearlo.\n $currentNode[\"TEXT\"]=$this->parseTranslation($tLang,$id,$phpCode,$html);\n return $newContents;\n }", "abstract protected function getMenuTree();", "private function parse ( ) {\n\t\t\t$this->parse_csv();\n\t\t\t\n\t\t\t// parse out the daily html\n\t\t\t$this->parse_html();\n\t\t\t\n\t\t}", "protected function init(&$tree)\r\n {\r\n // mark path to parent\r\n $this->markBreadcrumb($tree->getNode($tree->getCurrent()));\r\n\r\n // init templates\r\n if (!$this->settings['template_dir']) {\r\n $this->settings['template_dir'] = __DIR__.'/Formatter/templates';\r\n }\r\n $this->settings['tpldir'] = implode('/', array(\r\n $this->settings['template_dir'],\r\n $this->settings['template_type'],\r\n $this->settings['template_variant']\r\n ));\r\n\r\n // silently \"fix\" wrong maxdepth (> max tree level)\r\n if (!$this->settings['maxdepth'] || $this->settings['maxdepth'] > $tree->getDepth()) {\r\n $this->settings['maxdepth'] = $tree->getDepth();\r\n }\r\n // check if mindepth is greater than 1 and maxdepth\r\n if ($this->settings['mindepth'] > $this->settings['maxdepth']) {\r\n throw new InvalidArgumentException(sprintf(\r\n \"Min depth [%s] > max depth [%s]!\",$this->settings['mindepth'],$this->settings['maxdepth']\r\n ));\r\n }\r\n\r\n // level classes\r\n foreach (array_values(array('ul_classes','li_classes','a_classes')) as $c) {\r\n if (isset($this->settings[$c]) && is_array($this->settings[$c])) {\r\n foreach ($this->settings[$c] as $key => $css) {\r\n // analyze >[=] and <[=]\r\n // may not the most elegant way, but works for now\r\n if (preg_match('/([\\>|\\<])(\\=?)(\\d+)/', $key, $m)) {\r\n switch ($m[1]) {\r\n case '>':\r\n $startlevel = (($m[2]=='=') ? $m[3] : $m[3]+1);\r\n for ($l=$startlevel;$l<$this->tree->getDepth()+1;$l++) {\r\n $this->settings[$c][$l] = $css;\r\n }\r\n unset($this->settings[$c][$key]);\r\n break;\r\n case '<':\r\n $stoplevel = (($m[2]=='=') ? $m[3]-1 : $m[3]);\r\n for ($l=1;$l<$stoplevel;$l++) {\r\n $this->settings[$c][$l] = $css;\r\n }\r\n unset($this->settings[$c][$key]);\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }", "private function parse()\n\t{\n\t\t// parse datagrids\n\t\tif(!empty($this->datagrids)) $this->tpl->assign('datagrids', $this->datagrids);\n\t}", "public function parse(): PhpCss\\Ast\\Node {\n }", "public function parse(): void\n {\n // TODO: Implement parse() method.\n }", "protected function parse()\n {\n\n $crawler = new Crawler($this->originalHTML);\n\n $this->tableOfContents = $crawler->filter('body > nav')->html();\n $this->body = $crawler->filter('body > main')->html();\n\n $this->reformatTableOfContents();\n $this->reformatBody();\n }", "public function parse($tokens)\n {\n $parents = array();\n\n // flag : are we in a <pre> Tag ?\n $this->tagPreIn = false;\n\n /**\n * all the actions to do\n * @var Node[] $actions\n */\n $actions = array();\n\n // get the actions from the html tokens\n foreach ($tokens as $token) {\n if ($token->getType() === 'code') {\n $actions = array_merge($actions, $this->getTagAction($token, $parents));\n } elseif ($token->getType() === 'txt') {\n $actions = array_merge($actions, $this->getTextAction($token));\n }\n }\n\n // for each identified action, we have to clean up the begin and the end of the texte\n // based on tags that surround it\n\n // list of the tags to clean\n $tagsToClean = array(\n 'page', 'page_header', 'page_footer', 'form',\n 'table', 'thead', 'tfoot', 'tr', 'td', 'th', 'br',\n 'div', 'hr', 'p', 'ul', 'ol', 'li',\n 'h1', 'h2', 'h3', 'h4', 'h5', 'h6',\n 'bookmark', 'fieldset', 'legend',\n 'draw', 'circle', 'ellipse', 'path', 'rect', 'line', 'g', 'polygon', 'polyline',\n 'option'\n );\n\n // foreach action\n $nb = count($actions);\n for ($k = 0; $k < $nb; $k++) {\n // if it is a Text\n if ($actions[$k]->getName() === 'write') {\n // if the tag before the text is a tag to clean => ltrim on the text\n if ($k>0 && in_array($actions[$k - 1]->getName(), $tagsToClean)) {\n $actions[$k]->setParam('txt', ltrim($actions[$k]->getParam('txt')));\n }\n\n // if the tag after the text is a tag to clean => rtrim on the text\n if ($k < $nb - 1 && in_array($actions[$k + 1]->getName(), $tagsToClean)) {\n $actions[$k]->setParam('txt', rtrim($actions[$k]->getParam('txt')));\n }\n\n // if the text is empty => remove the action\n if (!strlen($actions[$k]->getParam('txt'))) {\n unset($actions[$k]);\n }\n }\n }\n\n // if we are not on the level 0 => HTML validator ERROR\n if (count($parents)) {\n if (count($parents)>1) {\n $errorMsg = 'The following tags have not been closed:';\n } else {\n $errorMsg = 'The following tag has not been closed:';\n }\n\n $e = new HtmlParsingException($errorMsg.' '.implode(', ', $parents));\n $e->setInvalidTag($parents[0]);\n throw $e;\n }\n\n $this->verifyMustContain($actions, 'thead', 'tr');\n $this->verifyMustContain($actions, 'tfoot', 'tr');\n\n // save the actions to do\n $this->code = array_values($actions);\n }", "function parse_xml($xml)\n\t{\n\t\t// PHP's XML array structures stink so make our own\n\t\tif ($this->parse_into_struct($xml) === FALSE)\n\t\t{\n\t\t\terror_log('Unable to parse XML data');\n\t\t\treturn FALSE;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$elements = array();\n\t\t\t$child = array();\n\t\t\tforeach ($this->tagdata as $item)\n\t\t\t{\n\t\t\t\t$current = count($elements);\n\n\t\t\t\tif ($item['type'] == 'open' OR $item['type'] == 'complete')\n\t\t\t\t{\n\t\t\t\t\t$elements[$current] = new XML_Cache;\n\t\t\t\t\t$elements[$current]->tag\t\t= $item['tag'];\n\t\t\t\t\t$elements[$current]->attributes\t= (array_key_exists('attributes', $item)) ? $item['attributes'] : '';\n\t\t\t\t\t$elements[$current]->value\t\t= (array_key_exists('value', $item)) ? $item['value'] : '';\n\n\t\t\t\t\t/** -------------------------------------\n\t\t\t\t\t/** Create a new child layer for 'open'\n\t\t\t\t\t/** -------------------------------------*/\n\t\t\t\t\tif ($item['type'] == \"open\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$elements[$current]->children = array();\n\t\t\t\t\t\t$child[count($child)] = &$elements;\n\t\t\t\t\t\t$elements = &$elements[$current]->children;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t/** -------------------------------------\n\t\t\t\t/** Put child layer into root object\n\t\t\t\t/** -------------------------------------*/\n\n\t\t\t\telseif ($item['type'] == 'close')\n\t\t\t\t{\n\t\t\t\t\t$elements = &$child[count($child) - 1];\n\t\t\t\t\tunset($child[count($child) - 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $elements[0];\n\t}", "function parseTree($files, $icons, $nested = 0){\n $tree = '';\n $padding = $nested * 16 + 6;\n\n foreach ($files as $path => $value) {\n $parts = explode('/',$path);\n\n /* Sanitize name, http://stackoverflow.com/questions/2103797/url-friendly-username-in-php */\n $name = 'folder-'.strtolower(trim(preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($path, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8')), '-'));\n\n if (is_array($value)) {\n $tree .= \"<li><input type='checkbox' name ='$name' id='$name'>\".\n \"<label for='$name' style='padding-left:\".$padding.\"px'><svg xmlns='http://www.w3.org/2000/svg' width='14' height='16' viewBox='0 0 14 16' class='folder icon'><path d='M13 4H9V3c0-.66-.31-1-1-1H1c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zM8 4H1V3h7z'/><path class='open' d='M1 3v4.094h12V4.97H8V3H1z'/></svg>\". end($parts) . \"</label>\".\n '<ul>'.parseTree($value, $icons, $nested + 1).'</ul></li>';\n } else {\n $class_name = $icons->getClassWithColor($value);\n // ($match = $icons->matchName($value)) ? $match->getClass(1) : 'text-icon';\n $tree .= \"<li><label style='padding-left:\".$padding.\"px'><a target='iframe' href='index.php/$path' onmouseup='document.getElementById(\\\"content\\\").scrollTop = 0'><i class='icon $class_name'></i>$value</a></label></li>\";\n }\n } \n return $tree; \n }", "private function parse(\\DomNode $node, $parent)\n\t{\n \tif($node->childNodes->length) {\n\t\t foreach($node->childNodes as $childNode) {\n\n\t\t \tif(!in_array($childNode->nodeName, $this->allowedTypes)) {\n\t\t \t\tcontinue;\n\t\t \t}\n\t\t\t \t\n\n\t\t\t $previousSibling = $childNode->previousSibling;\n\t\t\t $key = null;\n\n\t\t\t while($previousSibling && $previousSibling->nodeName == '#text' && $previousSibling->previousSibling) {\n\t\t\t\t $previousSibling = $previousSibling->previousSibling;\n\t\t\t\t}\n\n\t\t \tif($previousSibling && $previousSibling->nodeName == 'key') {\n\t\t\t \t$key = $previousSibling->firstChild->nodeValue;\n\t\t\t }\n\n\t\t\t\tswitch($childNode->nodeName) {\n\t\t\t\t\tcase 'array':\n\t\t\t\t\t\t$value = new PlistArray();\n\t\t\t\t\t\t$this->parse($childNode, $value);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'dict':\n\t\t\t\t\t\t$value = new PlistDict();\n\t\t\t\t\t\t$this->parse($childNode, $value);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'string':\n\t\t\t\t\t\t$value = new PlistString($childNode->nodeValue);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'real':\n\t\t\t\t\t\t$value = new PlistNumber(floatval($childNode->nodeValue));\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'integer':\n\t\t\t\t\t \t$value = new PlistNumber(intval($childNode->nodeValue));\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\tcase 'true':\n\t\t\t\t\t\t$value = new PlistBoolean($childNode->nodeName == 'true');\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 'false':\n\t\t\t\t\t \t$value = new PlistBoolean($childNode->nodeName == 'true');\n\t\t\t\t\t \tbreak;\n\n\t\t\t\t\t\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tthrow new PlistException($node->nodeValue . ' not implemented');\n\t\t\t\t}\n\n\t\t\t\tif($parent instanceof PlistDict) {\n\t\t\t\t\t$parent->append($key, $value);\n\t\t\t\t} else {\n\t\t\t\t\t$parent->append($value);\n\t\t\t\t}\n\t\t\t}\n \t}\n }", "public function parse($file);", "public function parse($file);", "protected function parseTokens()\n {\n // Recursively traverse the inheritance chain defined by $this->parent\n\n if ($this->parent !== $this) return $this->parent->parseTokens();\n\n // Alias properties to local variables, initialize them\n\n $line =& $this->line; $line = 1;\n $i =& $this->index; $i = 0;\n $inString =& $this->inString; $inString = 0;\n $types =& $this->types; $types = array();\n $texts =& $this->texts; $texts = array('');\n $prevType =& $this->prevType; $prevType = false;\n $penuType =& $this->penuType; $penuType = false;\n $tokens =& $this->tokens;\n $reg =& $this->tokenRegistry;\n\n $j = 0;\n $curly = 0;\n $curlyPool = array();\n\n while (isset($tokens[$i]))\n {\n $t =& $tokens[$i]; // Get the next token\n unset($tokens[$i++]); // Free memory and move $this->index forward\n\n // Set primary type and handle string interpolation context:\n // - tag closing braces as T_CURLY_CLOSE when they are opened with curly braces\n // tagged as T_CURLY_OPEN or T_DOLLAR_OPEN_CURLY_BRACES, to make\n // them easy to separate from regular code \"{\" / \"}\" pairs,\n // - tag arrays' or objects' string indexes as T_STR_STRING.\n\n $priType = 1; // T_SEMANTIC\n\n if (isset($t[1]))\n {\n if ($inString & 1) switch ($t[0])\n {\n case T_VARIABLE:\n case T_STR_STRING:\n case T_CURLY_OPEN:\n case T_CURLY_CLOSE:\n case T_END_HEREDOC:\n case T_ENCAPSED_AND_WHITESPACE:\n case T_DOLLAR_OPEN_CURLY_BRACES: break;\n case T_STRING:\n if ('[' === $prevType || T_OBJECT_OPERATOR === $prevType)\n {\n $t[0] = T_STR_STRING;\n break;\n }\n case T_NUM_STRING: if ('[' === $prevType) break;\n case T_OBJECT_OPERATOR: if (T_VARIABLE === $prevType) break;\n default:\n if ('[' === $prevType && preg_match(\"/^[_a-zA-Z]/\", $t[1][0])) $t[0] = T_STR_STRING;\n else $t[0] = T_ENCAPSED_AND_WHITESPACE;\n }\n else if ('b\"' === $t) $t = array('\"', 'b\"'); // Binary string syntax b\"...\"\n else switch ($t[0])\n {\n case T_WHITESPACE:\n case T_COMMENT:\n case T_DOC_COMMENT:\n case T_BAD_CHARACTER: $priType = 2; // T_NON_SEMANTIC\n }\n }\n else\n {\n $t = array($t, $t);\n\n if ($inString & 1) switch ($t[0])\n {\n case '\"':\n case '`': break;\n case ']': if (T_STR_STRING === $prevType || T_NUM_STRING === $prevType) break;\n case '[': if (T_VARIABLE === $prevType && '[' === $t[0]) break;\n default: $t[0] = T_ENCAPSED_AND_WHITESPACE;\n }\n else if ('}' === $t[0] && !$curly) $t[0] = T_CURLY_CLOSE;\n }\n\n // Trigger callbacks\n\n if (isset($reg[$t[0]]) || isset($reg[$priType]))\n {\n $n = $t[0];\n $t[2] = array($priType => $priType);\n\n if (isset($reg[$priType])) $callbacks = $reg[$priType];\n else $callbacks = array();\n\n for (;;)\n {\n $t[2][$n] = $n;\n\n if (isset($reg[$n]))\n {\n $callbacks += $reg[$n];\n\n // Callback triggers are always ordered:\n // - first by parsers' instanciation order\n // - then by callbacks' registration order\n // - callbacks registered with a tilde prefix\n // are then called in reverse order.\n ksort($callbacks);\n }\n\n foreach ($callbacks as $k => $c)\n {\n unset($callbacks[$k]);\n\n // $t is the current token:\n // $t = array(\n // 0 => token's main type - a single character or a T_* constant,\n // as returned by token_get_all()\n // 1 => token's text - its source code excerpt as a string\n // 2 => an array of token's types and subtypes\n // )\n\n if ($k < 0)\n {\n $n = $c[0]->{$c[1]}($t);\n\n // Non-tilde-prefixed callbacks can return:\n // - false, which cancels the current token\n // - a new token type, which is added to $t[2] and loads the\n // related callbacks in the current callbacks stack\n // - or nothing (null)\n\n if (false === $n) continue 3;\n if ($n && empty($t[2][$n])) continue 2;\n }\n else if (null !== $c[0]->{$c[1]}($t))\n {\n user_error(\"No return value is expected for tilde-registered callback: \" . get_class($c[0]) . '->' . $c[1] . '()', E_USER_NOTICE);\n }\n }\n\n break;\n }\n }\n\n // Commit to $this->texts\n\n $texts[++$j] =& $t[1];\n\n if (2 === $priType) // T_NON_SEMANTIC\n {\n $line += substr_count($t[1], \"\\n\");\n continue;\n }\n\n // For semantic tokens only: populate $this->types, $this->prevType and $this->penuType\n\n $penuType = $prevType;\n $types[$j] = $prevType = $t[0];\n\n // Parsing context analysis related to string interpolation and line numbering\n\n if (isset($prevType[0])) switch ($prevType)\n {\n case '{': ++$curly; break;\n case '}': --$curly; break;\n case '\"':\n case '`': $inString += ($inString & 1) ? -1 : 1;\n }\n else switch ($prevType)\n {\n case T_CONSTANT_ENCAPSED_STRING:\n case T_ENCAPSED_AND_WHITESPACE:\n case T_OPEN_TAG_WITH_ECHO:\n case T_INLINE_HTML:\n case T_CLOSE_TAG:\n case T_OPEN_TAG:\n $line += substr_count($t[1], \"\\n\");\n break;\n\n case T_DOLLAR_OPEN_CURLY_BRACES:\n case T_CURLY_OPEN: $curlyPool[] = $curly; $curly = 0;\n case T_START_HEREDOC: ++$inString; break;\n\n case T_CURLY_CLOSE: $curly = array_pop($curlyPool);\n case T_END_HEREDOC: --$inString; break;\n\n case T_HALT_COMPILER:\n 4 === $this->haltCompilerTail and $this->register('tagHaltCompilerData');\n break;\n }\n }\n\n // Free memory thanks to copy-on-write\n $j = $texts;\n $types = $texts = $tokens = $reg = $this->parents = $this->parent = null;\n return $j;\n }", "abstract protected function newParser();", "private function _getTree()\r\n {\r\n $items = $this->setArray($this->getItems());\r\n $tree = $this->_buildTree($items);\r\n return $tree;\r\n }", "function create_parser() {}", "function process() {\n return $this->_parse();\n }", "public abstract function parse($text);", "static function buildTreeFromTextDFM($content) {\n $objects = self::parseTextDFM($content);\n\n foreach ($objects as $_id => $_object) {\n $_object->ischild = false;\n\n // Color\n $_object->csscolor = self::parseColor($_object->color);\n\n $_parent = $_object->parent;\n\n if ($_parent && $_parent != \"Scene\" && isset($objects[$_parent])) {\n if (!isset($objects[$_parent]->children)) {\n $objects[$_parent]->children = array();\n }\n\n $_object->ischild = true;\n $objects[$_parent]->children[$_id] = $_object;\n }\n }\n\n foreach ($objects as $_id => $_object) {\n if ($_object->ischild) {\n unset($objects[$_id]);\n }\n }\n\n return $objects;\n }", "abstract public function tree_encoder();", "public static function handle() {\n\t\t\n\t\tif(!static::$multiline) {\n\t\t\t$node = nodes\\Tag::new_from_parser(static::$parser);\n\t\t\tstatic::parse_start($node);\n\t\t\t\n\t\t\tif(static::$multiline) {\n\t\t\t\tstatic::$parser->force_handler(get_called_class());\n\t\t\t\tstatic::$parser->expect_indent(Parser::EXPECT_MORE);\n\t\t\t}\n\t\t} else {\n\t\t\t$node = static::$parser->context();\n\t\t\t$node->content .= ' ' . static::$parser->content();\n\t\t\t\n\t\t\tswitch(static::$multiline) {\n\t\t\t\tcase self::MULTILINE_HTML_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_html_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tcase self::MULTILINE_RUBY_ATTRIBUTES:\n\t\t\t\t\tstatic::$multiline = false;\n\t\t\t\t\tstatic::parse_ruby_attributes($node);\n\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$node->exception('Sanity error: unknown multiline modifier');\n\t\t\t}\n\t\t\t\n\t\t\tif(static::$multiline)\n\t\t\t static::$parser->force_handler(get_called_class());\n\t\t}\n\t\t\n\t}", "static function to_tree($data)\n {\n //Cap 1\n for ($i = 3; $i >= 1; $i--)\n {\n //echo $i . \"============<br/>\";\n foreach ($data as $key=>$value)\n {\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"$key = \" . $data[$key][\"ten\"] . \"<br/>\";\n \n //if (!isset($data[$key][\"tree\"])) $data[$key][\"tree\"] = false;\n //if ($value[\"parent\"] > 0 && !$data[$key][\"tree\"])\n if ($value[\"cap\"] == $i)\n {\n //if (!isset($data[$value[\"parent\"]][\"child\"])){\n //\t$data[$value[\"parent\"]][\"child\"] = array();\n //}\n $data[$value[\"parent\"]][\"child\"][$key] = $value;\n //if ($key == 1485 || $key == 192 || $key == 193 || $key == 29)\n //echo \"&nbsp;&nbsp;&nbsp;&nbsp;Dua \" . $value[\"ten\"] . \" vao \" . $value[\"parent\"] . \" \" . $data[$value[\"parent\"]][\"ten\"] . \" <br/>\";\n //$data[$key][\"tree\"] = true;\n //$data[$value[\"parent\"]][\"tree\"] = false;\n }\n }\n }\n //Khu bo\n foreach ($data as $key=>$value)\n {\n if ($value[\"parent\"] > 0)\n {\n unset($data[$key]);\n }\n }\n \n return $data;\n }", "static function tree($params = false)\n {\n $params = parse_params($params);\n @extract($params);\n\n if (!isset($dir_name)) {\n return 'Error: You must set $dir_name for the function ' . __FUNCTION__;\n }\n if (!empty($params)) {\n ksort($params);\n }\n\n $function_cache_id = __FUNCTION__ . crc32(serialize($params));\n $cache_content = false;\n //$cache_content = $this->app->cache->get($function_cache_id, 'content/static');\n\n if (($cache_content) != false) {\n\n $tree = $cache_content;\n } else {\n\n //$this->app->cache->save($tree, $function_cache_id, $cache_group = 'content/static');\n }\n if (!isset($url)) {\n $url = $this->app->url->current(true, true);\n }\n $params['url'] = $url;\n $params['url_param'] = 'page';\n\n\n mw('Microweber\\Utils\\Files')->dir_tree($dir_name, $params);\n\n\n }", "private function _runParse( $path = NULL )\n {\n $startLevels = $this->_getRealLevel( $this->_rootPath );\n $endLevels = $startLevels + $this->levels;\n $currentLevel = 0;\n\n if ( NULL !== $path )\n {\n $this->_dirs[ ] = $path;\n }\n\n do\n {\n $dir = array_shift( $this->_dirs );\n $currentLevel = $this->_getRealLevel( $dir );\n\n if ( $currentLevel < $endLevels )\n {\n $this->_parse( $dir );\n }\n } while ( count( $this->_dirs ) > 0 );\n }", "private function _getTree($create = false) {}", "protected function parse()\n {\n // [square] ..... visible comments (don't count as words for sorting, don't act as keywords)\n // (round) ....... for optional parts (count as words for sorting, act as keywords)\n // {curly} ........ word class definitions (use word class field instead, except for gender tags like {f}, {pl}, ...)\n\n while (($line = fgets($this->handle)) !== false) {\n if (strpos($line, '#') === 0) {\n continue;\n }\n\n if (trim($line) === '') {\n continue;\n }\n\n $data = preg_split('/[\\t]+/', $line);\n\n $headword = trim($data[0]);\n $translation = trim($data[1]);\n $wordclass = '';\n $subject = '';\n\n if (count($data) > 2) {\n $wordclass = trim($data[2]);\n }\n\n if (count($data) > 3) {\n $subject = trim($data[3]);\n }\n\n $entry = new Entry();\n\n $entry->directionId = $this->directionId;\n $entry->headword = $headword;\n $entry->translation = $translation;\n $entry->wordclass = $wordclass;\n\n $entry->subjects = $entry->getParsedSubjects($subject);\n $entry->parseHeadword();\n $entry->parseTranslation();\n\n yield $entry->jsonSerialize();\n }\n }", "public function parse($document)\n {\n }", "public function showData(){\n echo \"<li>Data: \";\n if(gettype($this->data) == \"array\"){\n print_r(implode(', ', $this->data));\n }\n else{\n print_r($this->data);\n }\n echo \"</li>\";\n\n echo \"<ul><li>is a \".$this->type.\"</li>\"; // Print the type of the node\n\n if($this->parentNode != NULL){\n echo \"<li>Parent: \";\n if(gettype($this->parentNode->getData()) == \"array\"){\n print_r(implode(', ', $this->parentNode->getData()));\n }\n else{\n print_r($this->parentNode->getData());\n }\n\n echo \"</li>\";\n }\n else{\n echo \"<li>has no parent node.</li>\";\n }\n\n // echo \"<li>Children: </li>\";\n // // Show left child\n // if($this->childNodes[\"left\"] != NULL){\n // $d = $this->childNodes[\"left\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"L: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"L: \".$d.\"\\t\";\n // }\n //\n // }\n // // Show left-right child if we have it\n // if($this->childNodes[\"LR\"] != NULL){\n // $d = $this->childNodes[\"LR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"LR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"LR: \".$d.\"\\t\";\n // }\n // }\n //\n // // ... middle child\n // if($this->childNodes[\"mid\"] != NULL){\n // $d = $this->childNodes[\"mid\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"M: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"M: \".$d.\"\\t\";\n // }\n // }\n // // ... middle-right child\n // if($this->childNodes[\"MR\"] != NULL){\n // $d = $this->childNodes[\"MR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"MR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"MR: \".$d.\"\\t\";\n // }\n // }\n //\n // // ... right child\n // if($this->childNodes[\"right\"] != NULL){\n // $d = $this->childNodes[\"right\"]->getData();\n // if(gettype($d) == \"array\"){\n // echo \"R: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"R: \".$d.\"\\t\";\n // }\n // }\n // // ... right-right child\n // if($this->childNodes[\"RR\"] != NULL){\n // $d = $this->childNodes[\"RR\"]->getData();\n //\n // if(gettype($d) == \"array\"){\n // echo \"RR: \".implode(', ', $d).\"\\t\";\n // }\n // else{\n // echo \"RR: \".$d.\"\\t\";\n // }\n // }\n\n echo \"</ul>\";\n }", "public function getChildNodes() {}", "public function getChildNodes() {}", "public function parse($content);", "public function generate_tree($string)\r\n\t{\r\n\t\tunset($this->current);\r\n\t\tunset($this->stack);\r\n\t\t\r\n\t\t$this->current = array();\r\n\t\t$this->stack = array(array('content' => &$this->current));\r\n\t\t\r\n\t\t$this->pre_parse($string);\r\n\t\t\r\n\t\treturn $this->current;\r\n\t}", "public function buildTree($arr)\n\t{\n\t\t$count = count($arr);\n\t\tif(!$count) return array();\n\n\t\t$first = $arr[0];\n\t\t$entryLevel = $first->level;\n\t\t$tree = new stdClass();\n\t\t$tree->type = $first->type;\n\t\t$tree->content = null;\n\t\t$tree->parent = null;\n\t\t$tree->key = 'root';\n\t\t$tree->level = $entryLevel - 1;\n\t\t$tree->children = array();\n\t\t$lastNode = $tree;\n\t\t// store the relations\n\t\t$parentList = array();\n\t\tforeach($arr as $key => $val){\n\t\t\t$level = $val->level;\n\t\t\t$lastLevel = $lastNode->level;\n\t\t\tif($level > $lastLevel){\n\t\t\t\t$lastNode->children[] = $val;\n\t\t\t\t$parentList[$key] = $lastNode;\n\t\t\t\t$lastNode = $val;\n\t\t\t} elseif($level < $lastLevel) { \n\t\t\t\t// look for the node has same level \n\t\t\t\twhile($level < $lastNode->level){\n\t\t\t\t\t$lastNode = $parentList[$lastNode->key];\n\t\t\t\t}\n\t\t\t\t$parent = $parentList[$lastNode->key];\n\t\t\t\t$parent->children[] = $val;\n\t\t\t\t$parentList[$key] = $parent;\n\t\t\t\t$lastNode = $val;\n\t\t\t} else { // $level == $lastLevel\n\t\t\t\t$parent = $parentList[$lastNode->key];\n\t\t\t\t$parent->children[] = $val;\n\t\t\t\t$parentList[$key] = $parent;\n\t\t\t\t$lastNode = $val;\n\t\t\t}\n\t\t}\n\t\treturn $tree;\n\t}", "public function renderTree()\n {\n $structure = $this->_module->treeStructure + $this->_module->dataStructure;\n extract($structure);\n $nodeDepth = $currDepth = $counter = 0;\n $jsSelect = '$('.$this->id.').treeview(\"collapseAll\");';\n $out = Html::beginTag('ul', ['class' => 'kv-tree']) . \"\\n\";\n foreach ($this->_nodes as $node) {\n /**\n * @var Tree $node\n */\n if (!$this->isAdmin && !$node->isVisible() || !$this->showInactive && !$node->isActive()) {\n continue;\n }\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeDepth = $node->$depthAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeLeft = $node->$leftAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeRight = $node->$rightAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeKey = $node->$keyAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeName = $node->$nameAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIcon = $node->$iconAttribute;\n /** @noinspection PhpUndefinedVariableInspection */\n $nodeIconType = $node->$iconTypeAttribute;\n\n $isChild = ($nodeRight == $nodeLeft + 1);\n $indicators = '';\n\n if (isset($this->nodeLabel)) {\n $label = $this->nodeLabel;\n $nodeName = is_callable($label) ? $label($node) :\n (is_array($label) ? ArrayHelper::getValue($label, $nodeKey, $nodeName) : $nodeName);\n }\n if ($nodeDepth == $currDepth) {\n if ($counter > 0) {\n $out .= \"</li>\\n\";\n }\n } elseif ($nodeDepth > $currDepth) {\n $out .= Html::beginTag('ul') . \"\\n\";\n $currDepth = $currDepth + ($nodeDepth - $currDepth);\n } elseif ($nodeDepth < $currDepth) {\n $out .= str_repeat(\"</li>\\n</ul>\", $currDepth - $nodeDepth) . \"</li>\\n\";\n $currDepth = $currDepth - ($currDepth - $nodeDepth);\n }\n if (trim($indicators) == null) {\n $indicators = '&nbsp;';\n }\n $nodeOptions = [\n 'data-key' => $nodeKey,\n 'data-lft' => $nodeLeft,\n 'data-rgt' => $nodeRight,\n 'data-lvl' => $nodeDepth,\n 'data-readonly' => static::parseBool($node->isReadonly()),\n 'data-movable-u' => static::parseBool($node->isMovable('u')),\n 'data-movable-d' => static::parseBool($node->isMovable('d')),\n 'data-movable-l' => static::parseBool($node->isMovable('l')),\n 'data-movable-r' => static::parseBool($node->isMovable('r')),\n 'data-removable' => static::parseBool($node->isRemovable()),\n 'data-removable-all' => static::parseBool($node->isRemovableAll()),\n ];\n\n $css = [];\n if (!$isChild) {\n $css[] = 'kv-parent ';\n }\n if (!$node->isVisible() && $this->isAdmin) {\n $css[] = 'kv-invisible';\n }\n if ($this->showCheckbox && in_array($node->id, $this->selected)) {\n $css[] = 'kv-selected ';\n $jsSelect .= '$('.$this->id.').treeview(\"checkNode\", \"'.$node->id.'\");';\n }\n if ($node->isCollapsed()) {\n $css[] = 'kv-collapsed ';\n }\n if ($node->isDisabled()) {\n $css[] = 'kv-disabled ';\n }\n if (!$node->isActive()) {\n $css[] = 'kv-inactive ';\n }\n $indicators .= $this->renderToggleIconContainer(false) . \"\\n\";\n $indicators .= $this->showCheckbox ? $this->renderCheckboxIconContainer(false) . \"\\n\" : '';\n if (!empty($css)) {\n Html::addCssClass($nodeOptions, $css);\n }\n $out .= Html::beginTag('li', $nodeOptions) . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-tree-list']) . \"\\n\" .\n Html::beginTag('div', ['class' => 'kv-node-indicators']) . \"\\n\" .\n $indicators . \"\\n\" .\n '</div>' . \"\\n\" .\n Html::beginTag('div', ['tabindex' => -1, 'class' => 'kv-node-detail']) . \"\\n\" .\n $this->renderNodeIcon($nodeIcon, $nodeIconType, $isChild) . \"\\n\" .\n Html::tag('span', $nodeName, ['class' => 'kv-node-label']) . \"\\n\" .\n '</div>' . \"\\n\" .\n '</div>' . \"\\n\";\n ++$counter;\n }\n if (isset($jsSelect)) {\n $this->view->registerJs(\n $jsSelect,\n View::POS_READY,\n 'treeviewinput-selected'\n );\n }\n $out .= str_repeat(\"</li>\\n</ul>\", $nodeDepth) . \"</li>\\n\";\n $out .= \"</ul>\\n\";\n return Html::tag('div', $this->renderRoot() . $out, $this->treeOptions);\n }", "public function evaluateChildNodes();", "function get_nodes()\n {\n\n \tif( !isset($this->cache['trees'][$this->tree_id]['nodes']))\n \t{\n \t\tee()->db->select('*');\n\t\t\tee()->db->from( $this->tree_table );\n\t\t\tee()->db->join('channel_titles', 'channel_titles.entry_id = '.$this->tree_table.'.entry_id', 'left');\n\t\t\tee()->db->join('statuses', 'statuses.status = channel_titles.status', 'left');\n \t\t$nodes = ee()->db->get()->result_array();\n\n \t\t// map field names => type\n\t\t\t$cf_map = array();\n\t\t\tforeach( $this->cache['trees'][$this->tree_id]['fields'] as $cf)\n\t\t\t{\n\t\t\t $cf_map[$cf['name']] = $cf['type'];\n\t\t\t}\n\n \t\t// reindex with node ids as keys\n \t\t$node_data = $entry_data = array();\n \t\tforeach($nodes as $node)\n \t\t{\n \t\t\t// if the node is associated with an entry\n \t\t\t// create another index for those\n \t\t\tif($node['entry_id'])\n \t\t\t{\n \t\t\t\t$entry_data[ $node['entry_id'] ] = $node['node_id'];\n \t\t\t}\n\n \t\t\tif($node['type'] != '')\n \t\t\t{\n \t\t\t\t$node['type'] = explode('|', $node['type']);\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\t$node['type'] = array();\n \t\t\t}\n\n \t\t\tif(!empty($node['field_data']))\n \t\t\t{\n \t\t\t\tee()->load->library('taxonomy_field_lib');\n \t\t\t\t$node['field_data'] = json_decode($node['field_data'], TRUE);\n \t\t\t\tforeach($node['field_data'] as $k => $v)\n \t\t\t\t{\n \t\t\t\t\t// this should apply to front end template parsing only \n \t\t\t\t\t$callers = debug_backtrace();\n \t\t\t\t\tif ( isset($callers[2]['function']) && $callers[2]['function'] == 'process_tags' && isset($cf_map[$k]))\n \t\t\t\t\t{\n \t\t\t\t\t\t\n \t\t\t\t\t\t$ft = ee()->taxonomy_field_lib->load($cf_map[$k]);\n \t\t\t\t\t\t// let the fieldtype change the final value\n \t\t\t$v = $ft->replace_value($v);\n \t\t\t// overwrite value\n \t\t\t$node['field_data'][$k] = $v;\n \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$node[$k] = $v;\n \t\t\t\t}\n \t\t\t}\n\n \t\t\t$node_data[ $node['node_id'] ] = $node;\n \t\t\t$node_data[ $node['node_id'] ]['url'] = $this->build_url($node);\n \t\t\t\n \t\t}\n\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_node_id'] = $node_data;\n \t\t$this->cache['trees'][$this->tree_id]['nodes']['by_entry_id'] = $entry_data;\n \t}\n\n \treturn $this->cache['trees'][$this->tree_id]['nodes'];\n\n }", "abstract public function parse( $line );", "function &getTree( &$joomap, &$parent ) {\n\t\tglobal $joomap_plugins;\n\n\t\t$result = null;\n\t\tforeach( $joomap_plugins as $plugin) {\n\t\t\tif( $plugin->isOfType($joomap, $parent) ) {\t\t\t\t\t\t\t// check if plugin handles this kind of content\n\t\t\t\t$result = $plugin->getTree($joomap, $parent);\t\t\t\t\t// call plugin's handler function\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $result;\n\t}", "public static function buildTree($arr, $pid = 0);", "public function parse($sub = false)\n {\n \n try {\n \n while($this->lexer->moveNext()) {\n \n $result = null;\n $scope = null;\n $parser = null;\n \n switch(true) {\n case($this->lexer->isNextToken(Lexer::T_GROUP_OPEN)) :\n \n # is the group character the first token? is the regex wrapped in brackets. \n //if($this->lexer->token === null) {\n // continue;\n //}\n \n # note this is a new group create new parser instance.\n $parser = new Parser($this->lexer,new Scope(),new Scope());\n \n $this->left = $parser->parse(true)->getResult();\n $this->head->attach($this->left); \n \n break;\n case($this->lexer->isNextToken(Lexer::T_GROUP_CLOSE)) :\n \n # group is finished don't want to contine this loop break = 2\n break 2;\n break;\n case ($this->lexer->isNextTokenAny(array(Lexer::T_LITERAL_CHAR,Lexer::T_LITERAL_NUMERIC))): \n \n # test for literal characters (abcd)\n $this->left = new LiteralScope();\n $this->left->addLiteral($this->lexer->lookahead['value']);\n $this->head->attach($this->left);\n \n break;\n case($this->lexer->isNextToken(Lexer::T_SET_OPEN)) :\n \n # character classes [a-z]\n $this->left = new LiteralScope();\n self::createSubParser('character')->parse($this->left,$this->head,$this->lexer);\n $this->head->attach($this->left);\n \n \n break;\n case ($this->lexer->isNextTokenAny(array(\n Lexer::T_DOT,\n Lexer::T_SHORT_D,\n Lexer::T_SHORT_NOT_D,\n Lexer::T_SHORT_W,\n Lexer::T_SHORT_NOT_W,\n Lexer::T_SHORT_S,\n Lexer::T_SHORT_NOT_S))):\n \n # match short (. \\d \\D \\w \\W \\s \\S)\n $this->left = new LiteralScope();\n self::createSubParser('short')->parse($this->left,$this->head,$this->lexer);\n $this->head->attach($this->left);\n \n \n break;\n case ($this->lexer->isNextTokenAny(array(\n Lexer::T_SHORT_P,\n Lexer::T_SHORT_UNICODE_X,\n Lexer::T_SHORT_X))):\n \n # match short (\\p{L} \\x \\X )\n $this->left = new LiteralScope();\n self::createSubParser('unicode')->parse($this->left,$this->head,$this->lexer);\n $this->head->attach($this->left);\n \n \n break;\n case ($this->lexer->isNextTokenAny(array(\n Lexer::T_QUANTIFIER_OPEN,\n Lexer::T_QUANTIFIER_PLUS,\n Lexer::T_QUANTIFIER_QUESTION,\n Lexer::T_QUANTIFIER_STAR,\n Lexer::T_QUANTIFIER_OPEN\n ))):\n \n # match quantifiers \n self::createSubParser('quantifer')->parse($this->left,$this->head,$this->lexer);\n \n break;\n case ($this->lexer->isNextToken(Lexer::T_CHOICE_BAR)):\n \n # match alternations\n $this->left = $this->head;\n \n $this->head = new Scope();\n $this->result->useAlternatingStrategy();\n $this->result->attach($this->head);\n \n \n break; \n default:\n # ignore character \n } \n \n \n }\n \n }\n catch(ParserException $e)\n {\n $pos = $this->lexer->lookahead['position'];\n $compressed = $this->compress();\n throw new ParserException(sprintf('Error found STARTING at position %s after `%s` with msg %s ',$pos,$compressed,$e->getMessage()));\n }\n \n return $this; \n }", "function build_tree($pages){\n\t\tforeach ($pages as $page){\n\t\t\t$this->add_node($page);\n\t\t}\n\t\t$this->add_children();\n\t\n\t}", "protected function _getParser() {}", "public function parse(DOMElement $node);", "function Parse()\n {\n //Create the parser resource\n $this->parser = xml_parser_create(\"UTF-8\");\n \n //Set the handlers\n xml_set_object($this->parser, $this);\n xml_set_element_handler($this->parser, 'StartElement', 'EndElement');\n xml_set_character_data_handler($this->parser, 'CharacterData');\n\n //Error handling\n if (!xml_parse($this->parser, $this->xml))\n $this->HandleError(xml_get_error_code($this->parser), xml_get_current_line_number($this->parser), xml_get_current_column_number($this->parser));\n\n //Free the parser\n xml_parser_free($this->parser);\n }", "function renderTree($tree, $options)\n {\n $current_depth = 0;\n $counter = 0;\n $result = '';\n $folders = isset($options['folders']);\n $plans = isset($options['plans']);\n\n foreach($tree as $node)\n {\n $curr = $node['Category'];\n $node_depth = $curr['level'];\n $node_name = $curr['title'];\n $node_id = $curr['cat_id'];\n $node_count = $curr['listing_count'];\n\n if($node_depth == $current_depth)\n {\n if($counter > 0) $result .= '</li>';\n }\n elseif($node_depth > $current_depth)\n {\n $result .= '<ul'.($folders ? ' class=\"filetree\"' : '').'>';\n $current_depth = $current_depth + ($node_depth - $current_depth);\n }\n elseif($node_depth < $current_depth)\n {\n $result .= str_repeat('</li></ul>',$current_depth - $node_depth).'</li>';\n $current_depth = $current_depth - ($current_depth - $node_depth);\n }\n $result .= '<li class=\"jr-tree-cat-'.$node_id.' closed\"';\n $result .= '>';\n $folders and $result .= '<span class=\"folder\">&nbsp;';\n $result .= !$plans ?\n $this->Routes->category($node)\n :\n $this->Routes->category($node,array(\"onclick\"=>\"JRPaid.Plans.load({'cat_id':\".$node_id.\"});return false;\"))\n ;\n $this->Config->dir_cat_num_entries and $result .= ' (' .$node_count . ')';\n $folders and $result .= '</span>';\n ++$counter;\n }\n\n $result .= str_repeat('</li></ul>',$node_depth);\n\n return $result;\n }" ]
[ "0.72084814", "0.640325", "0.62920487", "0.62854624", "0.6251577", "0.6251577", "0.6251577", "0.62501097", "0.62501097", "0.62501097", "0.62501097", "0.62397456", "0.62328255", "0.61522853", "0.6111065", "0.6091115", "0.600486", "0.5995211", "0.5954424", "0.5950678", "0.59138006", "0.59089166", "0.58934444", "0.5822958", "0.5822419", "0.5821196", "0.5821196", "0.57601464", "0.5738313", "0.5736362", "0.57003653", "0.57003653", "0.56706214", "0.56356007", "0.5629997", "0.56191915", "0.56019956", "0.5565247", "0.5565247", "0.5565247", "0.5554734", "0.5513166", "0.54750097", "0.54576933", "0.53990924", "0.5380136", "0.5380136", "0.53621274", "0.5359627", "0.5350487", "0.5338145", "0.53336555", "0.5330782", "0.5328327", "0.5300541", "0.5297507", "0.5296757", "0.5285649", "0.528274", "0.5281409", "0.5257455", "0.5253235", "0.5243767", "0.5234246", "0.5223036", "0.5220474", "0.5220474", "0.52184236", "0.5214712", "0.52057904", "0.5205284", "0.52052635", "0.51999366", "0.5190055", "0.5185407", "0.51853377", "0.51813346", "0.5180668", "0.5177872", "0.5168916", "0.5162209", "0.5159169", "0.5156242", "0.51506895", "0.5149633", "0.51492304", "0.5148589", "0.51465374", "0.5143062", "0.5135759", "0.51349074", "0.51344895", "0.5133658", "0.5131872", "0.51248366", "0.51216614", "0.51169264", "0.510385", "0.510278", "0.50971717" ]
0.51529294
83
/ Upload the file
public function move($modify = 'original',$overwrite = false) { $path = $this->_destination; if ($this->_uploaded) { $field = current($this->_uploaded); if (is_array($field['name'])) { foreach ($field['name'] as $number => $filename) { // process multiple upload $this->_renamed = false; $this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $path, $modify, $overwrite); } } else { $this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $path, $modify, $overwrite); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload();", "public function upload()\n\t{\n\t}", "public function uploadFile(){\n\n if (!$this->request->is('post'))\n {\n $this->setErrorMessage('Post method required');\n return;\n }\n\n if (!isset($this->request->data['currentPath']) ||\n !isset($this->request->params['form']) ||\n !isset($this->request->params['form']['idia'])\n ){\n $this->setErrorMessage('Invalid parameters');\n return;\n }\n\n $path = ltrim(trim($this->request->data['currentPath']), DS);\n $tokens = explode(DS, strtolower($path));\n\n ($tokens[0] == 'root') && ($tokens = array_slice($tokens, 1, null, true));\n\n $path = implode(DS, $tokens);\n $fullPath = WWW_FILE_ROOT . strtolower($path);\n\n if(!is_dir($fullPath)){\n $this->setErrorMessage('Invalid path');\n return;\n }\n\n if(is_file($fullPath . DS . strtolower($this->request->params['form']['idia']['name']))){\n $this->setErrorMessage('File with similar name already exist');\n return;\n }\n\n $newFile = new File($fullPath . DS . strtolower($this->request->params['form']['idia']['name']), true );\n $newFile->close();\n\n $tempFile = new File(($this->request->params['form']['idia']['tmp_name']));\n $tempFile->copy($fullPath . DS .$this->request->params['form']['idia']['name']);\n $tempFile->delete();\n\n $this->set(array(\n 'status' => 'ok',\n \"message\" => 'successful',\n \"_serialize\" => array(\"message\", \"status\")\n ));\n }", "function upload_file() {\n upload_file_to_temp();\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $partes_ruta = pathinfo($this->getFile()->getClientOriginalName());\n $this->nombre = md5(uniqid()) . '.' . $partes_ruta['extension'];\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->nombre\n );\n\n $this->url = $this->getWebPath();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}", "public function actionUpload()\n\t{\n\n\t\t$input = craft()->request->getPost();\n\n\t\t$file = UploadedFile::getInstanceByName('file');\n\n\t\t$folder = craft()->assets->findFolder(array(\n\t\t 'id' => $input['id']\n\t\t));\n\n\t\tif ($folder) {\n\t\t\t$folderId = $input['id'];\n\t\t}\n\n\t\tcraft()->assets->insertFileByLocalPath(\n\t\t $file->getTempName(),\n\t\t $file->getName(),\n\t\t $folderId,\n\t\t AssetConflictResolution::KeepBoth);\n\n\t\tcraft()->end();\n\t}", "public function upload()\n {\n App::import('Lib', 'Uploads.file_receiver/FileReceiver');\n App::import('Lib', 'Uploads.file_dispatcher/FileDispatcher');\n App::import('Lib', 'Uploads.file_binder/FileBinder');\n App::import('Lib', 'Uploads.UploadedFile');\n\n $this->cleanParams();\n $Receiver = new FileReceiver($this->params['url']['extensions'], $this->params['url']['limit']);\n $Dispatcher = new FileDispatcher(\n Configure::read('Uploads.base'),\n Configure::read('Uploads.private')\n );\n $Binder = new FileBinder($Dispatcher, $this->params['url']);\n try {\n $File = $Receiver->save(Configure::read('Uploads.tmp'));\n $Binder->bind($File);\n $this->set('response', $File->getResponse());\n file_put_contents(LOGS.'mh-uploads.log', date('Y-m-d H:i > ').'Uploaded '.$File->getName().chr(10), FILE_APPEND);\n } catch (RuntimeException $e) {\n file_put_contents(LOGS.'mh-uploads.log', date('Y-m-d H:i > ').$e->getMessage().chr(10), FILE_APPEND);\n $this->set('response', $this->failedResponse($e));\n }\n $this->layout = 'ajax';\n $this->RequestHandler->respondAs('js');\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "abstract protected function doUpload();", "public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = '/'.$this->getUploadDir().'/'.$this->getFile()->getClientOriginalName();\n //get the file name\n// $file = $this->getFile()->getClientOriginalName();\n// $info = pathinfo($file);\n// $file_name = basename($file,'.'.$info['extension']);\n// $this->name = $file_name ;\n// $this->setName($file_name);\n// // clean up the file property as you won't need it anymore\n// $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n \n\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n if(!is_dir($this->getTargetUploadRootDir())){\n mkdir($this->getTargetUploadRootDir(), 0777, true);\n }\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getTargetUploadRootDir(),\n $this->file->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = date('Y-m-d').DIRECTORY_SEPARATOR.$this->id.DIRECTORY_SEPARATOR.$this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function uploadAction()\n {\n // default file URI\n $defaultUri = $this->_config->urlBase . 'files/';\n\n // store for sparql queries\n $store = $this->_owApp->erfurt->getStore();\n\n // DMS NS var\n $dmsNs = $this->_privateConfig->DMS_NS;\n\n // check if DMS needs to be imported\n if ($store->isModelAvailable($dmsNs) && $this->_privateConfig->import_DMS) {\n $this->_checkDMS();\n }\n\n $url = new OntoWiki_Url(\n array('controller' => 'files', 'action' => 'upload'),\n array()\n );\n\n // check for POST'ed data\n if ($this->_request->isPost()) {\n $event = new Erfurt_Event('onFilesExtensionUploadFile');\n $event->request = $this->_request;\n $event->defaultUri = $defaultUri;\n // process upload in plugin\n $eventResult = $event->trigger();\n if ($eventResult === true) {\n if (isset($this->_request->setResource)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('File attachment added', OntoWiki_Message::SUCCESS)\n );\n $resourceUri = new OntoWiki_Url(array('route' => 'properties'), array('r'));\n $resourceUri->setParam('r', $this->_request->setResource, true);\n $this->_redirect((string)$resourceUri);\n } else {\n $url->action = 'manage';\n $this->_redirect((string)$url);\n }\n }\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('Upload File'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n $url->action = 'manage';\n $toolbar->appendButton(\n OntoWiki_Toolbar::SUBMIT, array('name' => 'Upload File')\n );\n $toolbar->appendButton(\n OntoWiki_Toolbar::EDIT, array('name' => 'File Manager', 'class' => '', 'url' => (string)$url)\n );\n\n $this->view->defaultUri = $defaultUri;\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n\n $url->action = 'upload';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'fileupload';\n $this->view->formEncoding = 'multipart/form-data';\n if (isset($this->_request->setResource)) {\n // forward URI to form so we can redirect later\n $this->view->setResource = $this->_request->setResource;\n }\n\n if (!is_writable($this->_privateConfig->path)) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Uploads folder is not writable.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n // FIX: http://www.webmasterworld.com/macintosh_webmaster/3300569.htm\n header('Connection: close');\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload_foto_file()\n\t{\n\t\tif (!$this->is_allowed('m_ads_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'm_ads',\n\t\t]);\n\t}", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n $filename = time().'_'.$this->getFile()->getClientOriginalName();\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::$SERVER_PATH_TO_VIDEO_FOLDER,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->setImageName($this->getFile()->getClientOriginalName());\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload(): void\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload()\n {\n $path = $this->file_path;\n if (!file_exists($path)) {\n mkdir($path, 0777, true);\n }\n\n // Upload file. \n $file_name = strtolower(basename($_FILES['uploaded_file']['name']));\n $file_name = str_replace(' ', '-', $file_name); // Replace spaces with dashes.\n $path = $path . $file_name;\n\n $acceptable = array(\n 'image/jpeg',\n 'image/jpg',\n 'image/gif',\n 'image/png'\n );\n\n if(in_array($_FILES['uploaded_file']['type'], $acceptable)) {\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n\n $file_msg = 'The file '. $path . ' has been uploaded';\n \n // Not ideal but good for now\n \n // Refresh parent on upload.\n echo \"<script>window.parent.location.reload(true);</script>\";\n\n } else {\n\n $file_msg = 'There was a problem with the upload.';\n }\n }\n else {\n\n $file_msg = 'Bad file uploaded.';\n }\n return $file_msg;\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_tol_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_tol',\n\t\t]);\n\t}", "public function uploadAction()\n {\n $logedUser = $this->getServiceLocator()\n ->get('user')\n ->getUserSession();\n $permission = $this->getServiceLocator()\n ->get('permissions')\n ->havePermission($logedUser[\"idUser\"], $logedUser[\"idWebsite\"], $this->moduleId);\n if ($this->getServiceLocator()\n ->get('user')\n ->checkPermission($permission, \"edit\")) {\n $request = $this->getRequest();\n if ($request->isPost()) {\n // Get Message Service\n $message = $this->getServiceLocator()->get('systemMessages');\n \n $files = $request->getFiles()->toArray();\n $temp = explode(\".\", $files[\"file\"][\"name\"]);\n $newName = round(microtime(true));\n $newfilename = $newName . '.' . end($temp);\n $image = new Image();\n $image->exchangeArray(array(\n \"website_id\" => $logedUser[\"idWebsite\"],\n \"name\" => $newName,\n \"extension\" => end($temp)\n ));\n if ($image->validation()) {\n if (move_uploaded_file($_FILES[\"file\"][\"tmp_name\"], \"public/files_database/\" . $logedUser[\"idWebsite\"] . \"/\" . $newfilename)) {\n $result = $this->getImageTable()->saveImage($image);\n $message->setCode($result);\n // Log\n $this->getServiceLocator()\n ->get('systemLog')\n ->addLog(0, $message->getMessage(), $message->getLogPriority());\n die('uploadSucess');\n } else {\n die('uploadError');\n }\n } else {\n die('Invalid extension');\n }\n }\n die(\"forbiden\");\n } else {\n die(\"forbiden - without permission\");\n }\n }", "public function actionUpload()\n {\n if (isset($_GET['department_id_from_url'])) {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/\".$_GET['department_id_from_url'].\"/\" . $filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location, PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\", \"jpeg\", \"png\");\n /* Check file extension */\n if (!in_array(strtolower($imageFileType), $valid_extensions)) {\n $uploadOk = 0;\n echo 0;\n }\n if ($uploadOk == 0) {\n echo 0;\n } else {\n /* Upload file */\n if (move_uploaded_file($_FILES['file']['tmp_name'], $location)) {\n echo $filename;\n } else {\n echo 0;\n }\n }\n }\n }", "public function upload() {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(), $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->photo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload(){\n if( NULL === $this->getFile()){\n return;\n }\n $filename= $this->getFile()->getClientOriginalName();\n\n // Move to the target directory\n \n $this->getFile()->move(\n $this->getAbsolutePath(), \n $filename);\n\n //Set the logo\n $this->setFilename($filename);\n\n $this->setFile();\n\n }", "public function upload($file, $local_file);", "public function upload_file(){\n //return from method if file name is sample\n if($this->file_name == 'sample.jpg'){\n return;\n }\n\n $allowed_types = ['image/jpeg', 'image/gif', 'image/png'];\n //check file is an image\n if(!in_array($this->file_type, $allowed_types)){\n throw new Exception('File must be an image');\n exit;\n }\n\n //move from temp dir in to uploads folder\n move_uploaded_file($this->tmp_file_name, $this->dir_location . $this->file_name );\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->backgroundImage = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->avatar)\n {\n return;\n }\n\n //Lastname du fichier\n $file = $this->id_user.'.'.$this->avatar->guessExtension();\n // move takes the target directory and then the target filename to move to\n $this->avatar->move($this->getUploadRootDir(), $file);\n //Suppression des thumbnail déjà en cache\n @unlink(__DIR__.'/../../../../../web/imagine/thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/avatar_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/moyen_thumbnail/avatars/'.$file);\n @unlink(__DIR__.'/../../../../../web/imagine/mini_thumbnail/avatars/'.$file);\n\n // set the path property to the filename where you'ved saved the file\n $this->avatar = $file;\n }", "public function handle_upload()\n {\n }", "public function upload_file_file()\n\t{\n\t\tif (!$this->is_allowed('dokumentasi_bendungan_add', false)) {\n\t\t\techo json_encode([\n\t\t\t\t'success' => false,\n\t\t\t\t'message' => cclang('sorry_you_do_not_have_permission_to_access')\n\t\t\t\t]);\n\t\t\texit;\n\t\t}\n\n\t\t$uuid = $this->input->post('qquuid');\n\n\t\techo $this->upload_file([\n\t\t\t'uuid' \t\t \t=> $uuid,\n\t\t\t'table_name' \t=> 'dokumentasi_bendungan',\n\t\t]);\n\t}", "protected function uploadFile()\n {\n return $this->getTelegram()->uploadFile(\n $this->method->apiEndpoint(),\n $this->method->toArray(),\n $this->method->fileUploadField()\n );\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n $path = ($this->isPublic()) ? 'public' : 'sections' . '/' . strtolower($this->getSection()->getCode());\n\n if (!is_dir($this->getUploadRootDir(). '/' .$path)){\n if (!mkdir($this->getUploadRootDir(). '/' .$path)){\n throw new \\Exception('Create dir exception');\n }\n }\n\n $filename = sha1(uniqid(mt_rand(), true)).'.'.$this->getFile()->guessExtension();\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(). '/' .$path,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $path . '/' . $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload($file) {\n /*\n ** is there some file to upload\n */\n if (isset($file))\n FileLoaderController::setFiles($file);\n else\n API::error('No file found.');\n\n /*\n ** Upload the current media\n */\n FileLoaderController::upload($this);\n\n }", "public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }", "public function upload(): void\n {\n // check if we have an old image\n if ($this->oldFileName !== null) {\n $this->removeOldFile();\n }\n\n if (!$this->hasFile()) {\n return;\n }\n\n $this->writeFileToDisk();\n\n $this->file = null;\n }", "public function UploadFile()\n {\n # ==============================================================================\n \n if (!empty($_FILES)) {\n $tempFile = $_FILES['Filedata']['tmp_name'];\n $targetPath = $_SERVER['DOCUMENT_ROOT'] . $_REQUEST['folder'] . '/';\n \n $original_name = $_FILES['Filedata']['name'];\n $name_parts = explode('.', $original_name);\n $parts_count = count($name_parts)-1;\n $extension = $name_parts[$parts_count];\n \n $new_name = \"{$this->Sessions_Id}.{$extension}\";\n $targetFile = str_replace('//','/',$targetPath) . $new_name;\n \n $result = move_uploaded_file($tempFile, $targetFile);\n if (!$result) {\n echo \"FAILED TO MOVE FILE\";\n }\n echo str_replace($_SERVER['DOCUMENT_ROOT'], '', $targetFile);\n $this->UpdateSessionChecklist();\n }\n }", "public function uploadAction()\n\t{\n\t\t$chunkSize = $this->getSizeTempFile();\n\n\t\t$isUploadStarted = ($this->uploadedPart > 0);\n\t\tif (!$isUploadStarted)\n\t\t{\n\t\t\t$reservedSize = round($chunkSize * ceil($this->totalItems / $this->pageSize) * 1.5);\n\n\t\t\t$this->uploadPath = $this->generateUploadDir(). $this->fileName;\n\n\t\t\t$this->findInitBucket(array(\n\t\t\t\t'fileSize' => $reservedSize,\n\t\t\t\t'fileName' => $this->uploadPath,\n\t\t\t));\n\n\t\t\tif ($this->checkCloudErrors())\n\t\t\t{\n\t\t\t\t$this->saveProgressParameters();\n\n\t\t\t\tif ($this->bucket->FileExists($this->uploadPath))\n\t\t\t\t{\n\t\t\t\t\tif(!$this->bucket->DeleteFile($this->uploadPath))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->addError(new Error('File exists in a cloud.'));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->instanceBucket();\n\n\t\t\t$this->checkCloudErrors();\n\t\t}\n\n\n\t\tif (!file_exists($this->filePath))\n\t\t{\n\t\t\t$this->addError(new Error('Uploading file not exists.'));\n\t\t}\n\n\t\tif (count($this->getErrors()) > 0)\n\t\t{\n\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t}\n\n\n\t\t$isSuccess = false;\n\n\t\tif ($this->isExportCompleted && !$isUploadStarted)\n\t\t{\n\t\t\t// just only one file\n\t\t\t$uploadFile = array(\n\t\t\t\t'name' => $this->fileName,\n\t\t\t\t'size' => $this->fileSize,\n\t\t\t\t'type' => $this->fileType,\n\t\t\t\t'tmp_name' => $this->filePath,\n\t\t\t);\n\n\t\t\tif ($this->bucket->SaveFile($this->uploadPath, $uploadFile))\n\t\t\t{\n\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t$isSuccess = true;\n\t\t\t\t$this->isUploadFinished = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->addError(new Error('Uploading error.'));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$uploader = new \\CCloudStorageUpload($this->uploadPath);\n\t\t\tif (!$uploader->isStarted())\n\t\t\t{\n\t\t\t\tif (!$uploader->Start($this->bucketId, $reservedSize, $this->fileType))\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('Start uploading error.'));\n\n\t\t\t\t\treturn AjaxJson::createError($this->errorCollection);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$part = $this->getContentTempFile();\n\n\t\t\twhile ($uploader->hasRetries())\n\t\t\t{\n\t\t\t\tif ($uploader->Next($part, $this->bucket))\n\t\t\t\t{\n\t\t\t\t\t$this->uploadedPart ++;\n\t\t\t\t\t$this->uploadedSize += $chunkSize;\n\t\t\t\t\t$isSuccess = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunset($part);\n\n\t\t\t// finish\n\t\t\tif ($isSuccess && $this->isExportCompleted)\n\t\t\t{\n\t\t\t\tif ($uploader->Finish())\n\t\t\t\t{\n\t\t\t\t\t$this->isUploadFinished = true;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->addError(new Error('FILE_UNKNOWN_ERROR'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($isSuccess)\n\t\t{\n\t\t\t$this->dropTempFile();\n\t\t}\n\n\t\t// Save progress\n\t\t$this->saveProgressParameters();\n\n\t\t// continue export into temporally file\n\t\t$result = $this->preformAnswer(self::ACTION_UPLOAD);\n\t\t$result['STATUS'] = self::STATUS_PROGRESS;\n\n\t\treturn $result;\n\t}", "public function uploadFile()\r\n\t{\r\n\t\t// Validate the container\r\n\t\t$this->_container = $this->getContainer();\r\n\t\tif ($this->_container == NULL)\r\n\t\t\treturn array('error' => Yii::t('ciims.misc', 'Unable to attach OpenStack Container.'));\r\n\r\n\t\t$validation = $this->validateFile();\r\n \r\n if (isset($validation['error']))\r\n \treturn $validation;\r\n else\r\n {\r\n \t$filename = $validation['data']['filename'];\r\n \t$data = $validation['data']['data'];\r\n \t$ext = $validation['data']['ext'];\r\n }\r\n\r\n try {\r\n \t$response = $this->_container->uploadObject($filename.'.'.$ext, $data, array());\r\n \tif ($response)\r\n\t \t return array('success'=>true,'filename'=> $filename.'.'.$ext, 'url' => $this->_container->getCDN()->getMetadata()->getProperty('Ssl-Uri'));\r\n\t else\r\n\t \treturn array('error'=> Yii::t('ciims.misc', 'Could not save uploaded file. The upload was cancelled, or server error encountered'));\r\n } catch (Exception $e) {\r\n \treturn array('error'=> Yii::t('ciims.misc', 'The server encountered an error during uploading. Please verify that you have saufficient space in the container and that your quota has not been reached.'));\r\n }\r\n\t}", "function media_upload_file()\n {\n }", "public function upload()\n {\n if (!Request::hasPost('requestToken') || !RequestToken::validate(Request::getPost('requestToken'))) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Invalid Request Token!');\n $objResponse->output();\n }\n\n if (!Request::getInstance()->files->has($this->name)) {\n return;\n }\n\n $objTmpFolder = new \\Folder(MultiFileUpload::UPLOAD_TMP);\n\n // contao 4 support, create tmp dir symlink\n if (version_compare(VERSION, '4.0', '>=')) {\n // tmp directory is not public, mandatory for preview images\n if (!file_exists(System::getContainer()->getParameter('contao.web_dir') . DIRECTORY_SEPARATOR . MultiFileUpload::UPLOAD_TMP)) {\n $objTmpFolder->unprotect();\n $command = new SymlinksCommand();\n $command->setContainer(System::getContainer());\n $input = new ArrayInput([]);\n $output = new NullOutput();\n $command->run($input, $output);\n }\n }\n\n $strField = $this->name;\n $varFile = Request::getInstance()->files->get($strField);\n // Multi-files upload at once\n if (is_array($varFile)) {\n // prevent disk flooding\n if (count($varFile) > $this->maxFiles) {\n $objResponse = new ResponseError();\n $objResponse->setMessage('Bulk file upload violation.');\n $objResponse->output();\n }\n\n /**\n * @var UploadedFile $objFile\n */\n foreach ($varFile as $strKey => $objFile) {\n $arrFile = $this->uploadFile($objFile, $objTmpFolder->path, $strField);\n $varReturn[] = $arrFile;\n\n if (\\Validator::isUuid($arrFile['uuid'])) {\n $arrUuids[] = $arrFile['uuid'];\n }\n }\n } // Single-file upload\n else {\n /**\n * @var UploadedFile $varFile\n */\n $varReturn = $this->uploadFile($varFile, $objTmpFolder->path, $strField);\n\n if (\\Validator::isUuid($varReturn['uuid'])) {\n $arrUuids[] = $varReturn['uuid'];\n }\n }\n\n if ($varReturn !== null) {\n $this->varValue = $arrUuids;\n $objResponse = new ResponseSuccess();\n $objResult = new ResponseData();\n $objResult->setData($varReturn);\n $objResponse->setResult($objResult);\n\n return $objResponse;\n }\n }", "private function uploadFile()\n {\n $uid = $this->param[2];\n $src = $_FILES['Filedata']['tmp_name'];\n $dst = TEMP_DIR . '/' . $uid . $_FILES['Filedata']['name'];\n \n if(@move_uploaded_file($src, $dst))\n {\n $data = \"{$_FILES['Filedata']['name']}:$dst:{$_FILES['Filedata']['size']}\";\n echo $data;\n }\n exit;\n }", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\r\n\t\t$imgId = $this->getInput('imgId');\r\n\t\t$this->assign('imgId', $imgId);\r\n\t\t$this->getView()->display('common/upload.phtml');\r\n\t\texit;\r\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction() {\n\t\t$imgId = $this->getInput('imgId');\n\t\t$this->assign('imgId', $imgId);\n\t\t$this->getView()->display('common/upload.phtml');\n\t\texit;\n\t}", "public function uploadAction()\n {\n if ($this->request->hasFiles() == true) {\n\n // Print the real file names and sizes\n foreach ($this->request->getUploadedFiles() as $file) {\n // 获取文件的MD5\n $filesModels = new Files();\n $fileInfo = $filesModels->uploadFiles($file);\n \n $movePath = $fileInfo['movePath'];\n $fileUrl = $fileInfo['fileUrl'];\n \n if(file_exists($movePath)) { \n $jsonReturn = array(\n 'success' => 'true',\n 'msg' => '上传成功',\n 'file_path' => $fileUrl\n );\n echo json_encode($jsonReturn); \n } else {\n $jsonReturn = array(\n 'success' => 'false',\n 'msg' => '上传失败'\n );\n echo json_encode($jsonReturn); \n }\n \n }\n }\n\n $this->view->setRenderLevel(View::LEVEL_NO_RENDER);\n }", "public function upload()\n\t {\n\t\t $this->validator->validate( Input::all() );\n\n\t\t $data = $this->upload->upload( Input::file('file') , Input::get('destination') );\n\n $colloque_file = $this->file->create(\n array(\n 'filename' => $data['name'],\n 'type' => Input::get('type'),\n 'colloque_id' => Input::get('colloque_id')\n )\n );\n\n return Redirect::back()->with( array('status' => 'success' , 'message' => 'Fichier ajouté') );\n\n\t }", "function fileCommit(){\n\t\t// Target folder, make sure it is 777\n\t\t$target = \"uploads/\";\n\t\t\n\t\t// Appends the file name\n\t\t$target = $target . basename( $_FILES['file']['name']);\n\t\t\n\t\t// Moves the file to target\n\t\tmove_uploaded_file($_FILES['file']['tmp_name'], $target);\n\t\tif($_POST['sqlType'] == \"create\") {\n\t\t\t$result = mysql_query(createObject(getLangVar(\"userId\"), $_POST['objectText'], $_POST['parentId'], $_POST['objectTitle']));\n\t\t\t$result = mysql_query(createFile(fullURL($_FILES[\"file\"][\"name\"], \"uploads\"), $_FILES[\"file\"][\"size\"], $_FILES[\"file\"][\"type\"], mysql_insert_id()));\n\t\t\t$forwardId = mysql_insert_id();\n\t\t} else if($_POST['sqlType'] == \"edit\") {\n\t\t\t$result = mysql_query(editObject($_POST['objectText'], $_POST['parentId'], $_POST['objectTitle'], $_POST['objectId']));\n\t\t\t$result = mysql_query(editFile());\n\t\t\t$forwardId = $_POST['fileId'];\n\t\t}\n\t\theader('Location:' . fullURL(getLangVar(\"fileURL\") . $forwardId));\n\t}", "public function uploadFileAdmin(){\r\n $file = Input::file('file');\r\n $projectId = Input::get('PROJECT');\r\n $adminId = Input::get('CONSULTANT');\r\n $project = Project::find($projectId);\r\n if($project!=null){\r\n if($file){\r\n $fileName = $file->getClientOriginalName();\r\n $file->move(public_path().'/files/projects/'.$project->lead->fileno.'/'.$project->id.'/uploaded', $fileName);\r\n //create the row in upload file\r\n $uploadFile = new UploadedFiles();\r\n $uploadFile->project_id = $projectId;\r\n $uploadFile->url = \"files/projects/\".$project->lead->fileno.\"/\".$project->id.\"/uploaded/$fileName\";\r\n $uploadFile->fileName = $fileName;\r\n $uploadFile->admin_id = $adminId;\r\n $uploadFile->ip = $_SERVER[\"REMOTE_ADDR\"];\r\n $uploadFile->save();\r\n ToolsFunctions::notifyGeorgeOfFileUpload($project);\r\n }\r\n }\r\n }", "public function actionUpload() {\n Yii::import(\"ext.EAjaxUpload.qqFileUploader\");\n //$extfd =Yii::app()->params['seaFirext'];//Extension de firma electronica\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n //$folder =Yii::app()->params['rutaDoc'];// folder for uploaded files\n $folder =Yii::app()->params['rutaDoc'].$cli_Id.\"/\";// folder for uploaded files\n if (!file_exists($folder)) {\n mkdir($folder, 0777, true); //Se Crea la carpeta\n chmod(dirname($folder), 0777);\n //chmod($folder_path, 0777); \n }\n //VSValidador::putMessageLogFile($folder);\n //$folder = getcwd().\"/file/uploads/\"; //mUESTRA TODA LA RUTA DEL PROYECTO\n //$allowedExtensions = array($extfd, \"pdf\"); //array(\"jpg\",\"jpeg\",\"gif\",\"exe\",\"mov\" and etc...\n $allowedExtensions = array(\"jpg\", \"pdf\"); //array(\"jpg\",\"jpeg\",\"gif\",\"exe\",\"mov\" and etc...\n $sizeLimit = 10 * 1024 * 1024; // maximum file size in bytes\n $uploader = new qqFileUploader($allowedExtensions, $sizeLimit);\n $result = $uploader->handleUpload($folder);\n $return = htmlspecialchars(json_encode($result), ENT_NOQUOTES);\n\n $fileSize = filesize($folder . $result['filename']); //GETTING FILE SIZE\n $fileName = $result['filename']; //GETTING FILE NAME //Retorna el Nombre del Archivo a subir\n\n echo $return; // it's array \n }", "function upload($path) {\r\n\t\t$ok = false;\r\n\r\n\t\t$this->uploadpath .= $path . '/';\r\n\r\n\t\tif ($this->validate()) {\r\n\t\t\t$this->filename = $this->params['form']['Filedata']['name'];\r\n\t\t\t$ok = $this->write();\r\n\t\t}\r\n\t\t\r\n\t\tif (!$ok) {\r\n\t\t\theader(\"HTTP/1.0 500 Internal Server Error\");\t//this should tell SWFUpload what's up\r\n\t\t\t$this->setError();\t//this should tell standard form what's up\r\n\t\t}\r\n\t\t\r\n\t\treturn ($ok);\r\n\t}", "public function upload($input);", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "public static function upload_file($file,$path){\n\t\t\t $filename = $file['name'];\n $source = $file['tmp_name'];\n\t\t\t $ext = pathinfo($filename,PATHINFO_EXTENSION);\n\t\t\t $size = $file['size'] / 1000000;\n\t\t\t self::$filesize = number_format((float)$size, 2, '.', '');\n\t\t\t self::$filesize .= 'MB';\n\n\t\t\t if (self::$name)\n\t\t\t {\n\t\t\t\t $target = $path.self::$name.\".\".$ext;\n\t\t\t\t self::$filename = self::$name.\".\".$ext; \n\t\t\t } \n\t\t\t else \n\t\t\t {\n\t\t\t \t$target = $path.$filename; \n\t\t\t }\n move_uploaded_file($source, $target);\n\t\t}", "public function upload()\n {\n set_time_limit(0);\n //Clear error messages\n Registry::getMessages();\n //Config\n $config = Registry::getConfig();\n //Upload Handler\n new UploadHandler(\n array(\n 'upload_dir' => $config->get(\"path\").\"/files/videos/\",\n 'upload_url' => Url::site(\"files/videos\").\"/\",\n \"maxNumberOfFiles\" => 1,\n \"accept_file_types\" => \"/\\.(mp4|mpg|flv|mpeg|avi)$/i\",\n )\n );\n }", "public function uploadfileAction(){\n \t$cand_model = new Default_Model_Candidatedetails();\n \t$result = $cand_model->saveUploadedFile($_FILES);\n \t$this->_helper->json($result);\n }", "private function upload(){\n global $VALID_FILES;\n $status = new StatusTYPE();\n\t\ttry{\n\t\t\tif ( !$this->getID() || !$this->file || !$this->ext || !$this->size)\n\t\t\t\tthrow new Exception('Missing Param(s)');\n if ( !in_array( $this->ext, $VALID_FILES ) )\n\t\t\t\tthrow new Exception($this->ext.' is not a valid file extension');\n\t\t\tif ( $this->size > MAX_FILE_SIZE )\n\t\t\t\tthrow new Exception('file is too large');\n\t\t\t\n\t\t\tif (!$this->getFull_Filename())\n\t\t\t\t$this->setFull_Filename();\n $filename = $this->getFull_Filename();\n\t\t\t\n\t\t\t$data = explode('base64', $this->file);\n\t\t\t$data = $data[1];\n\t\t\t$success = file_put_contents($filename, base64_decode($data));\n if ( !$success )\n\t\t\t\tthrow new Exception('could not upload file');\n }\n\t\tcatch (Exception $e){\n\t\t\t$status->setFalse($e->getMessage());\n\t\t} \n return $status; \n }", "public function uploadAction() {\n $imgId = $this->getInput('imgId');\n $this->assign('imgId', $imgId);\n $this->getView()\n ->display('common/upload.phtml');\n }", "public function step_2_manage_upload()\n {\n }", "public function upload($file,$path_name,$encoding='binary',$chmod=0775)\n\t{\n\t\t\n\t\t$config['hostname'] = 'endeavor1.servillianhosting.com';\n\t\t$config['username'] = '[email protected]';\n\t\t$config['password'] = 'j1135#weep';\n\n\t\tparent::connect($config); \n\t\t\n\t\t//append the root onto the path name every time\n\t\t$full_path = $this->get_server_http_root().$path_name;\n\t\t \n\t\t$s = parent::upload($file,$full_path,$encoding,$chmod);\n\t\tparent::close(); \n\t\treturn $s;\n\t}", "public function handleUploadFile() {\n\t\t$this->templateName = 'Upload.latte';\n\n\t\t$this->storage->addFile($_FILES['upload']['tmp_name'], $_FILES['upload']['name']);\n\n\t\t$this->template->url = $this->template->basePath . '/' . $this->storage->getBaseUrl() . '/' . $_FILES['upload']['name'];\n\t\t$this->template->message = 'Soubor byl nahrán';\n\t\t$this->template->setFile(__DIR__ . '/templates/' . $this->templateName);\n\t\t$this->template->render();\n\t\t$this->getPresenter()->terminate();\n\t}", "public function uploadfile($refdoc){\n\t\t$filename = $_FILES['file']['name'];\n\t\t$filename = $filename;\n\t\t$location = \"./images/grfile/\". $filename;\n\t\t$temp = $_FILES['file']['tmp_name'];\n\t\t$fileType = pathinfo($location,PATHINFO_EXTENSION);\n\t\t$acak = rand(000000,999999);\t\n\n\t\t// move_uploaded_file($temp, $location);\n\t\t$this->model('Grpo_model')->uploadfile($refdoc, $temp, $location, $filename, $fileType);\n\t\tmove_uploaded_file($temp, $location);\n\t\t// /* Valid Extensions */\n\t\t// $valid_extensions = array(\"jpg\",\"jpeg\",\"png\");\n\t\t// /* Check file extension */\n\t\t// if( !in_array(strtolower($imageFileType),$valid_extensions) ) {\n\t\t// \t$uploadOk = 0;\n\t\t// }\n\n\t\t// if($uploadOk == 0){\n\t\t// echo 0;\n\t\t// }else{\n\t\t// /* Upload file */\n\t\t// if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){\n\t\t// \techo $location;\n\t\t// }else{\n\t\t// \techo 0;\n\t\t// }\n\t}", "function uploadFiles () {\n\n}", "function upload($file, $end_path) {\n $auth = '';\n $date= getdate();\n $size = filesize($file);\n $path = $end_path.'/'.$date['year'].'-'.$date['mon'].'-'.$date['mday'].'/'.$file;\n $fp = fopen($file, 'r');\n $cheaders = array('Authorization: Bearer ' .$auth.'jMxNU5Ezc-gAAAAAAAAAAQLxvI0If8AV4wHpthpOmIRTKJr0otk_cUH7YiGw-_SU',\n 'Content-Type: application/octet-stream',\n 'Dropbox-API-Arg: {\"path\":\"/'.$path.'\", \"mode\":\"add\"}');\n\n $ch = curl_init('https://content.dropboxapi.com/2/files/upload');\n curl_setopt($ch, CURLOPT_HTTPHEADER, $cheaders);\n curl_setopt($ch, CURLOPT_PUT, true);\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');\n curl_setopt($ch, CURLOPT_INFILE, $fp);\n curl_setopt($ch, CURLOPT_INFILESIZE, $size);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($ch);\n\n curl_close($ch);\n fclose($fp);\n }", "public function uploadFile(UploadFileRequest $request): UploadFileResponse\n {\n }", "public function upload(){\n\t\t\techo \"-->Uploading your file.<br/>\";\n\t\t\t//Check if the upload directory exists.\n\t\t\tif(!is_dir($this->upload_dir)){\n\t\t\t\t//Advice the user the upload directory does not exist\n\t\t\t\techo $this->upload_dir . \" directory does not exist.<br/>\";\n\t\t\t\t//And that we will attempt to create it\n\t\t\t\techo \"Attempting to create \" . $this->upload_dir . \" directory.<br/>\";\n\t\t\t\t//Attempt to make a new upload directory\n\t\t\t\tif(!mkdir($this->upload_dir, 0777, true)){\n\t\t\t\t\t//If it fails inform the user that the operation failed\n\t\t\t\t\techo \"Error creating the \" . $this->upload_dir . \" directory.<br/>\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Move the uploaded CSV file into the upload directory\n\t\t\tif(move_uploaded_file($this->csv_file['tmp_name'],$this->upload_dir . \"/\" . $this->csv_file['name'])){\n\t\t\t\t//If the moving operation succeeds the function will return true\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\t//Otherwise it will return false\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n $this->picture = file_get_contents($this->getFile());\n\n if (isset($this->temp)) {\n $this->temp = null;\n }\n\n $this->file = null;\n }", "public function upload(){\n\n\t\tif(move_uploaded_file($this->tmp_name,$this->uploadFile)){\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// throw exception according to error number\n\n\t\tswitch($this->error){\n\n\t\t\tcase 1:\n\n\t\t\tthrow new Exception('Target file exceeds maximum allowed size.');\n\n\t\t\tbreak;\n\n\t\t\tcase 2:\n\n\t\t\tthrow new Exception('Target file exceeds the MAX_FILE_SIZE value specified on the upload form.');\n\n\t\t\tbreak;\n\n\t\t\tcase 3:\n\n\t\t\tthrow new Exception('Target file was not uploaded completely.');\n\n\t\t\tbreak;\n\n\t\t\tcase 4:\n\n\t\t\tthrow new Exception('No target file was uploaded.');\n\n\t\t\tbreak;\n\n\t\t\tcase 6:\n\n\t\t\tthrow new Exception('Missing a temporary folder.');\n\n\t\t\tbreak;\n\n\t\t\tcase 7:\n\n\t\t\tthrow new Exception('Failed to write target file to disk.');\n\n\t\t\tbreak;\n\n\t\t\tcase 8:\n\n\t\t\tthrow new Exception('File upload stopped by extension.');\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}", "public function upload(){\n \n if(!empty($_FILES['uploaded_file']))\n {\n $path = \"upload/\";\n $path = $path . basename( $_FILES['uploaded_file']['name']);\n\n if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $path)) {\n echo \"The file \". basename( $_FILES['uploaded_file']['name']). \n \" has been uploaded\";\n return $path;\n } else{\n echo \"There was an error uploading the file, please try again!\";\n }\n }\n }", "public function uploadFileToCloud() {\n\n\t\ttry {\n\n\t\t\tif (!Request::hasFile('file')) throw new \\Exception(\"File is not present.\");\n\n\t\t\t$attachmentType = Request::input('attachment_type');\n\n\t\t\tif (empty($attachmentType)) throw new \\Exception(\"Attachment type is missing.\");\n\n\t\t\t$file = Request::file('file');\n\n\t\t\tif (!$file->isValid()) throw new \\Exception(\"Uploaded file is invalid.\");\n\n\t\t\t$fileExtension = strtolower($file->getClientOriginalExtension());\n\t\t\t$originalName = $file->getClientOriginalName();\n\n\t\t\tif ($attachmentType == 'image' || $attachmentType == 'logo') {\n\t\t\t\tif (!in_array($fileExtension, array('jpg', 'png', 'tiff', 'bmp', 'gif', 'jpeg', 'tif'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t} else if ($attachmentType == 'audio') {\n\t\t\t\tif (!in_array($fileExtension, array('mp3', 'wav'))) throw new \\Exception(\"File type is invalid.\");\n\t\t\t}\n\n\t\t\t$additionalImageInfoString = Request::input('additionalImageInfo');\n\n\t\t\t$attachmentObj = ConnectContentAttachment::createAttachmentFromFile(\\Auth::User()->station->id, $file, $attachmentType, $originalName, $fileExtension, $additionalImageInfoString);\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => array('attachment_id' => $attachmentObj->id, 'filename' => $originalName, 'url' => $attachmentObj->saved_path)));\n\n\t\t} catch (\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\n\t}", "public function ieditor_upload () {\n\t\t\tif (!empty($_FILES)) {\n\t\t\t\t$oUploadedFile = umiImageFile::upload('eip-ieditor-upload-fileinput', 0, CURRENT_WORKING_DIR . '/images/cms/data');\n\t\t\t\t// Переопределение стандартного вывода, чтобы выводилась просто строка с путем к файлу в plain text, без json.\n\t\t\t\t// Это нужно для обхода особенностей работы IE, который при выводе в hidden iframe валидного JSON предлагает его сохранить как файл.\n\t\t\t\t$buffer = new HTTPOutputBuffer();\n\t\t\t\t$buffer->push($oUploadedFile->getFilePath(true));\n\t\t\t\t$buffer->send();\n\t\t\t\texit();\n\t\t\t}\n\t\t}", "public function upload()\n\t{\t\n\t\t// Grab the input file\n\t\t$this->file = Input::file('file');\t\n\n\t\t// Validate rules\n\t\t$rules = array(\n\t\t\t'file' => 'image|max:2000'\n\t\t);\n\n\t\t// New Validator instance\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\t// Validate the file\n\t\tif ($validator->fails()) {\n\t\t\t// Grab all error messages\n\t\t\t$errors = $validator->messages();\n\n\t\t\t$err_msg = '';\n\n\t\t\tforeach ($errors->all(':message') as $error) {\n\t\t\t\t$err_msg .= $error .' ';\n\t\t\t}\n\t\t\t\n\t\t\treturn Response::json(array('error' => $err_msg));\n\t\t}\n\n\t\t// Get the directory\n\t\t$this->dir = $this->getDirectory();\n\t\t// Move the file into the folder\n\t\treturn $this->moveFile();\n\t\t\n\t}", "function upload($upload) {\n\t\t$file = $upload->getFile ();\n\t\t$userid = $upload->getUserid ();\n\t\t\n\t\t// echo $file;\n\t\t// exit();\n\t\t\n\t\t// 判断是否上传成功的标志\n\t\t$flag = false;\n\t\t\n\t\t// 获取文件的大小\n\t\t$file_size = $file ['size'];\n\t\tif ($file_size > 2 * 1024 * 1024) {\n\t\t\techo \"文件过大,不能上传大于2M的文件\";\n\t\t\texit ();\n\t\t}\n\t\t\n\t\t// 获取文件的类型\n\t\t// $file_type = $file ['type'];\n\t\t// if ($file_type != 'image/jpeg' && $file_type != 'imgage/pjepg') {\n\t\t// echo \"文件类型只能是jpg的\";\n\t\t// exit ();\n\t\t// }\n\t\t\n\t\t// 判断上传是否成功\n\t\t\n\t\tif (is_uploaded_file ( $file ['tmp_name'] )) {\n\t\t\t// 把这个文件转存到你希望的目录\n\t\t\t$uploaded_file = $file ['tmp_name'];\n\t\t\t\n\t\t\t// 我们给每个用户动态的创建一个文件夹\n\t\t\t$user_path = $_SERVER ['DOCUMENT_ROOT'] . Common::$uploadPath . $userid;\n\t\t\t\n\t\t\t// $user_path=iconv(\"utf-8\",\"gb2312\",$user_path);\n\t\t\t\n\t\t\t// 判断该用户是否已经有文件夹\n\t\t\tif (! file_exists ( $user_path )) {\n\t\t\t\tmkdir ( iconv ( \"utf-8\", \"gb2312\", $user_path ) );\n\t\t\t}\n\t\t\t\n\t\t\t// $move_to_file=$user_path.\"/\".$_FILES['myfile']['name'];\n\t\t\t\n\t\t\t// $file_type=$_FILES['myfile']['name']\n\t\t\t$file_true_name = $file_type = $file ['name'];\n\t\t\t\n\t\t\t$file_true_type = substr ( $file_true_name, strrpos ( $file_true_name, \".\" ) );\n\t\t\t$file_final_name = \"\" . time () . rand ( 1, 1000 ) . $file_true_type;\n\t\t\t$move_to_file = $user_path . \"/\" . $file_final_name;\n\t\t\t$upload->setFile_final_name ( $file_final_name );\n\t\t\t\n\t\t\t// echo $move_to_file;\n\t\t\t// exit ();\n\t\t\t\n\t\t\t// echo $move_to_file;\n\t\t\t// echo \"<br/>$uploaded_file\";\n\t\t\t// exit();\n\t\t\t\n\t\t\t// echo $uploaded_file.\"||\".$move_to_file;\n\t\t\tif (move_uploaded_file ( $uploaded_file, iconv ( \"utf-8\", \"gb2312\", $move_to_file ) )) {\n\t\t\t\t$flag = true;\n\t\t\t} else {\n\t\t\t}\n\t\t} else {\n\t\t}\n\t\t\n\t\t$upload->setFlag ( $flag );\n\t}", "public function uploadFile()\n {\n $isWidget = Input::get('w', 0);\n $file = Input::file('file');\n\n if ($file->isValid())\n {\n if (bytes2mb($file->getSize()) <= 10)\n {\n if (in_array($file->getClientOriginalExtension(), ['pdf', 'doc', 'docx'])) {\n $path = 'files/' . date('Y') . '/' . date('m');\n $destination = File::makeDirectory(public_path($path), 0755, true);\n $filename = File::nameGenerate($file->getClientOriginalName(), $destination);\n $file->move($destination, $filename);\n\n $file = FileLibrary::create(['author_id' => $this->user->id]);\n $file_path = $path . '/' . $filename;\n foreach (array_keys(Lang::allLocales()) as $lang) {\n FileLibraryLanguage::create(['lang' => $lang, 'file_id' => $file->id, 'file_path' => $file_path]);\n }\n\n $action = $isWidget ? 'view' : 'edit';\n $output['result'] = ['thumb_url' => thumb_url('files/icon.png', 130), 'file_url' => admin_url('files-library/' . $action, $file->id)];\n } else {\n $output['error'] = 'This file is not an file file.';\n }\n } else {\n $output['error'] = 'This file size is too large. It should be less than 10 MB.';\n }\n } else {\n $output['error'] = 'File not found.';\n }\n\n return Response::json($output);\n }", "public function upload(){\n if (null === $this->getProductsFileImage()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getProductsFileImage()->move(\n $this->getUploadRootDir(),\n $this->getProductsFileImage()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getProductsFileImage()->getClientOriginalName();\n $this->productsImage = $this->getProductsFileImage()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->productsFileImage = null;\n }", "public function upload()\n{\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n //$this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n}", "public function upload(){\n if($this->validateFile()){\n if(move_uploaded_file($this->tmpLocation, $this->fullUploadPath)){\n return true;\n }else{\n $this->addError(['Upload Error','File Upload Failed']);\n return false;\n }\n }\n return false;\n }", "public function actionUploadImageNews()\n {\n $filename = $_FILES['file']['name'];\n /* Location */\n $location = \"C:/OpenServer/domains/localhost/application/photo/news/\".$filename;\n $uploadOk = 1;\n $imageFileType = pathinfo($location,PATHINFO_EXTENSION);\n /* Valid Extensions */\n $valid_extensions = array(\"jpg\",\"jpeg\",\"png\");\n /* Check file extension */\n if( !in_array(strtolower($imageFileType),$valid_extensions) ) {\n $uploadOk = 0;\n }\n if($uploadOk == 0){\n echo 0;\n }else{\n /* Upload file */\n if(move_uploaded_file($_FILES['file']['tmp_name'],$location)){\n echo $filename;\n\n }else{\n // echo 0;\n }\n }\n }", "public function uploadAction($file) {\n\t\t\n\t\t$renderPartial = $this->request->hasArgument('renderPartial') ? $this->request->getArgument('renderPartial') : '';\n\t\t$mode = $this->request->hasArgument('mode') ? $this->request->getArgument('mode') : '';\n\t\t$filetype = $this->request->hasArgument('filetype') ? $this->request->getArgument('filetype') : 'file';\n\t\tif ($filetype == 'pdf') {\n\t\t\tif ($file->getOriginalResource()->getFileextension() !== 'pdf') {\n\t\t\t\t$this->forward('new', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($this->persistenceManager->isNewObject($file)) {\n\t\t\t$this->fileResourceRepository->add($file);\n\t\t} else {\n\t\t\t$this->fileResourceRepository->update($file);\n\t\t}\n\t\t\n\t\t$this->forward('edit', NULL, NULL, array('file' => $file,'mode'=>$mode,'renderPartial'=>$renderPartial, 'filetype' => $filetype));\n\t}", "function uploadObject();", "public static function uploadfile($upload_file){\r\n\t\t\r\n\t\t$file_store_options = array(\"base_dir\" => $file_upload_dir);\r\n\t\t\r\n \tif (empty($upload_file) && empty($_FILES) && empty($_POST) && isset($_SERVER['REQUEST_METHOD']) && strtolower($_SERVER['REQUEST_METHOD']) == 'post') {\r\n \t\tthrow new FileHandlerException($error_msg, Error::FILE_SIZE_EXCEEDED, \"upload_err_size_exceeded\");\r\n \t}\r\n $file = new Filesobject();\r\n $file->file_orig_name = $upload_file['name'];\r\n $file->file_size\t = $upload_file['size'];\r\n $path_parts = pathinfo($file->file_orig_name);\r\n $file->file_extension = strtolower($path_parts['extension']);\r\n $file->file_mime_type = $upload_file['type'];\r\n $file->file_tmp_name = $upload_file['tmp_name'];\r\n $error = $upload_file['error']; \r\n if($error) {\r\n $error_msg = $this->uploadErrors[$error];\r\n if($error == UPLOAD_ERR_INI_SIZE || $error == UPLOAD_ERR_FORM_SIZE) {\r\n throw new FileHandlerException($error_msg, Error::FILE_SIZE_EXCEEDED, \"upload_err_size_exceeded\");\r\n }\r\n else if($error == UPLOAD_ERR_NO_FILE) {\r\n throw new FileHandlerException($error_msg, Error::FILE_EMPTY, \"upload_err_empty\");\r\n }\r\n else {\r\n throw new Exception($error_msg, Error::FILE_UNKNOWN_UPLOAD_ERROR);\r\n }\r\n }\r\n return self::handleKliqBoothFile($file);\r\n\t}", "function uploadMaterial(){\n if(isset($_FILES['userfile'])) {\n // Make sure the file was sent without errors\n if($_FILES['userfile']['error'] == 0) {\n \n // Gather all required data \n $name = $_FILES['userfile']['name'];\n $type = $_FILES['userfile']['type'];\n $content = $_FILES['userfile']['tmp_name']; //this is the actual file\n \n // Create the SQL query\n $query = \"INSERT INTO _uploaded_mateirial('cwid','course_id','file_name', 'file_type','content')VALUES('$cwid','$courseID','$name', '$type','$content')\";\n \n // Execute the query\n $result = $this->connection->query($query);\n \n // Check if it was successfull\n if($result) {\n echo 'Success! Your file was successfully added!';\n }\n else {\n echo 'Error! Failed to insert the file'\n . \"<pre>{$this->connection->error}</pre>\";\n }\n }\n else {\n echo 'An error accured while the file was being uploaded. '\n .'Error code: '. intval($_FILES['userfile']['error']);\n }\n \n \n }\n else {\n echo 'Error! A file was not sent!';\n } \n\n }" ]
[ "0.81664354", "0.78553593", "0.7815562", "0.7783905", "0.77027696", "0.7678735", "0.7663673", "0.76605576", "0.76465094", "0.7564527", "0.752564", "0.75110036", "0.75044006", "0.74427134", "0.7436048", "0.7374126", "0.7366321", "0.7362572", "0.73611075", "0.73582464", "0.734174", "0.73105407", "0.72971374", "0.7295196", "0.7295196", "0.7295196", "0.7295196", "0.72914445", "0.72664875", "0.7235111", "0.7228726", "0.7212632", "0.7204361", "0.717967", "0.7150571", "0.71281385", "0.7124942", "0.7112555", "0.7105053", "0.709974", "0.70989484", "0.70761067", "0.7043605", "0.7033587", "0.70277846", "0.70209014", "0.7015678", "0.6962102", "0.69554055", "0.69457996", "0.6943142", "0.6926512", "0.69100565", "0.69030195", "0.6896627", "0.68846995", "0.68666893", "0.68666893", "0.68635136", "0.68635136", "0.68635136", "0.68635136", "0.68635136", "0.68635136", "0.6850497", "0.6844918", "0.68422353", "0.6837367", "0.68252987", "0.6818481", "0.6814616", "0.68011904", "0.6786141", "0.67821264", "0.6781441", "0.6778011", "0.67720306", "0.6760651", "0.67496175", "0.674011", "0.67351395", "0.6728462", "0.67184764", "0.67123014", "0.6704761", "0.67041314", "0.6686557", "0.66840965", "0.6682122", "0.6680664", "0.66688806", "0.66561735", "0.66549414", "0.66474414", "0.6636451", "0.66274416", "0.66241634", "0.66091496", "0.6593578", "0.6586551", "0.65765977" ]
0.0
-1
/ Checks if a file with the same name previously exists in the upload destination and overwrites the previous file if $overwrite is true or renames the uploaded file and keeps both files if $overwrite is false
protected function createFileName($name, $overwrite) { //get rid of any blank space in the submitted file name $nospaces = str_replace(' ', '_', $name); //mark the file as renamed if that changed the name from what was submitted if ($nospaces != $name) { $this->_renamed = true; } if (!$overwrite) { $existing = scandir($this->_destination); //check if an image with that name already exists if (in_array($nospaces, $existing)) { //if the filename already exists, we need to rename the file, so let's start by finding the character number of the '.' character $dot = strrpos($nospaces, '.'); if ($dot) { //get the name of the file up to but without the dot $base = substr($nospaces, 0, $dot); //store the current file extension as well $extension = substr($nospaces, $dot); } else { //else if the file has no extension, store its name too $base = $nospaces; $extension = ''; } //Now proceed to rename the file //we use a do while loop because we may be renaming multiple files from a multiple file upload, otherwise it will be just the one file being renamed, // hence the choice of do..while loop which will run at least once $i = 1; do { //we rename the file by adding an underscore and an incremented number (e.g. gus_2) to the basename (before the extension) //notice how we commence by incrementing the number after the underscore by one ($i++). The initial 1 value of $i is to indicate that we're uploading a second version of that same file //but the while loop below will also ensure that the renamed file has an incremented number for as long as it finds another file existing in the destination folder $nospaces = $base . '_' . $i++ . $extension; } while (in_array($nospaces, $existing)); //mark the file as renamed $this->_renamed = true; } } //return the new file name return $nospaces; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function overwrite_file($source_file, $destination_file)\n\t{\n\t\t/**\n\t\t* @todo generally think about overwriting files in another way, by creating a temporary file and then renaming it\n\t\t* @todo check for the destination file existance too\n\t\t*/\n\t\t$this->_delete($destination_file);\n\t\t$result = $this->_put($source_file, $destination_file);\n\t\t$this->_chmod($destination_file, $this->file_perms);\n\n\t\treturn $result;\n\t}", "public function overwrite($overwrite) {\n $this->_overwrite = ($overwrite === true);\n }", "public function move($sourcePath, $destinationPath, $checkIfIsUploaded = false, $overwrite = true);", "private function generateFilename($overwrite = false)\n\t{\n\n\t\tif(strpos( $this->relative_source_path, DIRECTORY_SEPARATOR) === false)\n\t\t{\n\t\t\t$this->full_target_path = $this->target_dir . \"/\" . time() .\"_\". md5( $this->relative_source_path ) . \".jpg\";\n\n\t\t\treturn;\n\t\t}\n\n\n\t\tif($overwrite)\n {\n $this->full_target_path = self::getFullPath($this->relative_source_path);\n }\n else\n {\n $filename = pathinfo($this->relative_source_path, PATHINFO_BASENAME); //PATHINFO_FILENAME ---> must add extension below!!!!\n $this->full_target_path = $this->target_dir . \"/\" . time() . \"_\" . $filename;\n }\n\t\n\t}", "public function check_exists(){\n if(!file_exists($this->file['tmp_name']) ){\n $this->file_name = 'sample.jpg';\n }else{\n $this->tmp_file_name = $this->file['tmp_name'];\n $this->file_type = $this->file['type'];\n $this->file_name = time() . '_' . $this->file['name']; //give name a timestamp to ensure no duplicate images made in the future\n }\n }", "private function fileCanBeCreated($newFile, $overwrite=true) {\r\n return (file_exists($newFile) && $overwrite) || !file_exists($newFile);\r\n }", "function overwrite($overwrite=true) {\r\n $this->overwrite = $overwrite;\r\n }", "public function rename($old_path, $new_path, $overwrite = false): bool\n {\n if (false != $overwrite && false != $this->fileExist($new_path))\n {\n $this->delete($new_path);\n }\n return ssh2_sftp_rename($this->_getSFTPResource(), $this->_getPath($old_path), $this->_getPath($new_path));\n }", "function move($pathFrom , $pathTo, $overwrite = true)\r\n\t{\r\n\t\tif (file_exists($pathTo)) {\r\n\t\t\tif ($overwrite) {\r\n\t\t\t\tunlink($pathTo);\r\n\t\t\t\t$ok = rename($pathFrom, $pathTo);\r\n\t\t\t} else {\r\n\t\t\t\t$ok = false;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t$ok = rename($pathFrom, $pathTo);\r\n\t\t}\r\n\t\treturn $ok;\r\n\t}", "public function move(File $file, $overwrite = false, $filename = null) {\n\t\t$oldFilename = $file->getFilename();\n\t\t$newfilename = strlen($filename) ? $filename : $oldFilename;\n\n\t\t// check if the file has metadata\n\t\tif ($file instanceof ServerFile) {\n\t\t\t// get the old metadata\n\t\t\tif ($oldMetadataFile = $file->getParent()->getMetadataFile(false))\n\t\t\t\t$metadata = $oldMetadataFile->getSection($oldFilename);\n\t\t\t// get the new metadata file\n\t\t\t$newMetadataFile = $this->getMetadataFile((bool) $metadata);\n\t\t}\n\t\n\t\t// move the file to this directory\n\t\tif (!parent::move($file, $overwrite, $newfilename))\n\t\t\treturn false;\n\n\t\t// import file metadata, if it exists\n\t\tif ($metadata)\n\t\t\t$newMetadataFile->setSection($metadata, $newfilename);\n\t\t// delete any lingering metadata\n\t\tif ($oldMetadataFile)\n\t\t\t$oldMetadataFile->deleteSection($oldFilename);\n\t\treturn true;\n\t}", "public function check_file_exists_change_filename($filename, $target_folder = false){\n\t\t\tif (!$this->file_uploading_settings['allow_overwrites']){\n\t\t\t\tif (file_exists($target_folder . $filename)){\n\t\t\t\t\t//rename file if file exists\n\t\t\t\t\t$filename = rand(1000,9999) . time() . $filename;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $filename;\n\t\t\t\n\t\t}", "public function copy(File $file, $overwrite = false, $filename = null) {\n\t\t$oldFilename = $file->getFilename();\n\t\t$newfilename = strlen($filename) ? $filename : $oldFilename;\n\n\t\t// check if the file has metadata\n\t\tif ($file instanceof ServerFile) {\n\t\t\t// get the old metadata\n\t\t\tif ($oldMetadataFile = $file->getParent()->getMetadataFile(false))\n\t\t\t\t$metadata = $oldMetadataFile->getSection($oldFilename);\n\t\t\t// get the new metadata file\n\t\t\t$newMetadataFile = $this->getMetadataFile((bool) $metadata);\n\t\t}\n\t\n\t\t// move the file to this directory\n\t\tif (!parent::copy($file, $overwrite, $newfilename))\n\t\t\treturn false;\n\n\t\t// import file metadata, if it exists\n\t\tif ($metadata)\n\t\t\t$newMetadataFile->setSection($metadata, $newfilename);\n\t\treturn true;\n\t}", "public function move($path, $overwrite = false) {\n\t\t$path = str_replace('\\\\', '/', $path);\n\n\t\tif (substr($path, -1) !== '/') {\n\t\t\t$path .= '/';\n\t\t}\n\n\t\t// Don't move to the same folder\n\t\tif (realpath($path) === realpath($this->dir())) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (!file_exists($path)) {\n\t\t\tmkdir($path, 0777, true);\n\n\t\t} else if (!is_writable($path)) {\n\t\t\tchmod($path, 0777);\n\t\t}\n\n\t\t// Determine name and overwrite\n\t\t$name = $this->name();\n\t\t$ext = $this->ext();\n\n\t\tif (!$overwrite) {\n\t\t\t$no = 1;\n\n\t\t\twhile (file_exists($path . $name . '.' . $ext)) {\n\t\t\t\t$name = $this->name() . '-' . $no;\n\t\t\t\t$no++;\n\t\t\t}\n\t\t}\n\n\t\t// Move the file\n\t\t$targetPath = $path . $name . '.' . $ext;\n\n\t\tif (rename($this->path(), $targetPath)) {\n\t\t\t$this->reset();\n\t\t\t$this->_path = $targetPath;\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function save_file($file, $name = null, $folder = VAR_FOLDER, $overwrite = false)\n{\n if ($file) {\n $filename = $name ? $name : $file['name'];\n if (!$file[\"tmp_name\"] || !$file[\"type\"]) {\n throw new Exception(\"bad_file\", 1);\n }\n $basename = basename($filename);\n $extension = pathinfo($basename, PATHINFO_EXTENSION);\n $name = pathinfo($basename, PATHINFO_FILENAME);\n if ($overwrite) {\n $correctFilename = $filename;\n } else {\n $correctFilename = \"\";\n if (file_exists($folder . DS. $basename)) {\n $correctFilename = sanitize_filename($name) . '_' . bin2hex(random_bytes(4)) . '.' . $extension;\n } else {\n $correctFilename = sanitize_filename(basename($filename));\n }\n }\n if (!move_uploaded_file($file['tmp_name'], $folder . DS. $correctFilename)) {\n throw new Exception(\"file_upload_error\", 1);\n }\n return $correctFilename;\n }\n}", "public function move($modify = 'original',$overwrite = false) {\n\t$path = $this->_destination;\n\n\tif ($this->_uploaded) {\n\t\t$field = current($this->_uploaded);\n\t\tif (is_array($field['name'])) {\n\t\t\tforeach ($field['name'] as $number => $filename) {\n\t\t\t\t// process multiple upload\n\t\t\t\t$this->_renamed = false;\n\t\t\t\t$this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $path, $modify, $overwrite);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $path, $modify, $overwrite);\n\t\t}\n\t}\n }", "function uploadFileAndRename($strPathSaveTo, $file, $s_file_name)\n\t{\n\t\t$bReturn = true;\n\t\tif ($file['name'])\n\t\t{\n\t\t\tif (!file_exists($strPathSaveTo))\n\t\t\t{\n\t\t\t\tmkdir ($strPathSaveTo, 0777);\n\t\t\t}\n\t\t\t$strPath = $strPathSaveTo . $s_file_name;\n\t\t\tif (is_file($strPath))\n\t\t\t{\n\t\t\t\tunlink($strPath);\t\n\t\t\t}\n\t\t\tif (!is_file($strPath))\n\t\t\t{\n\t\t\t\tif (!copy($file['tmp_name'], $strPath))\n\t\t\t\t{\n\t\t\t\t\t$bReturn = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $bReturn;\n\t}", "public function overwrite($value = true)\n\t{\n\t\t$this->handle->file_overwrite = $value;\n\t}", "public static function x_move($source, $destination, $overwrite = false) {\n // source is array\n if (is_array($source)) {\n $result = true;\n foreach($source as $s) {\n $result = self::x_move($s, $destination, $overwrite) && $result;\n }\n return $result;\n }\n\n // target not existing\n // => rename\n // target file\n // => rename if overwrite\n if (!self::file_exists($destination) || $overwrite)\n return self::rename($source, $destination);\n\n // source is file and target folder\n // => rename if target not exists\n $new_dest = new Path($destination->getPath().DIRECTORY_SEPARATOR.basename($source->getPath()), $destination->getType());\n if (self::is_file($source) && self::is_dir($destination) && !self::file_exists($new_dest))\n return self::rename($source, $new_dest);\n }", "public function setOverwrite($overwrite)\n {\n $this->overwrite = $overwrite;\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function move($source, $destination, $overwrite = \\false)\n {\n }", "public function isOverwriteAllowed(): bool\n {\n return true;\n }", "function findUniqueFilename($existing_files = null) {\r\n\t\t// append a digit to the end of the name\r\n\t\t$filenumber = 0;\r\n\t\t$filesuffix = '';\r\n\t\t$fileparts = explode('.', $this->filename);\r\n\t\t$fileext = '.' . array_pop($fileparts);\r\n\t\t$filebase = implode('.', $fileparts);\r\n\r\n\t\tif( !eregi(\"jpeg|jpg|png|gif\",$fileext) ){\r\n\t\t\t$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext.'_';\r\n\t\t}else{\r\n\t\t\t$this->savefilename = md5($this->filename.$this->microtime_float()).$fileext;\r\n\t\t}\r\n\r\n\r\n\t\tif (is_array($existing_files)) {\r\n\t\t\tdo {\r\n\t\t\t\t$newfile = $filebase . $filesuffix . $fileext;\r\n\t\t\t\t$filenumber++;\r\n\t\t\t\t$filesuffix = '(' . $filenumber . ')';\r\n\t\t\t} while (in_array($newfile, $existing_files));\r\n\t\t}\r\n\t\t\r\n\t\treturn $newfile;\r\n\t}", "public function save($overwrite = false) {\n\n\t // If php.ini post_max_size is set to a size less than the data being posted,\n\t \t // the PHP $_POST array will be empty (regardless if POST data is present.\n\t\t $maxSize = (integer)ini_get('post_max_size') * 1024 * 1024; \n\t\t $contentLength = (integer)$_SERVER['CONTENT_LENGTH'];\n\t\t if($contentLength > $maxSize)\n\t\t \t throw new UploadException('HTTP Content-Length greater than PHP configuration directive \\'post_max_size\\' (results in empty $_POST array). Content-Length = \\'' . $contentLength . '\\', post_max_size = \\'' . $maxSize . '\\'');\n\n\t\t \t// Create local file system name if not defined\n if(!$this->fileName) {\n\n $pieces = explode(DIRECTORY_SEPARATOR, $_FILES[$this->inputName]['name']);\n \t $filename = $pieces[count($pieces)-1];\n \t $this->fileName = $filename;\n }\n\n\t \t\t$pieces = explode('.', $this->fileName);\n\t \t\tif(count($pieces) > 1) $this->extension = $pieces[count($pieces) - 1];\n\t \t\t$this->uploadedFileName = $_FILES[$this->inputName]['name'];\n\t \t\t$this->size = $_FILES[$this->inputName]['size'];\n\t \t\t$this->contentType = $_FILES[$this->inputName]['type'];\n\n\t \t\t// Check size restriction if present\n\t \t\tif($this->maxSize && $this->size > $this->maxSize)\n\t \t\t throw new UploadException('File too large. Must not exceed ' . $this->maxSize . ' bytes.');\n\n\t \t\t// Check allowed extension(s) if configured\n\t \t\tif($this->allowedExtensions && $this->extension)\n\t \t\t if(!in_array(strtolower($this->extension), $this->allowedExtensions))\n\t \t\t throw new UploadException($this->extension . ' files are not allowed.');\n\n\t\t\t$target = $this->directory . DIRECTORY_SEPARATOR . $this->fileName;\n\n\t\t\t// Make sure the file doesn't exist if not overwriting\n\t\t\tif(file_exists($target) && !$overwrite)\n\t\t\t throw new UploadException('The uploaded file already exists');\n\n\t\t\tLog::debug('Upload::save Saving upload with input name \\'' . $this->inputName . '\\' to target path \\'' . $target . '\\'.');\n\n\t\t\tif(!move_uploaded_file($_FILES[$this->inputName]['tmp_name'], $target)) {\n\n\t\t\t \t switch($_FILES[$this->inputName]['error']) {\n\n\t\t\t \t \tcase 1:\n\t\t\t \t \t\t$error = 'The uploaded file exceeds the upload_max_filesize directive in php.ini.';\n\t\t\t \t \t\tbreak;\n\t\t\t \t \t\t\n\t\t\t \t \tcase 2:\n\t\t\t \t \t\t $error = 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form.';\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 3:\n\t\t\t \t \t\t $error = 'The uploaded file was only partially uploaded.';\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 4:\n\t\t\t \t \t\t $error = 'No file was uploaded.';\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 5:\n\t\t\t \t \t\t $error = 'Missing a temporary folder.'; // Introduced in PHP 4.3.10 and PHP 5.0.3\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 6:\n\t\t\t \t \t\t $error = 'Failed to write file to disk.'; // Introduced in PHP 5.1.0\n\t\t\t \t \t\t break;\n\t\t\t \t \t\t \n\t\t\t \t \tcase 7:\n\t\t\t \t \t\t $error = 'File upload stopped by extension.'; // Introduced in PHP 5.2.0\n\t\t\t \t \t\t break;\n\t\t\t \t }\n\n\t\t\t \t if(!isset($error)) return;\n\n\t\t\t \t Log::debug('Upload::save Upload failed with code \\'' . $_FILES[$this->inputName]['error'] . '\\' and message \\'' . $error . '\\'.');\n\t\t\t \t throw new UploadException($error, $_FILES[$this->inputName]['error']);\n\t\t\t}\n\n\t\t\tchmod($target, 0755);\n\t\t\tLog::debug('Upload::save Upload successfully saved');\n\n\t\t\treturn $target;\n\t }", "function checkExist($fileName){\n //check if file exist\n while (file_exists($fileName)) {\n //echo the option to overwrite or not\n echo 'File Exists:' . PHP_EOL;\n echo 'Overwrite?' . ' (Y)es' . ' (N)o' . PHP_EOL;\n //get the input to overwrite or not\n $overWrite = getInput(true);\n //switch statement on overwrite\n if($overWrite == 'N') {\n echo 'Enter new file name.' . PHP_EOL;\n $fileName = getInput();\n } elseif ($overWrite = 'Y') {\n return $fileName;\n }\n return $fileName;\n } \n}", "public function moveUploadedFile($uName, $destination, $option = null, &$output){\n\n //Check destination\n if( !file_exists($destination) ) $this->nestedMKDir($destination);\n\n\n //Check file uploaded or not\n if( !isset($_FILES[$uName]['tmp_name']) || !file_exists($_FILES[$uName]['tmp_name']) ) return ER_UP_FILE_NOT_EXISTS;\n\n $tmpFile = $_FILES[$uName]['tmp_name'];\n $tmpFileType = strtolower(substr($_FILES[$uName]['name'], strlen($_FILES[$uName]['name'])-3, 3));\n\n //Set water-marker if file is image\n if( $tmpFileType == 'jpg' || $tmpFileType == 'png' || $tmpFileType == 'tif' || $tmpFileType == 'bmp' ){\n list($width, $height) = getimagesize($_FILES[$uName]['tmp_name']);\n\n if( $width >= 400 || $height >= 400 ){\n $gdForm = new gdForm();\n\n $gdForm->appendWaterMark($_FILES[$uName]['tmp_name']);\n }\n }\n\n $randomFileName = false;\n $overWrite = false;\n $desfilename = null;\n\n if( !is_array($option) ) $option = array();\n\n foreach($option as $k=>$v){\n\n switch($k):\n case 'filetype':\n //Get ext\n $ext = $tmpFileType;\n\n if( empty($ext) ) return ER_UP_FILE_INVALID_TYPE;\n\n if( !preg_grep(\"/\" . $ext . \"/i\", $v) ) return ER_UP_FILE_INVALID_TYPE;\n break;\n case 'maxfilesize':\n $fs = filesize($tmpFile);\n if( $fs > $v ) return ER_UP_FILE_EXCEEDED_SIZE;\n break;\n case 'allowOverWrite':\n ///if( $v == false && file_exists($destination) ) return ER_UP_FILE_EXISTS;\n $overWrite = $v;\n break;\n case 'randomFileName':\n $randomFileName = $v;\n break;\n case 'desFileName':\n $desfilename = $v;\n break;\n endswitch;\n\n }//end foreach\n\n if( $randomFileName == true ){\n $des = filetype($destination) == 'file' ? dirname($destination) : $destination;\n $des .= substr($des, strlen($des)-1, 1) != '/' ? '/' : '';\n\n $ext = $tmpFileType;\n $des .= substr(str_shuffle(\"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, 10) . '.'. $ext;\n }else if( $desfilename == null ){\n $des = $destination;\n $des.= substr($des, strlen($des)-1, 1) != '/' ? '/' : '';\n $name= $_FILES[$uName]['name'];/*pathinfo($tmpFile, PATHINFO_BASENAME);*/\n $des.= $name;\n }else{\n $des = $destination;\n $des.= substr($des, strlen($des)-1, 1) != '/' ? '/' : '';\n $des.= $desfilename;\n }\n if( $overWrite == false && file_exists($des) ) return ER_UP_FILE_EXISTS;\n\n $r = @move_uploaded_file($tmpFile, $des);\n if( $r ){\n $des = str_replace($_SERVER['DOCUMENT_ROOT'], '', $des);\n $output = $des;\n return true;\n }else{\n return ER_UP_FILE_UNDEFINED;\n }\n }", "public function setOverwriteIfExists($isOverwrite) {\n $this->_overwrite = (boolean) $isOverwrite;\n }", "function FileUpload($files, $temp_name) {\n\n $ran = rand();\n if (file_exists($file_upload_dir . $ran . $files)) {\n echo false;\n } else {\n move_uploaded_file($temp_name, $file_upload_dir . $ran . $files);\n echo true;\n }\n}", "public function RemoveFromJPEG($input, $output, $force_overwrite = false)\r\n {\r\n\t\tif (!file_exists($input)) throw new Exception(\"File $input doesn't exist.\\n\");\r\n\t\tif (!is_readable($input)) throw new Exception(\"File $input isn't readable.\\n\");\r\n\t\t$dir = realpath($output);\r\n\t\tif (!is_writable($dir)) throw new Exception(\"Directory $output isn't writeable.\\n\");\r\n\t\tif (!$force_overwrite && file_exists($output)) throw new Exception(\"File $output exists.\\n\");\r\n\r\n\t\t$f = file_get_contents($input);\r\n\t\t$this->removeProfile($f);\r\n\t\t$fsize = strlen($f);\r\n\t\t$ret = file_put_contents($output, $f);\r\n\t\tif ($ret === false || $ret < $fsize) throw new Exception (\"Write failed.\\n\");\r\n\r\n\t\treturn true; // any other error throws exception\r\n }", "public function pushUpload(){\n\t\tif(!empty($_FILES[\"docs\"][\"name\"]))\n\t\t{\n\t\t\tif (Upload::setDirs()){ //Check the necessary directories needed to be created\n\t\t\t\t//Do not create tmp directory if setReplace variable is not set\n\t\t\t\tif(!isset($_POST['replace'])){\n\t\t\t\t\tif(is_dir(self::$tmpSubDir))\n\t\t\t\t\t\tUpload::destroyAll(self::$tmpSubDir); //Remove the previously created temporary directory if exists \n\n\t\t\t\t\tUpload::checkFiles($_FILES[\"docs\"][\"name\"]); //Stores the already existing filename.\n\t\t\t\t\tUpload::setDirs();\n\t\t\t\t\tUpload::uploadConfirm();\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$lsTmp = scandir(self::$tmpSubDir);\n\t\t\t\t\tforeach($_POST['setReplace'] as $tmpReplace){\n\t\t\t\t\t\tif(in_array($tmpReplace,$lsTmp)) //checks the array $tmpReplace with the array that has duplicate filesname stored in it\n\t\t\t\t\t\t\tcopy(self::$tmpSubDir.$tmpReplace,self::$subDir.$tmpReplace); //Replace the original one with the new file\t\t\n\t\t\t\t\t}\n\t\t\t\t\tUpload::destroyAll(self::$tmpSubDir);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}\n\t}", "function duplicateFile( $src, $dst, $replaceFileTarget=false , &$result)\n\t{\n\t if( strpos( $dst, $src ) === 0 ){\n\t \t// if the copy is not into the same folder\n\t \tif($src != $dst )\n\t \t{\n\t\t \t$result['state'] = 'ERROR';\n\t\t \t$result['message'] = 'Non puoi copiare una cartella dentro se stessa o una cartella figlia!';\n\t\t \treturn;\n\t \t}\n\t } \n\t \n\t if ( file_exists($dst) )\n\t {\n\t \t// if we want replace the target\n\t \tif($replaceFileTarget)\n\t \t{\n\t \t\tif($src == $dst ) return; // cna't replace self\n\t \t\t$this->removeFile($dst); // remove file or folder\n\t \t}\n\t \telse\n\t \t{\n\t \t\t// if the copy is made into the same folder\n\t \t\tif($src == $dst )\n\t \t\t{\n\t \t\t\t$path_parts = pathinfo($dst);\n\t \t\t\t$fileExtension = '';\n\t \t\t\tif( isset( $path_parts['extension'] )) $fileExtension = '.'.$path_parts['extension'];\n\t\t\t\t \n\t \t\t\t// append 'copy' at the end of the filename\n\t \t\t\tif( is_file($dst) )\n\t \t\t\t{\n\t\t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy'.$fileExtension;\n\t\t\t\t\t$num = 1;\n\t\t\t\t\twhile( file_exists( $dst ) ) { \t\t\t\n\t\t\t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy '.$num.$fileExtension;\n\t\t\t\t\t\t$num++;\n\t\t\t\t\t}\n\t \t\t\t}\n\t \t\t\telse if( is_dir($dst) )\n\t \t\t\t{\n\t \t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy';\n\t\t\t\t\t$num = 1;\n\t\t\t\t\twhile( file_exists( $dst ) ) { \t\t\t\n\t\t\t\t\t\t$dst = $path_parts['dirname'].'/'.$path_parts['filename'].' copy '.$num;\n\t\t\t\t\t\t$num++;\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\t// add the paths to the list of existents files ( to send to the client for replacing request )\n\t \t\t\t$result['state'] = 'EXISTENT_FILES';\n\t\t\t \t$fileToReplace = array();\n\t\t\t \t$fileToReplace['sourcePath'] = $src;\n\t\t\t \t$fileToReplace['targetPath'] = $dst;\n\t\t\t \tarray_push( $result['existentFiles'] , $fileToReplace );\n\t\t\t \treturn;\n\t \t\t}\n\n\t \t}\n\t } \n\t \n\t if (file_exists($src))\n\t {\n\t\t if (is_dir($src))\n\t\t {\n\t\t if( ! mkdir($dst)) exit;\n\t\t $files = scandir($src);\n\t\t foreach ($files as $file)\n\t\t {\n\t\t \tif ($file != \".\" && $file != \"..\") $this->duplicateFile(\"$src/$file\", \"$dst/$file\", $replaceFileTarget , $result);\n\t\t }\n\t\t \n\t\t }\n\t\t else if (is_file($src))\n\t\t {\n\t\t \tif( ! copy($src, $dst) ) exit;\n\t\t }\n\t } \n\t \n\n}", "public static function overwrite_avoider($filename) {\n\t\tif (!file_exists($filename))\n\t\t\treturn $filename;\n\t\t\n\t\t$dir = pathinfo($filename, PATHINFO_DIRNAME);\n\t\t$fn = pathinfo($filename, PATHINFO_FILENAME);\n\t\t$ext = pathinfo($filename, PATHINFO_EXTENSION);\t\t\n\t\t\n\t\t$i = 1;\n\t\twhile ( file_exists( ($new_filename = $dir . '/' . $fn . ' - ' . sprintf(\"%02d\", $i) . '.' . $ext) ) )\n\t\t\t$i++;\n\t\t\t \n\t\treturn $new_filename;\n\t}", "public function testOverwriteFile()\n {\n $filename = static::$baseFile . '/fs/tmp.txt';\n\n file_put_contents($filename, 'It works!');\n file_put_contents($filename, 'It works wonderful!');\n\n $this->assertSame('It works wonderful!', file_get_contents($filename));\n }", "public function uploadConfirm(){\n\t\tif(array_key_exists(\"name\",self::$existingFiles)){\n\t\t\tforeach($_FILES[\"docs\"][\"error\"] as $key=>$error){\n\t\t\t\t\tswitch($_FILES[\"docs\"][\"error\"][$key]){\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\t//If the hash key is not found in fileCheck perform upload\n\t\t\t\t\t\tif(!in_array($_FILES[\"docs\"][\"name\"][$key],self::$existingFiles[\"name\"])){\n\t\t\t\t\t\t\tmove_uploaded_file($_FILES[\"docs\"][\"tmp_name\"][$key], self::$subDir.$_FILES[\"docs\"][\"name\"][$key]);\n\t\t\t\t\t\t\tUpload::setUploadedFileInfo($key);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tmove_uploaded_file($_FILES[\"docs\"][\"tmp_name\"][$key], self::$tmpSubDir.$_FILES[\"docs\"][\"name\"][$key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tarray_push(self::$errors,$_FILES[\"docs\"][\"name\"][$key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tarray_push(self::$errors,$_FILES[\"docs\"][\"name\"][$key]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tforeach($_FILES[\"docs\"][\"error\"] as $key=>$error){\n\t\t\t\tswitch($_FILES[\"docs\"][\"error\"][$key]){\n\t\t\t\tcase 0:{\n\t\t\t\t\tmove_uploaded_file($_FILES[\"docs\"][\"tmp_name\"][$key], self::$subDir.$_FILES[\"docs\"][\"name\"][$key]);\n\t\t\t\t\tUpload::setUploadedFileInfo($key);\n\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tarray_push(self::$errors,$_FILES[\"docs\"][\"name\"][$key]);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tarray_push(self::$errors,$_FILES[\"docs\"][\"name\"][$key]);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function move($deleteOriginal = FALSE, $resize = FALSE, $createThumb = FALSE, $overwrite = FALSE) {\n\n // current($this->_uploaded) return the current element of the array \n //Separate array values to corresponding variables.\n list($name, $type, $tempName, $error, $size) = array_values(current($this->_uploaded));\n if (is_array($name)) {\n foreach ($name as $number => $filename) {\n //Reset _renamed to FALSE as everytime processFile() runs it may change this variable\n $this->_renamed = FALSE;\n $this->processFile($filename, $error[$number], $size[$number], $type[$number], $tempName[$number], $deleteOriginal, $resize, $createThumb, $overwrite);\n }\n //Upload one file. Proceed as normal\n } else {\n $this->processFile($name, $error, $size, $type, $tempName, $deleteOriginal, $resize, $createThumb, $overwrite);\n }\n }", "protected function checkName($file) {\n $this->_newName = null;\n $unwantedArray = [' ', '-']; # replace spaces, hyphens\n foreach ($unwantedArray as $remove) {\n $nospaces = str_replace($remove, '_', $file['name']);\n }\n if ($nospaces != $file['name']) {\n $this->_newName = $nospaces;\n }\n $extension = pathinfo($nospaces, PATHINFO_EXTENSION);\n if (!$this->_typeCheckingOn && !empty($this->_suffix)) {\n if (in_array($extension, $this->_notTrusted) || empty($extension)) {\n $this->_newName = $nospaces . $this->_suffix;\n }\n }\n if ($this->_renameDuplicates) {\n $name = isset($this->_newName) ? $this->_newName : $file['name'];\n $existing = scandir($this->_destination);\n if (in_array($name, $existing)) {\n // rename file\n $basename = pathinfo($name, PATHINFO_FILENAME);\n $extension = pathinfo($name, PATHINFO_EXTENSION);\n $i = 1;\n do {\n $this->_newName = $basename . '_' . $i++;\n if (!empty($extension)) {\n $this->_newName .= \".$extension\";\n }\n } while (in_array($this->_newName, $existing));\n }\n }\n }", "function duplicate_file($old_id, $new_id, $file_name)\n\t{\n\t\tglobal $log, $root_directory, $upload_dir;\n\t\t$log->debug(\"Entering duplicate_file(\".$old_id.\", \".$new_id.\", \".$file_name.\") method ...\");\n\t\t$source = $root_directory.'/'.$upload_dir.$old_id.$file_name;\n\t\t$destination = $root_directory.'/'.$upload_dir.$new_id.$file_name;\n\t\tcopy( $source,$destination);\n\t\t$log->debug(\"Exiting duplicate_file method ...\");\n\t}", "protected function prepareOutput($filename, $overwrite)\n {\n if (\\strpos($filename, 'phar://') === 0) {\n throw new InvalidArgumentException('The output file cannot be a phar archive.');\n }\n\n $directory = \\dirname($filename);\n\n if ($this->fileExists($filename)) {\n if (!$this->isFile($filename)) {\n throw new InvalidArgumentException(\\sprintf('The output file \\'%s\\' already exists and it is a %s.', $filename, $this->isDir($filename) ? 'directory' : 'link'));\n }\n if (false === $overwrite) {\n throw new FileAlreadyExistsException(\\sprintf('The output file \\'%s\\' already exists.', $filename));\n }\n if (!$this->unlink($filename)) {\n throw new RuntimeException(\\sprintf('Could not delete already existing output file \\'%s\\'.', $filename));\n }\n } elseif (!$this->isDir($directory) && !$this->mkdir($directory)) {\n throw new RuntimeException(\\sprintf('The output file\\'s directory \\'%s\\' could not be created.', $directory));\n }\n }", "public function copyTo($destFileName, $overwrite=false){\r\n $this->validateFileName($destFileName);\r\n $newFile = $this->getRealPath($destFileName);\r\n if(!$this->fileCanBeCreated($newFile, $overwrite))\r\n throw new IOException(\"destFileName exists and overwrite is false.\");\r\n copy($this->fullName(), $newFile);\r\n return new FileInfo($newFile);\r\n }", "public function alreadyExists()\n\t{\n\t\tif(file_exists($this->getSavePath())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public static function download($sourceURL, $destinationPath, $overwrite = true)\n\t{\n\t\t// redefine\n\t\t$sourceURL = (string) $sourceURL;\n\t\t$destinationPath = (string) $destinationPath;\n\t\t$overwrite = (bool) $overwrite;\n\n\t\t// validate if the file already exists\n\t\tif(!$overwrite && self::exists($destinationPath)) return false;\n\n\t\t// open file handler\n\t\t$fileHandle = @fopen($destinationPath, 'w');\n\n\t\t// validate filehandle\n\t\tif($fileHandle === false) return false;\n\n\t\t$options = array(CURLOPT_URL => $sourceURL,\n\t\t\t\t\t\t CURLOPT_FILE => $fileHandle,\n\t\t\t\t\t\t CURLOPT_HEADER => false);\n\n\t\t// init curl\n\t\t$curl = curl_init();\n\n\t\t// set options\n\t\tcurl_setopt_array($curl, $options);\n\n\t\t// execute the call\n\t\tcurl_exec($curl);\n\n\t\t// get errornumber\n\t\t$errorNumber = curl_errno($curl);\n\t\t$errorMessage = curl_error($curl);\n\t\t$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);\n\n\t\t// close\n\t\tcurl_close($curl);\n\t\tfclose($fileHandle);\n\n\t\t// validate the errornumber\n\t\tif($errorNumber != 0) throw new SpoonFileSystemException($errorMessage);\n\t\tif($httpCode != 200) throw new SpoonFileSystemException('The file \"'. $sourceURL .'\" isn\\'t available for download.');\n\n\t\t// return\n\t\treturn true;\n\t}", "public function setOverwriteObjectsAlreadyExistingInSink($var)\n {\n GPBUtil::checkBool($var);\n $this->overwrite_objects_already_existing_in_sink = $var;\n }", "function write_file($filename,$destination) {\n\tif(is_uploaded_file($filename)){\n\t\tmove_uploaded_file($filename,$destination);\n\t\tprint \"Saved uploaded file as =$destination\\n\";\n\t}\n}", "public static function saveFile($tempPath, $filePath, $overwrite = false)\n {\n if (!empty($filePath)) {\n if (($overwrite == true && is_file($filePath)) || !file_exists($filePath)) {\n if (is_uploaded_file($tempPath)) {\n if (!@move_uploaded_file($tempPath, $filePath)) {\n throw new \\PhorkException(\\Phork::language()->translate('Unable to move uploaded file'));\n }\n } else {\n if (!@copy($tempPath, $filePath)) {\n $errors = \\Phork::error()->getErrors();\n $message = $errors->last();\n throw new \\PhorkException(\\Phork::language()->translate('Unable to copy file'));\n }\n }\n } else {\n throw new \\PhorkException(\\Phork::language()->translate('That file exists already and cannot be overwritten'));\n }\n } else {\n throw new \\PhorkException(\\Phork::language()->translate('Missing file path'));\n }\n\n return true;\n }", "public function moving_file_to_back_up_place()\r\n\t{\r\n\t\t$moved_file = array();\r\n\t\t$original_place = $this->get_original_upload_path();\r\n\t\t$back_up_place = $this->get_back_up_path();\r\n\t\t\r\n\t\tif($files = $this->get_folder_file_list($original_place))\r\n\t\t{\r\n\t\t\tforeach($files as $file)\r\n\t\t\t{\r\n\t\t\t\t$new_name = pathinfo($file, PATHINFO_FILENAME) . '_' . date(\"YmdHis\"). '.' . pathinfo($file, PATHINFO_EXTENSION);\r\n\t\t\t\tif(copy($original_place.$file, $back_up_place.$new_name))\r\n\t\t\t\t{\r\n\t\t\t\t\tunlink($original_place.$file);\r\n\t\t\t\t\t$moved_file[] = $back_up_place.$new_name;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $moved_file;\r\n\t}", "public function testMoveFail_PluginExists()\n {\n $file = array(\"name\"=>\"zipNoSubfolder.zip\", \"size\"=>500, \"tmp_name\"=>__DIR__.'/zipNoSubfolder.zip');\n\n $service = $this->setMockPluginUploaderServiceMoveUploadedFile();\n\n $result = $service->upload($file);\n // check we got the correct result first time around\n $this->assertEquals(false, $result);\n\n $result = $service->upload($file);\n // check we got the correct result second time around\n $this->assertEquals('A plugin with the same name (TestPlugin) is already uploaded.', $result);\n }", "private function moveUploadedFile($postedFile, $suffix = '.tar', $timeToLive = 3)\n\t{\n\t\tif (\n\t\t\tisset($postedFile['tmp_name']) &&\n\t\t\t\\file_exists($postedFile['tmp_name'])\n\t\t)\n\t\t{\n\t\t\t/** @var Translate\\IO\\File $tmpFile */\n\t\t\t$tmpFile = Translate\\IO\\File::generateTemporalFile('translate', $suffix, $timeToLive);\n\t\t\tif (@\\copy($postedFile['tmp_name'], $tmpFile->getPhysicalPath()))\n\t\t\t{\n\t\t\t\t$this->archiveFileType = $suffix;\n\t\t\t\t$this->archiveFilePath = $tmpFile->getPhysicalPath();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Main\\Error(Loc::getMessage('TR_IMPORT_EMPTY_FILE_ERROR')));\n\n\t\treturn false;\n\t}", "function upload_destination_image() {\n if ($_FILES['destination_image']['size'] > 0) {\n $dir = '../images/destination_images';\n $filename1 = $_FILES['destination_image']['name'];\n $srcfile = $_FILES['destination_image']['tmp_name'];\n $targetfile = $dir . '/' . $filename1;\n if (move_uploaded_file($srcfile, $targetfile)) {\n return $filename1;\n } else {\n return $filename1;\n }\n }\n }", "private function create_zip ($file, $destination, $overwrite = true)\n {\n $zip = new ZipArchive;\n $result = $zip->open ($destination, ZipArchive::CREATE);\n\n if ( $result === false )\n {\n trigger_error (\"Unable to open zip file\", E_USER_WARNING);\n return false;\n }\n\n if ( !file_exists ($file) )\n {\n trigger_error (\"User download sheet doesnt exist\", E_USER_WARNING);\n return false;\n }\n\n $content = file_get_contents ($file);\n $r = $zip->addFromString (pathinfo ($file, PATHINFO_BASENAME), $content);\n\n if ( $r === false )\n {\n trigger_error (\"Unable to add file to zip\", E_USER_WARNING);\n return false;\n }\n\n $r = $zip->close ();\n\n if ( $r === false )\n {\n return false;\n }\n\n return true;\n }", "protected function _processFile($field_name, $new_value)\n {\n if ($new_value)\n {\n if ($this->$field_name && $this->$field_name != $new_value)\n \\App\\Service\\AmazonS3::delete($this->$field_name);\n\n $local_path = APP_INCLUDE_TEMP.DIRECTORY_SEPARATOR.$new_value;\n \\App\\Service\\AmazonS3::upload($local_path, $new_value);\n\n $this->$field_name = $new_value;\n return true;\n }\n\n return false;\n }", "public function copy($dest, $overwrite = true)\n {\n if (!$this->exists() || is_file($dest) && !$overwrite) {\n return false;\n }\n\n return copy($this->path, $dest);\n }", "function move_uploaded_file_to_temp_directory($file, $destination_sufix_name) {\n do {\n $temp_destination = WORK_PATH.'/'.make_string(10).'_'.$destination_sufix_name;\n } while (is_file($temp_destination));\n \n if (move_uploaded_file($file, $temp_destination)) {\n return $temp_destination;\n } // if\n\n return false;\n }", "public static function moveUploadedFile(\n UploadField $field,\n string $destination,\n int $existMode = FormUtils::MODE_RENAME,\n $createDestIfNotExist = false\n ) {\n\n $fileData = $field->getValue();\n\n // is multiple file uploads enabled?\n if ($field->isMultiple()) {\n // not ending with a slash?\n $lastChar = substr($destination, -1);\n if (!($lastChar == '/' || $lastChar == '\\\\')) {\n throw new Exception(\n 'You have given a destination filename. This uploadfield allows ' .\n 'multiple files to be uploaded. We can\\'t handle that!'\n );\n }\n }\n\n // to walk \"something\", make an array of the name, even if we are not using multiple file uploads.\n if (!is_array($fileData['name'])) {\n $fileData['name'] = [$fileData['name']];\n $fileData['tmp_name'] = [$fileData['tmp_name']];\n }\n\n $originalDestination = $destination;\n\n $result = [];\n\n // walk all uploaded files\n foreach ($fileData['name'] as $index => $filename) {\n $tmpName = $fileData['tmp_name'][$index];\n\n // keep the original filename if wanted\n $lastChar = substr($originalDestination, -1);\n if ($lastChar == '/' || $lastChar == '\\\\') {\n $destination = $originalDestination . $filename;\n } else {\n $destination = $originalDestination;\n }\n\n // if the file exists...\n if (file_exists($destination)) {\n // throw exception wanted ?\n if ($existMode == FormUtils::MODE_EXCEPTION) {\n throw new Exception(sprintf(\n 'Could not upload the file \"%s\" to destination \"%s\" because ' .\n 'a file with this name already exists in this folder!',\n $filename,\n $destination\n ));\n } // should we rename the file...\n else {\n if ($existMode == FormUtils::MODE_RENAME) {\n $destination = FormUtils::getNonExistingFilename($destination);\n } // a different unkown mode is given, throw exception\n elseif ($existMode != FormUtils::MODE_OVERWRITE) {\n throw new UnexpectedValueException(\n 'Incorrect \"exists\" mode given! You have to use one of the ' .\n 'MODE constants of the FormUtils as mode!'\n );\n }\n }\n }\n\n $dirname = dirname($destination);\n // should we create the destination path if not exists?\n if ($createDestIfNotExist) {\n if (!is_dir($dirname) &&\n !mkdir(\n $dirname,\n is_bool($createDestIfNotExist) ? 0755 : $createDestIfNotExist,\n true\n )\n ) {\n throw new Exception(sprintf('Failed to create the destination directory \"%s\"', $dirname));\n }\n }\n\n if (!is_writable($dirname)) {\n throw new Exception(\n sprintf(\n 'Failed to move uploaded file because the destination ' .\n 'directory is not writable! Directory: \"%s\"',\n $dirname\n )\n );\n }\n\n // move the file\n if (move_uploaded_file($tmpName, $destination)) {\n $result[] = $destination;\n } else {\n throw new Exception(sprintf(\n 'Error, we failed to move file \"%s\" to destination \"%s\"',\n $tmpName,\n $destination\n ));\n }\n }\n\n return $field->isMultiple() ? $result : $result[0];\n }", "public function write($file, $content, $overwrite = true){\n\t\treturn false;\n\t}", "private function store_file($path, $name, $overwrite = false)\n {\n $fs = get_file_storage();\n if ($overwrite) {\n if ($file = $fs->get_file($this->context->id, 'mod_videoassessment', 'video', 0, '/', $name)) {\n $file->delete();\n }\n }\n $record = array(\n 'contextid' => $this->context->id,\n 'component' => 'mod_videoassessment',\n 'filearea' => 'video',\n 'itemid' => 0,\n 'filepath' => '/',\n 'filename' => $name);\n return $fs->create_file_from_pathname($record, $path);\n }", "function copy_file($from_loc, $to_loc)\n\t{\n\t\tglobal $phpbb_root_path;\n\n\t\t$from_loc = ((strpos($from_loc, $phpbb_root_path) !== 0) ? $phpbb_root_path : '') . $from_loc;\n\t\t$to_loc = $this->root_path . str_replace($phpbb_root_path, '', $to_loc);\n\n\t\tif (!file_exists($from_loc))\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\t$result = $this->overwrite_file($from_loc, $to_loc);\n\n\t\treturn $result;\n\t}", "public function overwriteFile($content, $file) {\t\n\t\ttry {\n\t\t\tif (!file_exists($file)) {\n\t\t\t\tself::write2File($content, $file);\n\t\t\t} else {\n\t\t\t\t$tempFile = tempnam('/tmp', __FUNCTION__.'.');\n\t\t\t\t$handle = fopen($tempFile, 'r');\n\t\t\t\tself::write2File($content, $tempFile);\n\t\t\t\tcopy($tempFile, $file);\t\t\t\t\n\t\t\t\tfclose($handle);\n\t\t\t\tunlink($tempFile);\n\t\t\t} //<-- end if -->\n\t\t\t\n\t\t\treturn TRUE;\n\t\t} catch (Exception $e) { \n\t\t\tthrow new Exception($e->getMessage().' from '.$this->className\n\t\t\t\t.'->'.__FUNCTION__.'() line '.__LINE__\n\t\t\t);\n\t\t} //<-- end try -->\t\t\n\t}", "public function getOverwrite() : bool\n {\n return $this->getProperty()->overwrite;\n }", "public static function zipFiles($documents, $destination, $overwrite = true)\n\t{\n\t\tif (file_exists($destination) && !$overwrite)\n return false;\n\n\t\tif (count($documents)) {\n\t\t\t$zip = new ZipArchive();\n\n\t\t\t$opened = $zip->open($destination, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE);\n\t\t\tif ($opened !== true)\n\t\t\t\treturn false;\n\n\t\t\tforeach ($documents as $document)\n $zip->addFile(Document::getDocumentFullPath($document),Document::getResumeFormattedBaseName($document));\n\n\t\t\t$zip->close();\n\n\t\t\treturn file_exists($destination);\n\t\t}\n\n\t\treturn false;\n\t}", "function checkExist(){\n GLOBAL $force,$tag,$checkfile;\n\n if(!$force && file_exists($checkfile)){\n $lastcommit = file_get_contents($checkfile);\n if($lastcommit == $tag) return true;\n }\n \n file_put_contents($checkfile, $tag);\n}", "function get_new_file_name(){\n $user_id = $_COOKIE[\"UserId\"];\n $Upload_Path = \"../../uploads/\";\n $file_name = rand(1, 1000000);\n if (!file_exists($file_name)){\n return $file_name;\n }else {\n get_new_file_name();\n }\n}", "function move_upload_file($srcfile, $destfile) {\n\t//if(IN_SAE) return copy($srcfile, $destfile);\n\t//$r = move_uploaded_file($srcfile, $destfile);\n\t$r = copy($srcfile, $destfile);\n\treturn $r;\n}", "public function setOverwriteFiles(bool $overwriteFiles): self\n {\n $this->overwriteFiles = $overwriteFiles;\n\n return $this;\n }", "function mover($source, $dest, $overwrite = false)\n{\n $a1 = copyr($source, $dest, $overwrite);\n if (!$a1) {\n return false;\n }\n\n $a2 = rmdirr($source);\n return $a2;\n}", "private function _determine_write_this()\n\t{\n\t\t// Not a directory and doesn't exist already...\n\t\tif (substr($this->_current['filename'], -1) !== '/' && !file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t{\n\t\t\t$this->_write_this = true;\n\t\t}\n\t\t// File exists... check if it is newer.\n\t\telseif (substr($this->_current['filename'], -1) !== '/')\n\t\t{\n\t\t\t$this->_write_this = $this->overwrite || filemtime($this->destination . '/' . $this->_current['filename']) < $this->_current['mtime'];\n\t\t}\n\t\t// Folder... create.\n\t\telseif ($this->destination !== null && !$this->single_file)\n\t\t{\n\t\t\t// Protect from accidental parent directory writing...\n\t\t\t$this->_current['filename'] = strtr($this->_current['filename'], array('../' => '', '/..' => ''));\n\n\t\t\tif (!file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t\t{\n\t\t\t\tmktree($this->destination . '/' . $this->_current['filename']);\n\t\t\t}\n\t\t\t$this->_write_this = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_write_this = false;\n\t\t}\n\t}", "function narrative_purge_files($old_narrative_dir, $new_narrative_dir)\n{\n $file_scan = scandir($old_narrative_dir);\n foreach ($file_scan as $filecheck)\n {\n $file_extension = pathinfo($filecheck, PATHINFO_EXTENSION);\n if ($file_extension == 'jpg')\n {\n rename($old_narrative_dir . $filecheck, $new_narrative_dir . $filecheck);\n }\n }\n}", "function uploadFile($file, $overwrite, $username) {\n $directory = getcwd().\"/../private_html/uploads/\". $username;\n echo($directory);\n $destination= $directory .\"/\". $file[\"name\"];\n \n //check to make sure the directory exists\n echo(is_dir($directory));\n if(!is_dir($directory)) {\n if(!mkdir($directory)) {\n die(\"Failed to make the directory! This should never happen!\");\n }\n }\n \n // Check for errors\n if($file['error'] > 0){\n return 'Error uploading';\n }\n\n // Check filetype\n //if($file['type'] != 'image/jpeg'){\n // return \"Invalid file type\";\n //}\n\n // Check filesize\n if($file['size'] > 500000){\n return 'File is too large';\n }\n\n //Check if the file exists\n if(!$overwrite and file_exists($destination)){\n return \"File already exists\";\n }\n\n // Upload file\n if(!move_uploaded_file($file['tmp_name'], $destination)){\n return 'Error movinvg file';\n }\n return 'Success';\n}", "public function upload($renameDuplicates = true) {\n $this->_renameDuplicates = $renameDuplicates;\n $uploaded = current($_FILES);\n if (is_array($uploaded['name'])) {\n foreach ($uploaded['name'] as $key => $value) {\n $currentFile['name'] = $uploaded['name'][$key];\n $currentFile['type'] = $uploaded['type'][$key];\n $currentFile['tmp_name'] = $uploaded['tmp_name'][$key];\n $currentFile['error'] = $uploaded['error'][$key];\n $currentFile['size'] = $uploaded['size'][$key];\n if ($this->checkFile($currentFile)) {\n $this->moveFile($currentFile);\n }\n }\n } else {\n if ($this->checkFile($uploaded)) {\n $this->moveFile($uploaded);\n }\n }\n }", "function upload_image($files, $dir, $oldfile ,$prefix)\r\n\t{\r\n\t\tif (!is_dir ($dir))\r\n\t\t{\r\n\t\t\tmkdir($dir,0777);\r\n\t\t\tchmod($dir,0777);\t\r\n\t\t}\r\n\t\r\n\t\tif ($oldfile != \"\" && is_file($dir.$oldfile))\r\n\t\t{\r\n\t\t\tunlink($dir.$oldfile);\r\n\t\t}\r\n\t\t\r\n\t\t$filename = $prefix.\"\".rand(0,999999999999).\"-\".$files[name];\r\n\t\t\r\n\t\tif (is_file($dir.$filename))\r\n\t\t\t$filename = $prefix.\"\".rand(0,999999999999).\"-\".rand(0,999999999999).\"-\".$files[name];\r\n\t\t\r\n\t\t//echo \t$dir.$filename; exit;\r\n\t\tif (move_uploaded_file($files[tmp_name],$dir.$filename))\r\n\t\t\treturn $filename;\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}", "public function save( $to, $allow_dir_create = false, $allow_override = false, $file_index = null ) {\r\n\t\t\t$to = ( $to === '/' || empty( $to ) ) ? './' : $to;\r\n\t\t\tfor( $i = 0; $i < $this->Files_valid_count; $i++ ) {\r\n\t\t\t\tif ( $file_index !== null && $file_index != $i ) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tif ( !$this->Files_valid[$i]['issaved'] ) {\r\n\t\t\t\t\t// generate a new filename or take the original\r\n\t\t\t\t\t$name = ( $this->is_uniq_filenames ) ? self::uniqString( $this->uniq_string_length ) : $this->Files_valid[$i]['name'];\r\n\t\t\t\t\t$this->Files_valid[$i]['name'] = $name;\r\n\t\t\t\t\t$this->Files_valid[$i]['savename'] = $name . '.' . $this->Files_valid[$i]['ext'];\r\n\t\t\t\t\t\r\n\t\t\t\t\t// try to move the file to its destination\r\n\t\t\t\t\tif ( $this->move_file( $i, $to, $allow_dir_create, $allow_override, false, true ) ) {\r\n\t\t\t\t\t\t$this->add_ready_file( $this->Files_valid[$i] );\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// error moving the file to its new destination\r\n\t\t\t\t\t\t$this->add_invalid_file( $this->Files_valid[$i], self::ERR_FILE_SAVE );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "private function write_file($filePath, $contents, $overwrite = false){\n if($overwrite === false && File::exists($filePath)){\n _warning('' . $filePath . ' already exists!');\n return;\n }\n\n File::mkdir(dirname($filePath));\n\n if(File::put($filePath, $contents) === false){\n _warning('Something went wrong writing the file ' . $filePath);\n }\n }", "public static function rename_file($from,$to){\n\t\tif(rename($from,$to)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function markFileExists($exists = true){\n $this->check_for_file = $exists ? 0 : 1;\n $this->last_file_checking = date('Y-m-d H:i:s');\n $this->save(false);\n }", "public function moveFile(array $fileInfo, $path, $overwrite = false, $appendNumber = false)\n {\n if ($fileInfo['error'] > 0) {\n switch ($fileInfo) {\n case 1:\n $msg = 'Size of uploaded file \"%s\" exceeds limit imposed by directive \"upload_max_filesize\" in php.ini';\n\n throw new UploadableIniSizeException(sprintf($msg, $fileInfo['name']));\n case 2:\n $msg = 'Size of uploaded file \"%s\" exceeds limit imposed by option MAX_FILE_SIZE in your form.';\n\n throw new UploadableFormSizeException(sprintf($msg, $fileInfo['name']));\n case 3:\n $msg = 'File \"%s\" was partially uploaded.';\n\n throw new UploadablePartialException(sprintf($msg, $fileInfo['name']));\n case 4:\n $msg = 'No file was uploaded!';\n\n throw new UploadableNoFileException(sprintf($msg, $fileInfo['name']));\n case 6:\n $msg = 'Upload failed. Temp dir is missing.';\n\n throw new UploadableNoTmpDirException($msg);\n case 7:\n $msg = 'File \"%s\" couldn\\'t be uploaded because directory is not writable.';\n\n throw new UploadableCantWriteException(sprintf($msg, $fileInfo['name']));\n case 8:\n $msg = 'A PHP Extension stopped the uploaded for some reason.';\n\n throw new UploadableExtensionException(sprintf($msg, $fileInfo['name']));\n default:\n throw new UploadableUploadException(sprintf('There was an unknown problem while uploading file \"%s\"',\n $fileInfo['name']\n ));\n }\n }\n\n $info = array(\n 'fileName' => '',\n 'filePath' => '',\n 'fileMimeType' => $fileInfo['type'],\n 'fileSize' => $fileInfo['size']\n );\n\n $info['fileName'] = $fileInfo['name'];\n $info['filePath'] = $path.'/'.$info['fileName'];\n\n if (is_file($info['filePath'])) {\n if ($overwrite) {\n $this->doRemoveFile($info['filePath']);\n } else if ($appendNumber) {\n $counter = 1;\n $extensionPos = strrpos($info['filePath'], '.');\n\n if ($extensionPos !== false) {\n $extension = substr($info['filePath'], $extensionPos);\n\n $fileWithoutExt = substr($info['filePath'], 0, strrpos($info['filePath'], '.'));\n\n $info['filePath'] = $fileWithoutExt.'-'.$counter.$extension;\n }\n\n do {\n $info['filePath'] = $fileWithoutExt.'-'.(++$counter).$extension;\n } while (is_file($info['filePath']));\n } else {\n throw new UploadableFileAlreadyExistsException(sprintf('File \"%s\" already exists!',\n $info['filePath']\n ));\n }\n }\n\n if ($this->moveUploadedFile($fileInfo['tmp_name'], $info['filePath'])) {\n return $info;\n } else {\n throw new UploadableUploadException(sprintf('File \"%s\" was not uploaded, or there was a problem moving it to the location \"%s\".',\n $fileInfo['fileName'],\n $path\n ));\n }\n }", "public function testUploadFail_FileExists()\n {\n $file = array(\"name\"=>\"zipSubfolder.zip\", \"size\"=>500, \"tmp_name\"=>__DIR__.'/zipSubfolder.zip');\n\n $service = $this->setMockPluginUploaderServiceExtract();\n\n // Create test file\n @touch(__DIR__.'/../../../storage/uploads/pluginuploader/zipSubfolder.zip');\n $result = $service->upload($file);\n @unlink(__DIR__.'/../../../craft/storage/uploads/pluginuploader/zipSubfolder.zip');\n\n // check we got the correct result\n $this->assertEquals('Sorry, file already exists.', $result);\n }", "public function clearFile() {\r\n\t\tif ($this->exists) {\r\n\t\t\t// create file\r\n\t\t\t$handler = fopen ( $this->filename, 'w' ) or die ( $this->error ['102'] );\r\n\t\t\t$this->setMetta ();\r\n\t\t\tfclose ( $handler );\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function file_copy_to_folder($source_file, $destination_folder, $filename)\n{\n $arrext = explode('.', $source_file['name']);\n $jml = count($arrext) - 1;\n $ext = $arrext[$jml];\n $ext = strtolower($ext);\n $ret = false;\n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n $destination_folder .= $filename . '.' . $ext;\n\n if (@move_uploaded_file($source_file['tmp_name'], $destination_folder)) {\n $ret = $filename . \".\" . $ext;\n }\n return $ret;\n}", "function tc_file_system_copy($source, $destination, $overwrite = false, $mode = false){\r\n\t\r\n\t//initialize processed files object\r\n\t$processed_files = WPTC_Factory::get('processed-restoredfiles',true);\r\n\t$current_processed_files = array();\r\n\t\r\n\tglobal $wp_filesystem;\r\n\tif($wp_filesystem->method == 'direct'){\r\n\t\t// check if already processed ; if so dont copy\r\n\t\t$processed_file = $processed_files->get_file($source);\r\n\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n -----processed_file obj------- \".var_export($processed_file,true).\"\\n\",FILE_APPEND);\r\n\t\tif ( !($processed_file) ) {\r\n\t\t\t$copy_result = $wp_filesystem->move($source, $destination, $overwrite, $mode);\r\n\t\t\tif($copy_result)\r\n\t\t\t{\r\n\t\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n ----adding details--------\\n\",FILE_APPEND);\r\n\t\t\t\t//if copied then add the details to DB\r\n\t\t\t\t$this_file_detail['file'] = $source;\r\n\t\t\t\t$this_file_detail['copy_status'] = true;\r\n\t\t\t\t$this_file_detail['revision_number'] = null;\r\n\t\t\t\t$this_file_detail['revision_id'] = null;\r\n\t\t\t\t$this_file_detail['mtime_during_upload'] = null;\r\n\t\t\t\t\r\n\t\t\t\t$current_processed_files[] = $this_file_detail;\r\n\t\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n -----current_processed_files------- \".var_export($current_processed_files,true).\"\\n\",FILE_APPEND);\r\n\t\t\t\t$processed_files->add_files($current_processed_files);\t\r\n\t\t\t\t//file_put_contents(WP_CONTENT_DIR .'/DE_clientPluginSIde.php',\"\\n ---any sql error------ \".var_export(mysql_error(),true).\"\\n\",FILE_APPEND);\r\n\t\t\t\t//set the in_progress option to false on final file copy\r\n\t\t\t}\r\n\t\t\treturn $copy_result;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\telseif($wp_filesystem->method == 'ftpext' || $wp_filesystem->method == 'ftpsockets'){\r\n\t\tif ( ! $overwrite && $wp_filesystem->exists($destination) )\r\n\t\t\treturn false;\r\n\t\t//$content = $this->get_contents($source);\r\n//\t\tif ( false === $content)\r\n//\t\t\treturn false;\r\n\t\t\t\r\n\t\t//put content\t\r\n\t\t//$tempfile = wp_tempnam($file);\r\n\t\t$source_handle = fopen($source, 'r');\r\n\t\tif ( ! $source_handle )\r\n\t\t\treturn false;\r\n\r\n\t\t//fwrite($temp, $contents);\r\n\t\t//fseek($temp, 0); //Skip back to the start of the file being written to\r\n\t\t\r\n\t\t$sample_content = fread($source_handle, (1024 * 1024 * 2));//1024 * 1024 * 2 => 2MB\r\n\t\tfseek($source_handle, 0); //Skip back to the start of the file being written to\r\n\r\n\t\t$type = $wp_filesystem->is_binary($sample_content) ? FTP_BINARY : FTP_ASCII;\r\n\t\tunset($sample_content);\r\n\t\tif($wp_filesystem->method == 'ftpext'){\r\n\t\t\t$ret = @ftp_fput($wp_filesystem->link, $destination, $source_handle, $type);\r\n\t\t}\r\n\t\telseif($wp_filesystem->method == 'ftpsockets'){\r\n\t\t\t$wp_filesystem->ftp->SetType($type);\r\n\t\t\t$ret = $wp_filesystem->ftp->fput($destination, $source_handle);\r\n\t\t}\r\n\r\n\t\tfclose($source_handle);\r\n\t\tunlink($source);//to immediately save system space\r\n\t\t//unlink($tempfile);\r\n\r\n\t\t$wp_filesystem->chmod($destination, $mode);\r\n\r\n\t\treturn $ret;\r\n\t\t\r\n\t\t//return $this->put_contents($destination, $content, $mode);\r\n\t}\r\n}", "public function processNewUpload($input_fieldname , $destination_dir , $destination_filename=''){\t\tglobal $_FILES;\n\t\tif(isset($_FILES[$input_fieldname]['tmp_name']) && is_file($_FILES[$input_fieldname]['tmp_name'])){\n\t\t\t// Does the destination directory exist?\n\t\t\tif(is_dir($destination_dir)){\n\t\t\t\t// Find out where we're moving the file.\n\t\t\t\t$this->temp_file = $_FILES[$input_fieldname]['tmp_name'];\n\t\t\t\tif($destination_filename){\n\t\t\t\t\t$this->target_filename = $destination_filename;\n\t\t\t\t} else {\n\t\t\t\t\t$this->target_filename = $_FILES[$input_fieldname]['name'];\n\t\t\t\t}\n\t\t\t\t// Move the file to the destination\n\t\t\t\tif(move_uploaded_file($this->temp_file , $destination_dir . $this->target_filename)){\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public static function updateUpload($tempFilename, $dbFilename, $keywords) {\n\n $newFilename = $dbFilename;\n\n // Cases 1.1 and 2.2.1\n // if the uploaded file has not been changed, nothing is performed\n if ($tempFilename != $dbFilename) {\n\n $uploadPath = Configuration::getPath('uploadsMedium');\n $tmbUploadPath = Configuration::getPath('uploadsThumb');\n $tempPath = Configuration::getPath('uploadsTempMedium');\n $tmbTempPath = Configuration::getPath('uploadsTempThumb');\n\n // Case 2.1\n // if the uploaded file has been changed ($tempFilename != $dbFilename),\n // the old file is deleted\n if ($dbFilename) {\n $oldPathname = $uploadPath . $dbFilename;\n if (file_exists($oldPathname)) {\n unlink($oldPathname);\n }\n $tmbOldPathname = $tmbUploadPath . $dbFilename;\n if (file_exists($tmbOldPathname)) {\n unlink($tmbOldPathname);\n }\n }\n\n // Case 1.2\n // if the uploaded file has been changed and there is no temp filename,\n // the file has been deleted\n if ( ! $tempFilename) {\n $newFilename = '';\n }\n else {\n\n // a new unique, descriptive name must be assigned to the new uploaded\n // file. The name stored in the database cannot be reused, because\n // the extensions of the database's name and of the new file may differ,\n // and the extension cannot just be changed, because that name with the\n // new extension may already exist.\n $newFilename = self::getDescriptiveUniqueFilename(\n $keywords, $tmbUploadPath, $tempFilename\n );\n\n $uploadPathname = $uploadPath . $newFilename;\n $tmbUploadPathname = $tmbUploadPath . $newFilename;\n\n // Case 2.2.2.1\n // if the new uploaded file is not in the temp directory, but in the\n // upload directory, the temp paths must be corrected.\n // In this case it is relevant that the file has a different filename\n // or it may be deleted when it is processed afterwards\n if (file_exists($tmbUploadPath . $tempFilename)) {\n $tempPath = $uploadPath;\n $tmbTempPath = $tmbUploadPath;\n }\n\n $tempPathname = $tempPath . $tempFilename;\n $tmbTempPathname = $tmbTempPath . $tempFilename;\n\n // if the new uploaded files are not found, an error has been produced\n // while the updating process\n if (( ! file_exists($tempPathname)) || ( ! file_exists($tmbTempPathname))) {\n $newFilename = null;\n }\n else {\n\n if ( ! file_exists($uploadPath)) {\n mkdir($uploadPath, 0777, true);\n }\n if ( ! file_exists($tmbUploadPath)) {\n mkdir($tmbUploadPath, 0777, true);\n }\n\n if (( ! rename($tempPathname, $uploadPathname))\n || ( ! rename($tmbTempPathname, $tmbUploadPathname))) {\n $newFilename = null;\n }\n }\n }\n }\n return $newFilename;\n }", "function serendipity_removeFiles($files = null) {\n global $serendipity, $errors;\n\n if (!is_array($files)) {\n return;\n }\n\n $backupdir = S9Y_INCLUDE_PATH . 'backup';\n if (!is_dir($backupdir)) {\n @mkdir($backupdir, 0777);\n if (!is_dir($backupdir)) {\n $errors[] = sprintf(DIRECTORY_CREATE_ERROR, $backupdir);\n return false;\n }\n }\n\n if (!is_writable($backupdir)) {\n $errors[] = sprintf(DIRECTORY_WRITE_ERROR, $backupdir);\n return false;\n }\n\n foreach($files AS $file) {\n $source = S9Y_INCLUDE_PATH . $file;\n $sanefile = str_replace('/', '_', $file);\n $target = $backupdir . '/' . $sanefile;\n\n if (!file_exists($source)) {\n continue;\n }\n\n if (file_exists($target)) {\n $target = $backupdir . '/' . time() . '.' . $sanefile; // Backupped file already exists. Append with timestamp as name.\n }\n\n if (!is_writable($source)) {\n $errors[] = sprintf(FILE_WRITE_ERROR, $source) . '<br />';\n } else {\n rename($source, $target);\n }\n }\n}", "function upload($temporal,$destino)\n{\n if(file_exists($destino) != true)\n {\n echo \"<br>El archivo ya existe\";\n move_uploaded_file($temporal,$destino);\n echo \"<img src='\".$destino.\"' width='200'>\";\n }\n else\n {\n echo \"ya existe el archivo\";\n }\n}", "public static function renamefile()\n\t{\n\t\tglobal $g_dir;\n\t\t$filetorename = $_POST['fileToRename'];\n\t\t$newfilename = $_POST['newRenamedFileName'];\n\n\t\t//$dir= '/var/www/html/UPLOADS/';\n\n\t\tif(rename($g_dir.$filetorename, $g_dir.$newfilename))\n\t\t\techo(\"Successfully renamed $filetorename to $newfilename!\");\n\t\telse\n\t\t\techo(\"ERROR: Could not rename $filetorename to $newfilename!\");\n\t}", "function mk_file( $filename ) {\n \n // if file doesn't exist, create file and close it\n if ( ! is_file( $filename ) ) {\n fclose( fopen($filename, 'x' ) );\n return true;\n }\n\n // file already exist \n return false;\n}", "function checkAndMoveFile($filekey, $sizelimit, $newname){\r\n // modified from http://www.php.net/manual/en/features.file-upload.php\r\n // Undefined | Multiple Files | $_FILES Corruption Attack\r\n // if this request falls under any of them, treat it invalid.\r\n if(!isset($_FILES[$filekey]['error']) || is_array($_FILES[$filekey]['error'])) {\r\n $errors['imgpmt'] = true;\r\n }\r\n\r\n // check error value of file\r\n switch ($_FILES[$filekey]['error']) {\r\n case UPLOAD_ERR_OK:\r\n break;\r\n case UPLOAD_ERR_INI_SIZE:\r\n case UPLOAD_ERR_FORM_SIZE:\r\n $errors['imgsize'] = true;\r\n default:\r\n $errors['unknown'] = true;\r\n }\r\n\r\n if ($_FILES[$filekey]['size'] > $sizelimit) {\r\n $errors['imgsize'] = true; // if the file size is too large, display appropriate error message\r\n }\r\n\r\n if (exif_imagetype( $_FILES[$filekey]['tmp_name']) != IMAGETYPE_GIF\r\n and exif_imagetype( $_FILES[$filekey]['tmp_name']) != IMAGETYPE_JPEG\r\n and exif_imagetype( $_FILES[$filekey]['tmp_name']) != IMAGETYPE_PNG){\r\n $errors['imgfmt'] = true; // if the file is not an image, display appropriate error message\r\n }\r\n\r\n $upload_res = move_uploaded_file($_FILES[$filekey]['tmp_name'], $newname); // move the file to the specified location\r\n if(!$upload_res) {\r\n $errors['mvfailure'] = true; // if the move failed, display appropriate error message\r\n }\r\n }", "public function moveTo($destination)\n {\n if ($this->exists()) {\n $result = move_uploaded_file($this->current_filepath, $destination);\n\n if ($result) {\n $this->current_filepath = $destination;\n }\n\n return $result;\n }\n return false;\n }", "function rename($file)\r\n {\r\n if(!empty($_POST['rename']))\r\n {\r\n if(rename($_POST['file'],$_POST['rename']));\r\n return 1;return 0;\r\n }\r\n }", "public function testOverwriteSuccess()\n {\n $mock_response = new MockHttpResponse(\n 200,\n json_encode([\n 'filename' => 'somefilename.jpg',\n 'size' => '1000',\n 'type' => 'image/jpg',\n 'url' => 'https://cdn.filestack.com/somefilehandle',\n ]),\n );\n $stub_http_client = $this->createMock(\\GuzzleHttp\\Client::class);\n $stub_http_client->method('request')\n ->willReturn($mock_response);\n\n $client = new FilestackClient(\n $this->test_api_key,\n $this->test_security,\n $stub_http_client\n );\n\n $filelink = $client->overwrite($this->test_filepath, $this->test_file_handle);\n $this->assertNotNull($filelink);\n }", "function uploadFile($file,$file_name,$dir,$old_name,$validExtensions=array('jpg','gif','jpeg','pdf','xls','zip','gz','png','psd','rar','zip','doc','txt','log','csv','tar','flv','swf','mp3','ogg','avi','mpg','mpeg','doc','docx','ppt','pptx'))\n\t{\n\t\tif($file !='')\n\t\t{\n\t\t\t$dest = $dir.\"/\".$file_name;\n\t\t\twhile ( file_exists($dest) )\n\t\t\t{\n\t\t\t\t$file_name = rand(1000,1000000).$file_name;\n\t\t\t\t$dest = $dir.\"/\".$file_name;\n\t\t\t}\n\t\t\t$fileExt=strtolower(cmfcFile::getFileExtension($dest));\n\t\t\tif (!in_array($fileExt,$validExtensions)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$res = move_uploaded_file($file,$dest);\n\t\t\t$dest=cmfcDirectory::normalizePath($dest);\n\t\t\t//if (file_exists($dest)) {\n\t\t\t\tchmod($dest,0755);\n\t\t\t\treturn $file_name;\n\t\t\t//} else {\n\t\t\t\treturn false;\n\t\t\t//}\n\t\t} else {\n\t\t\treturn $old_name;\n\t\t}\n\t}", "function final_move($bean_id)\n\t{\n\t\tglobal $log, $root_directory, $upload_dir;\n\t\t$log->debug(\"Entering final_move(\".$bean_id.\") method ...\");\n\n\t\t$file_name = $bean_id.$this->stored_file_name;\n\t\t$destination = $root_directory.'/'.$upload_dir.$file_name;\n\n\t\tif (!move_uploaded_file($_FILES[$this->field_name]['tmp_name'], $destination)) {\n\t\t\tdie (\"ERROR: can't move_uploaded_file to destination\");\n\t\t}\n\t\t$log->debug(\"Exiting final_move method ...\");\n\t\treturn true;\n\t}", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "function uploadSuppFile($fileName, $fileId = null, $overwrite = true) {\n\t\treturn $this->handleUpload($fileName, ARTICLE_FILE_SUPP, $fileId, $overwrite);\n\t}", "function rename_file($file_id, $new_file_name, $replace_file_name = '')\n\t{\n\t\tee()->load->model(array('file_upload_preferences_model', 'file_model'));\n\n\t\t$replace = FALSE;\n\n\t\t// Get the file data form the database\n\t\t$previous_data = ee()->file_model->get_files_by_id($file_id);\n\t\t$previous_data = $previous_data->row();\n\n\t\t// If the new name is the same as the previous, get out of here\n\t\tif ($new_file_name == $previous_data->file_name)\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'success'\t=> TRUE,\n\t\t\t\t'replace'\t=> $replace,\n\t\t\t\t'file_id'\t=> $file_id\n\t\t\t);\n\t\t}\n\n\t\t$directory_id\t\t= $previous_data->upload_location_id;\n\t\t$old_file_name\t\t= $previous_data->file_name;\n\t\t$upload_directory\t= $this->fetch_upload_dir_prefs($directory_id);\n\n\n\t\t// If they renamed, we need to be sure the NEW name doesn't conflict\n\t\tif ($replace_file_name != '' && $new_file_name != $replace_file_name)\n {\n\t\t\tif (file_exists($upload_directory['server_path'].$new_file_name))\n\t\t\t{\n\t\t\t\t$replace_data = ee()->file_model->get_files_by_name($new_file_name, $directory_id);\n\n\t\t\t\tif ($replace_data->num_rows() > 0)\n\t\t\t\t{\n\t\t\t\t\t$replace_data = $replace_data->row();\n\n\t\t\t\t\treturn array(\n\t\t\t\t\t\t'success'\t=> FALSE,\n\t\t\t\t\t\t'error'\t=> 'retry',\n\t\t\t\t\t\t'replace_filename' => $replace_data->file_name,\n\t\t\t\t\t\t'file_id'\t=> $file_id\n\t\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn array(\n\t\t\t\t\t'success'\t=> FALSE,\n\t\t\t\t\t'error'\t=> lang('file_exists_replacement_error'),\n\t\t\t\t\t'file_id'\t=> $file_id\n\t\t\t\t\t);\n \t}\n }\n\n\t\t// Check to see if a file with that name already exists\n\t\tif (file_exists($upload_directory['server_path'] . $new_file_name))\n\t\t{\n\t\t\t// If it does, delete the old files and remove the new file\n\t\t\t// record in the database\n\n\t\t\t$replace = TRUE;\n\t\t\t$previous_data = $this->_replace_file($previous_data, $new_file_name, $directory_id);\n\t\t\t$file_id = $previous_data->file_id;\n\t\t}\n\n\t\t// Delete the thumbnails\n\t\tee()->file_model->delete_raw_file($old_file_name, $directory_id, TRUE);\n\n\t\t// Rename the actual file\n\t\t$file_path = $this->_rename_raw_file(\n\t\t\t$old_file_name,\n\t\t\t$new_file_name,\n\t\t\t$directory_id\n\t\t);\n\n\t\t$new_file_name = str_replace($upload_directory['server_path'], '', $file_path);\n\n\t\t// If renaming the file sparked an error return it\n\t\tif (is_array($file_path))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'success'\t=> FALSE,\n\t\t\t\t'error'\t\t=> $file_path['error']\n\t\t\t);\n\t\t}\n\n\t\t// Update the file record\n\t\t$updated_data = array(\n\t\t\t'file_id'\t=> $file_id,\n\t\t\t'file_name'\t=> $new_file_name,\n\t\t);\n\n\t\t// Change title if it was automatically set\n\t\tif ($previous_data->title == $previous_data->file_name)\n\t\t{\n\t\t\t$updated_data['title'] = $new_file_name;\n\t\t}\n\n\t\t$file = $this->save_file(\n\t\t\t$file_path,\n\t\t\t$previous_data->upload_location_id,\n\t\t\t$updated_data\n\t\t);\n\n\t\treturn array(\n\t\t\t'success'\t=> TRUE,\n\t\t\t'replace'\t=> $replace,\n\t\t\t'file_id'\t=> ($replace) ? $file['file_id'] : $file_id\n\t\t);\n }", "public function renameIfExists(UploadedFile $file)\n {\n if ($this->getStorage()->exists(\"{$this->getDirectory()}/$this->name\")) {\n $this->name = $this->generateUniqueName($file);\n }\n }", "function _wp_check_existing_file_names($filename, $files)\n {\n }", "public static function createFile($path, $contents, $overwrite = TRUE) : bool\n {\n $fileExists = is_file($path);\n \n if ($fileExists && !$overwrite) {\n throw new Exception(\"File Exists and not allowed to overwrite\");\n }\n\n $File = new File($path, true);\n\n try {\n if ($File->exists() && $File->writable()) {\n $File->write($contents);\n\n return true;\n }\n } finally {\n $File->close();\n }\n \n return false;\n }", "public function testRename()\n {\n $oldFilename = static::$baseFile . '/fs/tmp.txt';\n $newFilename = static::$baseFile . '/fs/test/tmp.txt';\n\n file_put_contents($oldFilename, 'It works!');\n\n $this->assertTrue(rename($oldFilename, $newFilename));\n\n $this->assertFalse(file_exists($oldFilename));\n $this->assertTrue(file_exists($newFilename));\n }", "public function fileExists($name);" ]
[ "0.65913475", "0.65009964", "0.62726325", "0.6230604", "0.6198522", "0.61751753", "0.6126193", "0.60714275", "0.6038394", "0.60343426", "0.6023347", "0.5906463", "0.5875084", "0.5840433", "0.57954687", "0.5792802", "0.5788634", "0.5781003", "0.5777803", "0.5717185", "0.5717185", "0.5717185", "0.57169414", "0.5693896", "0.56887174", "0.5679403", "0.56613797", "0.5640284", "0.56062734", "0.55442506", "0.5499077", "0.54886633", "0.54847056", "0.5477656", "0.54119253", "0.53818077", "0.53766805", "0.5344727", "0.53010595", "0.5293474", "0.5266074", "0.52554435", "0.524611", "0.52270323", "0.5221059", "0.5174048", "0.5173502", "0.5167043", "0.51622546", "0.5144089", "0.51396316", "0.51363677", "0.51254255", "0.51115966", "0.5107024", "0.5101853", "0.5101825", "0.5075323", "0.50669396", "0.50635344", "0.50486207", "0.50407237", "0.50401115", "0.5035212", "0.5033201", "0.5029609", "0.501984", "0.49980423", "0.49841553", "0.497722", "0.49765557", "0.49745873", "0.49714187", "0.49679178", "0.49659523", "0.49553847", "0.4949988", "0.49489152", "0.4941003", "0.49386466", "0.49352437", "0.49346456", "0.49323604", "0.49313515", "0.49280408", "0.49278095", "0.49229932", "0.49165693", "0.4916507", "0.4910487", "0.4909999", "0.49076265", "0.49072412", "0.49033025", "0.49022123", "0.4900815", "0.48967728", "0.48901203", "0.4887631", "0.48708487" ]
0.7114448
0
/ SELECT l1_class.l1id,l1name,l2id,l2name FROM l1_class LEFT OUTER JOIN l2_class ON (l1_class.l1id=l2_class.l1id) WHERE l1_class.l1id in (4,5) and l2id in (15,30) ORDER BY l1_class.l1id;
function classifyTheCall( $callid, &$arL1, &$arL2) { $retval = true; if(ctype_digit($callid) and $callid > 0) { $dbConnect = dbconnect(); $sql = "BEGIN;"; /* get rid of all that's there already */ $sql .= "DELETE FROM call_l1_class WHERE callid={$callid};"; $sql .= "DELETE FROM call_l2_class WHERE callid={$callid};"; if(isset($arL1) and is_array($arL1) and sizeof($arL1) > 0) { foreach( $arL1 as $l1id) { $sql .= "INSERT INTO call_l1_class (callid,l1id) VALUES ({$callid}, {$l1id});"; } } if(isset($arL2) and is_array($arL2) and sizeof($arL2) > 0) { foreach( $arL2 as $l2id) { $sql .= "INSERT INTO call_l2_class (callid,l2id) VALUES ({$callid}, {$l2id});"; } } $sql .= "COMMIT"; $result = pg_query( $dbConnect, $sql); if (!$result) { $message = 'Invalid query: ' . pg_result_error( $result) . "\n"; $message .= 'Whole query: ' . $sql; printErrorMessage($message); $retval=false; } dbclose($dbConnect); } else { $retval = false; } return $retval; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sql_leftJoin(){\n\t\t$dbconnection = $this->db_connect();\n\t\tif($dbconnection !=1)\n\t\t{\n\t\t\t$result=\"MySql Connection Error\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//LIST OF SELECTIONS\n\t\t\t//INSTEAD of a listOfFields I need a listOfSelections like \"db.tbl_1.fld_1\"\n\t\t\t// a_selections = array(\"db.tbl_1.fld_1\",\"db.tbl_1.fld_2\",\"db.tbl_2.fld_1\");\n\t\t\t\n\t\t\tif($this->a_fields !=\" \"){\n\t\t\t\t$a_selections = $this->arraySELECTIONS($this->db,$this->table,$this->a_fields);\n\t\t\t}else{\n\t\t\t\t$a_selections = $this->db.\".\".$this->table.\" \";\n\t\t\t}\n\t\t\t\n\t\t\tif($this->a_fields2 !=\" \"){\n\t\t\t\t$a_selections2 = $this->arraySELECTIONS($this->db2,$this->table2,$this->a_fields2);\n\t\t\t}else{\n\t\t\t\t$a_selections2 = $this->db2.\".\".$this->table2.\" *\";\n\t\t\t}\n\t\t\t\n \t\t\t$listOfSelections = $this->arrayFieldsToList($a_selections);\n\t\t\t$listOfSelections2 = $this->arrayFieldsToList($a_selections2);\n\t\t\t\n \t\t\t$sql = mysql_query(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n\t\t\t\n \t\t\t //echo(\"SELECT \".$listOfSelections.\",\".$listOfSelections2.\" FROM \".$this->db.\".\".$this->table.\" LEFT JOIN \".$this->db2.\".\".$this->table2.\" ON \".$this->db.\".\".$this->table.\".\".$this->relation.\" = \".$this->db2.\".\".$this->table2.\".\".$this->relation2.\"\");\n \t\t\t\tif (mysql_num_rows($sql) > 0) \n\t\t\t \t{\n\t\t\t \twhile ($row = mysql_fetch_assoc($sql)) \n\t\t\t \t{\n\t\t\t \t$a_data[]=$row ;\n\t\t\t \t}\n\t\t \t\t$result= $a_data;\t\n\t\t\t\t}else{\n\t\t\t\t\t$result=\"NO DATA AVAILABLE\";\n\t\t\t\t}\n\t\t}\n\t\treturn $result;\n\t\n\t}", "private function joins()\r\n {\r\n /* SELECT* FROM DOCUMENT WHERE DOCUMENT.\"id\" IN ( SELECT ID FROM scholar WHERE user_company_id = 40 )*/\r\n\r\n $query = EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n ->sql();\r\n\r\n $table = EyufDocument::find()\r\n ->where('\"id\" IN ' . $query)\r\n ->all();\r\n\r\n $second = EyufDocument::findAll(EyufScholar::find()\r\n ->select('id')\r\n ->where([\r\n 'user_company_id' => 40\r\n ])\r\n );\r\n\r\n vdd($second);\r\n }", "public static function doLeftJoin($table2, $params=NULL, $fields=array()) {\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$what = parent::_getSelectFields($fields);\n\t\t$conn->leftJoin(self::TABLE_NAME, $table2, $what);\n\t\treturn DbModel::doSelect($conn, new ProjectsListingsModel());\n\t}", "function joinQuery()\n {\n }", "public function leftjoinrecto($classname, $classnameon = \"\")\n {\n $this->join = strtolower($classname);\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $from = '';\n// if($this->sequence == 'delete')\n// $from = \" from `\" . $this->table . \"` \";\n // on \".strtolower(get_class($entity)).\".id = \".strtolower(get_class($entity_owner)).\".\".strtolower(get_class($entity)).\"_id\n $this->query .= $from . \" left join `\" . $this->join . \"` on \" . $this->join . \".\" . strtolower($classnameon) . \"_id = \" . strtolower($classnameon) . \".id\";\n// $this->query .= \" left join `\" . $this->join . \"` \";\n $this->sequence = '';\n\n return $this;\n }", "public function leftjoin($classname, $classnameon = \"\")\n {\n $this->join = strtolower($classname);\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $from = '';\n// if($this->sequence == 'delete')\n// $from = \" from `\" . $this->table . \"` \";\n // on \".strtolower(get_class($entity)).\".id = \".strtolower(get_class($entity_owner)).\".\".strtolower(get_class($entity)).\"_id\n $this->query .= $from . \" left join `\" . $this->join . \"` on \" . $this->join . \".id = \" . strtolower($classnameon) . \".\" . $this->join . \"_id\";\n// $this->query .= \" left join `\" . $this->join . \"` \";\n $this->sequence = '';\n\n return $this;\n }", "function return_join_table_data($rt_or_left_or_none,$tableleft,$tableright,$on_a_and_b,$whereby=null,$orderby=null,$returnrows=\"a.*,b.*\") {\n\t$q = \"\n\tSELECT \".$returnrows.\"\n\tFROM \".$tableleft.\" AS a \".$rt_or_left_or_none.\" JOIN \".$tableright.\" AS b ON \".$on_a_and_b.\" \n\t\".$whereby.\" \n\t\".$orderby.\" \n\t\";\n\t//echo $q;\n\t$r = mysql_query($q) or die(\"return_join_table_data($rt_or_left_or_none,$tableleft,$tableright): \".mysql_error());\n\treturn check_results($r);\n}", "function GetMultipleDataJoin($table1=false,$table2=false,$filter1=false,$filter2=false)\n\t{\t//echo $table1; echo $table2; echo $filter1; echo $filter2;die;\n\t\t$qry=$this->db->query(\"select $table1.*,$table2.* from $table1,$table2 where $table1.$filter1=$table2.$filter1 \");//print_r($qry);die;\n\t\treturn $qry->result();\n\t}", "function get_lessons(){\n\n $sql = \"SELECT * FROM lessons \n\t\tLEFT JOIN submit_deadline ON lessons.id = submit_deadline.lessons_id ORDER BY submit_deadline.due_date ASC\";\n $query = $this->db->query($sql);\n\n return $query;\n\t}", "function dt_core_join_left_filter( $parts ) {\n\tif( isset($parts['join']) && !empty($parts['join']) ) {\n\t\t$parts['join'] = str_replace( 'INNER', 'LEFT', $parts['join']);\n\t}\n\treturn $parts;\n}", "public function get_classification_wise_course(){\n\t\t$this->db->select('classification_list.c_name,classification_list.c_id')->from('course_list');\n\t\t$this->db->join('classification_list ', 'classification_list.c_id = course_list.classification_id', 'left');\n\t\t$this->db->group_by('classification_list.c_id',1);\n\t\t$this->db->where('course_list.published_status',1);\n\t\t$this->db->where('course_list.published',1);\n\t\t$return=$this->db->get()->result_array();\n\t\tforeach($return as $lis){\n\t\t\t$course_list='';\n\t\t\t$course_list=$this->classification_wise_course_list($lis['c_id']);\n\t\t\tif(isset($course_list) && count($course_list)>0){\n\t\t\t\t$data[$lis['c_id']]=$lis;\n\t\t\t\t$data[$lis['c_id']]['course_list']=isset($course_list)?$course_list:'';\n\t\t\t}\n\t\t}\n\t\tif(!empty($data)){\n\t\t\treturn $data;\n\t\t}\n\t}", "function listInOrder()\n {\n global $BD3;\n global $BD1;\n global $ANO_REF;\n $res_sql=\"select $BD3.final.id,\n $BD3.final.matr,\n $BD1.empregados.nome,\n $BD3.final.cargo,\n $BD3.final.agrup\n from $BD3.final,$BD1.empregados\n where $BD1.empregados.matr=$BD3.final.matr\n AND $BD3.final.ano='$ANO_REF'\n order by $BD1.empregados.nome;\";\n return sql(\"$BD3\",$res_sql);\n }", "public function class_wise_student_list($class_id){\n\t $this->db->select('users.class_name,users.name,users.u_id')->from('users');\n\t\t $this->db->where('users.class_name',$class_id);\n\t\t $this->db->where('users.role_id',7);\n\t\t $this->db->where('users.status',1);\n\t\t $this->db->where('users.bus_transport','Yes');\n\t\t return $this->db->get()->result_array(); \n\t }", "function candidatosXLista($id){\n\t\t $sql = \"SELECT C.idlista, L.nombrelista,nombrecandidato, apellidocandidato, cargocandidato, imagencandidato\n\t\t FROM candidato C LEFT JOIN LISTA L ON C.idlista = L.idlista\n\t\t WHERE C.idlista = \".$id.\"order by cargocandidato ASC ;\";\n\t\treturn $sql;\n\t }", "function school_list($limit='',$start=0,$condition='')\n{\n\tglobal $DB;\n\t$sql =\"SELECT ms.*,mus.userid,mus.schoolid,mu.firstname,mu.lastname FROM {school} ms left join \";\n\t$sql.=\"(select * from {user_school} where role='incharge') mus on mus.schoolid=ms.id left join {user} mu on mu.id=mus.userid\";\n\t$sql.=\" WHERE ms.activestatus=1 and mu.deleted=0 $condition group by ms.id order by ms.id desc limit $start,$limit \";\n\t$result = $DB->get_records_sql($sql);\n\treturn $result;\n}", "public function leftJoin() {\r\n\t\t$args = func_get_args();\r\n\t\t$name = array_shift($args);\r\n\t\t$joined = array_shift($args);\r\n\t\tif (!$name) $name = '___' . $joined;\r\n\t\t//if (count(array_keys(self::$_joinStack, $joined)) > 1) {\r\n\t\tif (in_array($joined, self::$_joinStack)) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tself::$_joinStack[] = get_class($this);\r\n\t\tself::$_joinStack[] = $joined;\r\n\t\t$model = null;\r\n\t\tif (is_string($joined)) {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = new $joined();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tif (is_subclass_of($joined, 'Dbi_Model')) {\r\n\t\t\t\t$model = $joined;\r\n\t\t\t}\r\n\t\t}\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tarray_pop(self::$_joinStack);\r\n\t\tif (is_null($model)) {\r\n\t\t\tthrow new Exception('Queries can only join models.');\r\n\t\t}\r\n\t\t$this->_leftJoins[] = array(\r\n\t\t\t'name' => $name,\r\n\t\t\t'model' => $model,\r\n\t\t\t'args' => $args\r\n\t\t);\r\n\t}", "function leftJoin($conditions)\n\t{\n\t\treturn $this->join('LEFT', $conditions);\n\t}", "public function getAllClassRoomWithClassEnrolment()\n {\n $sql = 'SELECT * FROM ' . $this->class_room .\n ' left join ' . $this->class_enrolment . ' \n on ' . $this->class_room . '.id = ' . $this->class_enrolment . '.class_room_id\n left join ' . $this->wpdb->prefix . 'users\n on ' . $this->class_enrolment . '.wp_user_id = ' . $this->wpdb->prefix . 'users.id';\n\n// return $sql;\n return $this->wpdb->get_results($sql, OBJECT_K);\n\n }", "public function fetchDummyRegisteredAcademicProgress($lintidreg) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n\t // get the courses\r\n $sql = $db->select()\r\n ->from(array('a' => 'tbl_academicprogress_subjects'),array('a.*'))\r\n ->joinLeft(array('b' => 'tbl_definationms'),'a.IdCourseType =b.idDefinition',array('b.DefinitionDesc as SubjectType'))\r\n ->joinLeft(array('d'=>'tbl_subjectmaster'),'a.CourseID = d.IdSubject',array('d.SubjectName','d.SubCode'))\r\n ->where('a.IdStudent = ?',$lintidreg)\r\n ->where('a.IsRegistered = ?','2')\r\n ->order('a.IdAcademicProgressSub DESC');\r\n $result = $db->fetchAll($sql);\r\n return $result;\r\n }", "public function joinPartialTree($table1,$table2,$num_td_to_join)\n {\n //echo \"je tente d'accèder à la cellule $num_td_to_join<br>\";\n $temp_td=$table1->getCellule(1,$num_td_to_join);\n // echo $table1->htmlValue().$table2->htmlValue().\"<br>\";\n $temp_td->setValue($table2,true);\n $temp_td->setValign(\"top\");\n return $table1;\n }", "public function leftOuterJoin($table);", "public function load($l1Id, $optionL2Id){\r\n\t\t$sql = 'SELECT * FROM learnable_language_options WHERE l1_id = ? AND option_l2_id = ? ';\r\n\t\t$sqlQuery = new SqlQuery2($sql);\r\n\t\t$sqlQuery->setNumber($l1Id);\r\n\t\t$sqlQuery->setNumber($optionL2Id);\r\n\r\n\t\treturn $this->getRow($sqlQuery);\r\n\t}", "function get_list()\n {\n \tif($this->table_name === null)\n \t\treturn false;\n \t\n \t$select = \"{$this->table_name}.*\";\n $select .= \", deposito.no_rekening, nasabah.NAMA_NASABAH, nasabah.ALAMAT,\";\n \t\n\t\t// ADD YOUR SELECT FROM JOIN HERE <------------------------------------------------------\n\t\t// for example $select .= \", user_log.created_date, user_log.update_date\";\n\t\t\n \tif(!empty($this->relation))\n \t\tforeach($this->relation as $relation)\n \t\t{\n \t\t\tlist($field_name , $related_table , $related_field_title) = $relation;\n \t\t\t$unique_join_name = $this->_unique_join_name($field_name);\n \t\t\t$unique_field_name = $this->_unique_field_name($field_name);\n \t\t\t\n\t\t\t\tif(strstr($related_field_title,'{'))\n \t\t\t\t$select .= \", CONCAT('\".str_replace(array('{','}'),array(\"',COALESCE({$unique_join_name}.\",\", ''),'\"),str_replace(\"'\",\"\\\\'\",$related_field_title)).\"') as $unique_field_name\";\n \t\t\telse \t\t\t\n \t\t\t\t$select .= \", $unique_join_name.$related_field_title as $unique_field_name\";\n \t\t\t\n \t\t\tif($this->field_exists($related_field_title))\n \t\t\t\t$select .= \", {$this->table_name}.$related_field_title as '{$this->table_name}.$related_field_title'\";\n \t\t}\n \t\t\n \t$this->db->select($select, false);\n \t\n // ADD YOUR JOIN HERE for example: <------------------------------------------------------\n // $this->db->join('user_log','user_log.user_id = users.id');\n $this->db->join('nasabah','nasabah.NASABAH_ID = '.$this->table_name.'.NASABAH_ID');\n \t$results = $this->db->get($this->table_name)->result();\n \t\n \treturn $results;\n }", "function class_list($filter,$start,$end){\r\n\t\t\t$query = \"SELECT class.*, teacher1.karyawan_nama as class_teacher1, teacher2.karyawan_nama as class_teacher2, teacher3.karyawan_nama as class_teacher3,\r\n\t\t\t\t\t\tTIME_FORMAT(class.class_time_start,'%H:%i') as time_start,\r\n\t\t\t\t\t\tTIME_FORMAT(class.class_time_end,'%H:%i') as time_end\r\n\t\t\t\t\tFROM class\r\n\t\t\t\t\tLEFT JOIN karyawan teacher1 on (teacher1.karyawan_id = class.class_teacher1)\r\n\t\t\t\t\tLEFT JOIN karyawan teacher2 on (teacher2.karyawan_id = class.class_teacher2)\r\n\t\t\t\t\tLEFT JOIN karyawan teacher3 on (teacher3.karyawan_id = class.class_teacher3)\r\n\t\t\t\t\t\";\r\n\t\t\t\r\n\t\t\t// For simple search\r\n\t\t\tif ($filter<>\"\"){\r\n\t\t\t\t$query .=eregi(\"WHERE\",$query)? \" AND \":\" WHERE \";\r\n\t\t\t\t$query .= \" (class_name LIKE '%\".addslashes($filter).\"%' OR class_location LIKE '%\".addslashes($filter).\"%' OR class_notes LIKE '%\".addslashes($filter).\"%' )\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$result = $this->db->query($query);\r\n\t\t\t$nbrows = $result->num_rows();\r\n\t\t\t$limit = $query.\" LIMIT \".$start.\",\".$end;\t\t\r\n\t\t\t$result = $this->db->query($limit); \r\n\t\t\t\r\n\t\t\tif($nbrows>0){\r\n\t\t\t\tforeach($result->result() as $row){\r\n\t\t\t\t\t$arr[] = $row;\r\n\t\t\t\t}\r\n\t\t\t\t$jsonresult = json_encode($arr);\r\n\t\t\t\treturn '({\"total\":\"'.$nbrows.'\",\"results\":'.$jsonresult.'})';\r\n\t\t\t} else {\r\n\t\t\t\treturn '({\"total\":\"0\", \"results\":\"\"})';\r\n\t\t\t}\r\n\t\t}", "function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }", "public function _complex_join()\n {\n // LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n // LEFT JOIN (SELECT a.* FROM `%1$sproout` as a INNER JOIN (SELECT max(`id`) as id FROM `%1$sproout` group by `jpid`) as b on a.id = b.id) as `%1$sproout` on `%1$spro`.`id` = `%1$sproout`.`jpid`\n // LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n\n $join = sprintf('LEFT JOIN `%1$sproin` ON `%1$spro`.`id` = `%1$sproin`.`jpid`\n LEFT JOIN `%1$sauth_group` on `%1$spro`.`depid` = `%1$sauth_group`.`id`\n LEFT JOIN `%1$sproout` on `%1$sproout`.`jpid` = `%1$spro`.`id`\n LEFT JOIN `%1$sproout` tmp_out on tmp_out.`jpid` = `%1$sproout`.`jpid` and tmp_out.`id` > `%1$sproout`.`id`\n LEFT JOIN `%1$scust` on `%1$spro`.`cid` = `%1$scust`.`id`', C('DB_PREFIX'));\n return $join;\n }", "function common_el($l1, $l2) {\n $vx = lvar('x');\n\n return conj(\n choice($vx, $l1),\n choice($vx, $l2));\n}", "public function f_get_distPoints()\n {\n\n // $sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name \n // FROM md_dist_point a , md_dm_bdo b \n // WHERE a.dist_cd = b.dist_cd\n // AND a.sdo = b.sdo_cd\n // AND a.bdo = b.sl_no \");\n\n$sql = $this->db->query(\"SELECT DISTINCT a.sl_no, b.bdo_name,c.sdo_name sdo_name,a.agent\n FROM md_dist_point a , md_dm_bdo b ,md_dm_sdo c\n WHERE a.dist_cd = b.dist_cd \n AND b.dist_cd = c.dist_cd\n and a.sdo =c.sl_no\n and a.bdo = b.sl_no\");\n echo $this->db->last_query();\n return $sql->result();\n \n }", "private static function selectAndJoins()\n {\n $sql = \"SELECT * FROM \" . dbPerformance::DBNAME;\n\n $sql .= \" INNER JOIN \" . dbCompetition::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::COMPETITOINID . \" = \" . dbCompetition::DBNAME . \".\" . dbCompetition::ID;\n $sql .= \" INNER JOIN \" . dbDisziplin::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::DISZIPLINID . \" = \" . dbDisziplin::DBNAME . \".\" . dbDisziplin::ID;\n $sql .= \" INNER JOIN \" . dbAthletes::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ATHLETEID . \" = \" . dbAthletes::DBNAME . \".\" . dbAthletes::ID;\n $sql .= \" LEFT JOIN \" . dbPerformanceDetail::DBNAME . \" ON \" . dbPerformance::DBNAME . \".\" . dbPerformance::ID . \" = \" . dbPerformanceDetail::DBNAME . \".\" . dbPerformanceDetail::PERFORMANCEID;\n\n $sql .= \" INNER JOIN \" . dbCompetitionLocations::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::LOCATIONID . \" = \" . dbCompetitionLocations::DBNAME . \".\" . dbCompetitionLocations::ID;\n $sql .= \" INNER JOIN \" . dbCompetitionNames::DBNAME . \" ON \" . dbCompetition::DBNAME . \".\" . dbCompetition::NAMEID . \" = \" . dbCompetitionNames::DBNAME . \".\" . dbCompetitionNames::ID;\n return $sql;\n }", "public function fetchUnRegisteredAcademicProgress($lintidreg) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n\t // get the courses\r\n $sql = $db->select()\r\n ->from(array('a' => 'tbl_academicprogress_subjects'),array('a.*'))\r\n ->joinLeft(array('b' => 'tbl_definationms'),'a.IdCourseType =b.idDefinition',array('b.DefinitionDesc as SubjectType'))\r\n ->joinLeft(array('d'=>'tbl_subjectmaster'),'a.CourseID = d.IdSubject',array('d.SubjectName','d.SubCode'))\r\n ->where('a.IdStudent = ?',$lintidreg)\r\n ->where('a.IsRegistered = ?','0')\r\n ->order('a.Semester');\r\n $result = $db->fetchAll($sql);\r\n return $result;\r\n }", "function sqlStudentAll()\n\t{\n\t\t//echo '<hr>Nama class ini :' . __METHOD__ . '()<hr>';\n\t\t$sql = \"SELECT student_name,student_roll_number,student_dob,student_grade_id,student_id\"\n\t\t. \" FROM tbl_student INNER JOIN tbl_grade \"\n\t\t. \" ON tbl_grade.grade_id = tbl_student.student_grade_id \"\n\t\t. \"\";\n\n\t\treturn $sql;\n\t}", "function process_list_query1($query)\n {\n\tglobal $log;\n\t$log->debug(\"Entering process_list_query1(\".$query.\") method ...\");\n\n $result =& $this->db->query($query,true,\"Error retrieving $this->object_name list: \");\n $list = Array();\n $rows_found = $this->db->getRowCount($result);\n if($rows_found != 0)\n {\n\t\t $contact = Array();\n for($index = 0 , $row = $this->db->fetchByAssoc($result, $index); $row && $index <$rows_found;$index++, $row = $this->db->fetchByAssoc($result, $index))\n\n {\n foreach($this->range_fields as $columnName)\n {\n if (isset($row[$columnName])) {\n\n $contact[$columnName] = $row[$columnName];\n }\n else\n {\n $contact[$columnName] = \"\";\n }\n\t }\n// TODO OPTIMIZE THE QUERY ACCOUNT NAME AND ID are set separetly for every vtiger_contactdetails and hence\n// vtiger_account query goes for ecery single vtiger_account row\n\n $list[] = $contact;\n }\n }\n\n $response = Array();\n $response['list'] = $list;\n $response['row_count'] = $rows_found;\n $response['next_offset'] = $next_offset;\n $response['previous_offset'] = $previous_offset;\n\n\n\t$log->debug(\"Exiting process_list_query1 method ...\");\n return $response;\n }", "public function get_additional_joins()\n {\n return 'LEFT JOIN isys_catg_its_type_list AS cat_rel\n\t\t\tON cat_rel.isys_catg_its_type_list__isys_obj__id = obj_main.isys_obj__id';\n }", "function ml_compute_ranking($r_id){\n\tglobal $dbh1, $dbh2; // Global variables for database connections\n\t$sql = 'SELECT student_id FROM student_recruiter WHERE recruiter_id='.$r_id;\n\t$result = mysql_query($sql, $dbh1);\n\t$rank_dist = [];\n\t\n\twhile ($data = mysql_fetch_array($result)){\n\t\t$s_id = $data['student_id'];\n\t\t// Extract feature vector from s_id\n\t\t$sql1 = 'SELECT feature FROM ml_feature_vectors WHERE recruiter_id='.$r_id.' AND student_id='.$s_id;\n\t\t$result1 = mysql_query($sql1, $dbh2);\n\t\t$data1 = mysql_fetch_array($result1);\n\t\t$feature = $data1['feature'];\n\t\t\n\t\t// Convert feature vector string to array of integers\n\t\t$feature_array = array();\n\t\tfor($i=0;$i<strlen($feature);$i++){\n\t\t\t$feature_array[$i] = (int)$feature[$i];\n\t\t}\n\t\t\n\t\t// Create best array --> For Comparison\n\t\t$best_array = array();\n\t\tfor($i=0;$i<strlen($feature);$i++){\n\t\t\t$best_array[$i] = 5;\n\t\t}\n\t\t// Calculate distance between feature vector and best vector based on Cosine similarity distance\n\t\t$cdist = cosinus($feature_array, $best_array);\n\t\t$rank_dist[$s_id] = $cdist;\n\t\t\t\n\t} //while (student)\n\t\n\t// Sort $rank_dist array\n\tarsort($rank_dist);\n\t$rank_dist_keys = array_keys($rank_dist);\n\t\n\t$rank_id = '';\n\tfor($i=0; $i<count($rank_dist_keys); $i++){\n\t\tif($i==(count($rank_dist_keys)-1) )\n\t\t\t$rank_id = $rank_id.$rank_dist_keys[$i];\n\t\telse $rank_id = $rank_id.$rank_dist_keys[$i].',';\n\t}\n\t\n\t$sql2 = 'SELECT * FROM ml_rank WHERE recruiter_id='.$r_id; \n\t$result2 = mysql_query($sql2, $dbh2);\n\t$count2 = mysql_num_rows($result2);\n\t\n\tif ($count2==0)\n\t\t$sql3 = 'INSERT INTO ml_rank VALUES('.$r_id.',\"'.$rank_id.'\")';\n\telse\n\t\t$sql3 = 'UPDATE ml_rank SET rank_id=\"'.$rank_id.'\" WHERE recruiter_id='.$r_id;\n\tmysql_query($sql3, $dbh2);\n\t\t\n\n}", "function listerPlanningProf(){\n\t$query='select * from professeur, planning, utilisateur where professeur.idProfesseur=planning.idProfesseur and professeur.idProfesseur=utilisateur.id_user order by professeur.idProfesseur';\n\t$result=mysql_query($query);\n\treturn $result;\t\n}", "function budgetsys_line_load_all_lids() {\n \n $query = db_select('budgetsys_line', 'bl'); // Select FROM budget_sys\n $query->fields('bl',array('lid')); // oid, o.title\n\n $result = $query->execute()->fetchCol(); // Execute and place in an array keyed by the oid\n return $result;\n}", "public function joinProduct($classId);", "function particularnativitylist($id)\n\t{\n\t\t$getparnativity=\"SELECT * from nativity where id = $id\";\n\t\t$nativity_data=$this->get_results( $getparnativity );\n\t\treturn $nativity_data;\n\t}", "function student_print($master_id){\r\n\t\t\t//full query\r\n\t\t\t$query=\"SELECT * FROM class_students\r\n\t\t\t\t\tLEFT JOIN class ON class.class_id = class_students.dclass_master\r\n\t\t\t\t\tLEFT JOIN customer ON customer.cust_id = class_students.dclass_student\r\n\t\t\t\t\tWHERE class.class_id = '\".$master_id.\"'\";\r\n\t\t\t$result = $this->db->query($query); \r\n\t\t\treturn $result;\r\n\t\t}", "private function _get_sql1() {\n\t\tglobal $wpdb;\n\n\t\t$this->SQL1 =\n\t\t\t\"SELECT\n\t\t\t[+count_found_rows+]\n\t\t\t{$wpdb->posts}.ID\n\t\t\t\n\t\t\tFROM {$wpdb->posts}\n\t\t\t[+author_join+]\n\t\t\t[+taxonomy_join+]\n\t\t\tLEFT JOIN {$wpdb->postmeta} ON {$wpdb->posts}.ID={$wpdb->postmeta}.post_id\n\n\t\t\t[+join_for_metasortcolumn+]\n\n\t\t\tWHERE\n\t\t\t(\n\t\t\t1\n\t\t\t[+direct_filter+]\n\t\t\t[+include+]\n\t\t\t[+exclude+]\n\t\t\t[+omit_post_type+]\n\t\t\t[+post_type+]\n\t\t\t[+post_mime_type+]\n\t\t\t[+post_parent+]\n\t\t\t[+post_status+]\n\t\t\t[+yearmonth+]\n\t\t\t[+meta+]\n\t\t\t[+author+]\n\n\n\t\t\t[+taxonomy+]\n\t\t\t[+taxonomy_term+]\n\t\t\t[+taxonomy_slug+]\n\n\t\t\t[+search+]\n\t\t\t[+exact_date+]\n\t\t\t[+date_min+]\n\t\t\t[+date_max+]\n\t\t\t)\n\t\t\t[+append+]\n\n\t\t\tGROUP BY {$wpdb->posts}.ID\n\t\t\tORDER BY [+orderby+] [+order+]\n\t\t\t[+limit+]\n\t\t\t[+offset+]\";\n\n\t\t// Substitute into the query.\n\t\t$hash = array();\n\t\t$hash['count_found_rows'] = ($this->paginate)? 'SQL_CALC_FOUND_ROWS' : '';\n\n\t\t$hash['include'] = $this->_sql_filter($wpdb->posts, 'ID', 'IN', $this->include);\n\t\t$hash['exclude'] = $this->_sql_filter($wpdb->posts, 'ID', 'NOT IN', $this->exclude);\n\t\t$hash['append'] = $this->_sql_append($wpdb->posts);\n\n\t\t$hash['omit_post_type'] = $this->_sql_filter($wpdb->posts, 'post_type', 'NOT IN', $this->omit_post_type);\n\t\t$hash['post_type'] = $this->_sql_filter($wpdb->posts, 'post_type', 'IN', $this->post_type);\n\t\t$hash['post_mime_type'] = $this->_sql_filter_post_mime_type();\n\t\t$hash['post_parent'] = $this->_sql_filter($wpdb->posts, 'post_parent', 'IN', $this->post_parent);\n\t\t$hash['post_status'] = $this->_sql_filter($wpdb->posts, 'post_status', 'IN', $this->post_status);\n\t\t$hash['yearmonth'] = $this->_sql_yearmonth();\n\t\t$hash['meta'] = $this->_sql_meta();\n\t\t\n\t\t// Only add this join if the user has searched on this criteria\n\t\tif (isset($this->author) && !empty($this->author)) {\n\t\t\t$hash['author'] = $this->_sql_filter('author', 'display_name', '=', $this->author);\n\t\t\t$hash['author_join'] = \"LEFT JOIN {$wpdb->users} author ON {$wpdb->posts}.post_author=author.ID\";\n\t\t}\n\t\t\n\t\t// Only add these if a user has searched on taxonomy criteria\n\t\tif (isset($this->taxonomy) && !empty($this->taxonomy)\n\t\t\t&& (isset($this->taxonomy_term) || isset($this->taxonomy_slug)) ) {\n\t\t\t$hash['taxonomy'] = $this->_sql_filter($wpdb->term_taxonomy, 'taxonomy', '=', $this->taxonomy);\n\t\t\t$hash['taxonomy_term'] = $this->_sql_filter($wpdb->terms, 'name', 'IN', $this->taxonomy_term);\n\t\t\t$hash['taxonomy_slug'] = $this->_sql_filter($wpdb->terms, 'slug', 'IN', $this->taxonomy_slug);\n\t\t\t$hash['taxonomy_join'] = \"\n\t\t\t\tLEFT JOIN {$wpdb->term_relationships} ON {$wpdb->posts}.ID={$wpdb->term_relationships}.object_id\n\t\t\t\tLEFT JOIN {$wpdb->term_taxonomy} ON {$wpdb->term_taxonomy}.term_taxonomy_id={$wpdb->term_relationships}.term_taxonomy_id\n\t\t\t\tLEFT JOIN {$wpdb->terms} ON {$wpdb->terms}.term_id={$wpdb->term_taxonomy}.term_id\";\n\t\t}\n\n\t\tif ($this->custom_field_date_flag) {\n\t\t\t$hash['exact_date'] = $this->_sql_custom_date_filter($this->post_date);\n\t\t\t$hash['date_min'] = $this->_sql_custom_date_filter($this->date_min, '>=');\n\t\t\t$hash['date_max'] = $this->_sql_custom_date_filter($this->date_max, '<=');\n\t\t}\n\t\telse {\n\t\t\t$hash['exact_date'] = $this->_sql_filter($wpdb->posts, $this->date_column, '=', $this->post_date);\n\t\t\t$hash['date_min'] = $this->_sql_filter($wpdb->posts, $this->date_column, '>=', $this->date_min);\n\t\t\t$hash['date_max'] = $this->_sql_filter($wpdb->posts, $this->date_column, '<=', $this->date_max);\n\t\t\t// die($hash['date_min']);\n\t\t}\n\n\t\t$hash['search'] = $this->_sql_search();\n\n\t\t$hash['order'] = $this->order;\n\t\t\n\t\t// Custom handling for sorting on custom fields\n\t\t// http://code.google.com/p/wordpress-summarize-posts/issues/detail?id=12\n\t\tif ($this->sort_by_random) {\n\t\t\t$hash['orderby'] = 'RAND()';\n\t\t\t$hash['order'] = ''; // <-- blanks this out!\n\t\t\t$hash['join_for_metasortcolumn'] = '';\n\t\t}\n\t\t// See http://code.google.com/p/wordpress-summarize-posts/issues/detail?id=20\n\t\telseif ($this->sort_by_meta_flag) {\n\t\t\t$hash['orderby'] = 'orderbymeta.meta_value';\n\t\t\t$hash['join_for_metasortcolumn'] = sprintf(\"LEFT JOIN {$wpdb->postmeta} orderbymeta ON %s.ID=orderbymeta.post_id AND orderbymeta.meta_key = %s\"\n\t\t\t\t, $wpdb->posts\n\t\t\t\t, $wpdb->prepare('%s', $this->orderby)\n\t\t\t);\n\t\t}\n\t\t// Standard: sort by a column in wp_posts\n\t\telse {\n\t\t\t$hash['orderby'] = $wpdb->posts.'.'.$this->orderby;\n\t\t\t$hash['join_for_metasortcolumn'] = '';\n\t\t}\n\t\t// This is when the user supplies their own ORDER BY parameters for complex sorting.\n\t\t// Note: right now, I can only think of doing complex sorting on the primary columns from wp_posts \n\t\t// and NOT using custom columns from wp_postmeta.\n\t\tif ($this->orderby_custom_flag) {\n\t\t\t$hash['orderby'] = $this->orderby_custom;\n\t\t\t$hash['order'] = ''; // <-- blanks this out!\t\t\t\n\t\t}\n\n\t\t$hash['limit'] = $this->_sql_limit();\n\t\t$hash['offset'] = $this->_sql_offset();\n\n\t\t// Direct filters (if any), e.g. post_author = 123 or custom_field LIKE '%horse%'\n\t\t$hash['direct_filter'] = '';\n\t\tif ($this->direct_filter_flag) {\n\t\t\tforeach($this->direct_filter_columns as $c) {\n\t\t\t\tif (in_array($c, self::$wp_posts_columns)) {\n\t\t\t\t\t$hash['direct_filter'] .= $this->_sql_filter_posts($c, $this->_get_operator($c), $this->$c);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$hash['direct_filter'] .= $this->_sql_filter_postmeta($c,$this->_get_operator($c), $this->$c);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!$this->include_hidden_fields) {\n\t\t\t$hash['hidden_fields'] = \"WHERE {$wpdb->postmeta}.meta_key NOT LIKE '\\_%'\";\n\t\t}\n\t\t\n\t\t$this->SQL1 = CCTM::parse($this->SQL1, $hash);\n\n\t\t// Strip whitespace\n\t\t$this->SQL1 = preg_replace('/\\s\\s+/', ' ', $this->SQL1 );\n\n\t\treturn $this->SQL1;\n\n\t}", "public function scopeJoinKategori1($query)\n\t{\n\t\treturn $query->join('kategori1', 'kategori1.id' , '=', 'kategori2.id_kategori1');\n\t}", "public function testLeftJoinStmt()\n {\n $leftJoin = $this->joinTemplate()('LEFT');\n return $this->assertEquals($leftJoin, \"SELECT blog.blog_text, blog.token_id, tokens.token_id, tokens.token_string FROM blog LEFT JOIN tokens ON blog.token_id = tokens.token_id\");\n }", "public function leftJoin($table, $conditions = []);", "public function testNoSpecificColumnNamesSubclassDataObjectQuery() {\n\t\t$playerList = new DataList('DataObjectTest_SubTeam');\n\t\t// Should be a left join.\n\t\t$this->assertEquals(1, preg_match(\n\t\t\t$this->normaliseSQL('/SELECT DISTINCT .* LEFT JOIN .* /'),\n\t\t\t$this->normaliseSQL($playerList->sql($parameters))\n\t\t));\n\t}", "public function getAllDetailsStudentList($conditions='', $order=' rollNo', $limit='') {\n global $sessionHandler;\n $query = \"SELECT\n DISTINCT CONCAT(IFNULL(a.firstName,''),' ',IFNULL(a.lastName,'')) as studentName,\n IF(a.rollNo='','\".NOT_APPLICABLE_STRING.\"',a.rollNo) AS rollNo,\n CONCAT(c.universityCode,'-',d.degreeCode,'-',e.branchCode) as programme,\n f.periodName,\n a.classId as class_id,\n a.studentId,\n IF(a.studentEmail='','\".NOT_APPLICABLE_STRING.\"',a.studentEmail) AS studentEmail,\n universityRollNo,\n IF(a.corrCityId Is NULL,'\".NOT_APPLICABLE_STRING.\"',(SELECT cityName FROM city WHERE cityId = a.corrCityId)) AS corrCityId,\n IF(a.classId Is NULL,'\".NOT_APPLICABLE_STRING.\"',(SELECT periodName FROM study_period sp, class cls WHERE sp.studyPeriodId = cls.studyPeriodId and cls.classId = a.classId)) AS studyPeriod,\n IF(a.studentMobileNo='','\".NOT_APPLICABLE_STRING.\"',a.studentMobileNo) AS studentMobileNo ,\n IF(IFNULL(corrAddress1,'')='','', CONCAT(corrAddress1,' ',(SELECT cityName from city where city.cityId=a.corrCityId),' ',(SELECT stateName from states where states.stateId=a.corrStateId),' ',(SELECT countryName from countries where countries.countryId=a.corrCountryId),IF(IFNULL(a.corrPinCode,'')='','',CONCAT('-',a.corrPinCode)))) AS corrAddress,\n IF(IFNULL(permAddress1,'')='','', CONCAT(permAddress1,' ',IFNULL(permAddress2,''),' ',(SELECT cityName from city where city.cityId=a.permCityId),' ',(SELECT stateName from states where states.stateId=a.permStateId),' ',(SELECT countryName from countries where countries.countryId=a.permCountryId),IF(IFNULL(a.permPinCode,'')='','',CONCAT('-',a.permPinCode)))) AS permAddress,\n fatherName AS fatherName, dateOfBirth AS DOB, studentPhoto AS Photo,\n SUBSTRING_INDEX(b.classname,'\".CLASS_SEPRATOR.\"',-4) AS className, bch.endDate\n FROM\n student_groups ss, student a, class b,\n university c, degree d, branch e, study_period f, batch bch\n WHERE\n ss.studentId = a.studentId\n AND ss.classId = b.classId\n AND bch.batchId = b.batchId\n AND bch.instituteId='\".$sessionHandler->getSessionVariable('InstituteId').\"'\n AND b.universityId = c.universityId\n AND b.degreeId = d.degreeId\n AND b.branchId = e.branchId\n AND b.studyPeriodId = f.studyPeriodId\n AND b.instituteId='\".$sessionHandler->getSessionVariable('InstituteId').\"'\n $conditions\n ORDER BY $order $limit\";\n\n // AND b.sessionId= '\".$sessionHandler->getSessionVariable('SessionId').\"'\n\n return SystemDatabaseManager::getInstance()->executeQuery($query,\"Query: $query\");\n }", "public function joinClassByStudent_post()\n {\n /* code goes here */\n }", "protected function get_join_sql(array $filters=array()) {\n $joinsql = parent::get_join_sql($filters);\n $joinsql[] = 'LEFT JOIN {'.clusterassignment::TABLE.'} clstass\n ON clstass.clusterid='.$this->usersetid.'\n AND clstass.userid = element.id';\n return $joinsql;\n }", "function get_rev_lhp($id_p2hp) {\n return $this->db->select('*')\n ->from('rev_lhp')\n ->where('rev_fk_p2hp', $id_p2hp)\n ->order_by('rev_ke', 'asc')\n ->get()->result();\n }", "function yy_r69(){ $this->_retvalue = new Stmt\\Join('LEFT', $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + 0]->minor); }", "function lca($node1, $node2) {\n // traverse each node all the way up, until root node\n // root has no parent\n // memoryaddress of parent => child node\n // spl_object_hash(node) = id \n // id => parent\n // http://php.net/manual/en/function.spl-object-hash.php\n if (empty($node1) || empty($node2)) {\n return NULL;\n }\n $table = [];\n $trav1 = $node1;\n // construct hash table from 1st node\n while (!empty($trav1)) {\n $id = spl_object_hash($trav1);\n $table[$id] = 1; // id of A => NULL\n $trav1 = $trav1->parent;\n }\n // id A => null\n \n // $table = [hash(a) -> null]\n \n // lookup node2's parent in hash table\n $trav2 = $node2;\n while (!empty($trav2)) {\n $id = spl_object_hash($trav2); \n if (isset($table[$id])) { // will not run for B\n return $trav2;\n }\n $trav2 = $trav2->parent;\n }\n \n return NULL;\n}", "function ros_get_users_of_one_instance($roshineid)\n{\n global $DB, $CFG;\n $params = array();\n $toreturn = array();\n $gradestblname = $CFG->prefix.\"roshine_grades\";\n $userstblname = $CFG->prefix.\"user\";\n $sql = \"SELECT DISTINCT \".$userstblname.\".firstname, \".$userstblname.\".lastname, \".$userstblname.\".id\".\n \" FROM \".$gradestblname.\n \" LEFT JOIN \".$userstblname.\" ON \".$gradestblname.\".userid = \".$userstblname.\".id\".\n \" WHERE (roshine=\".$roshineid.\")\";\n if ($grades = $DB->get_records_sql($sql, $params)) {\n return $grades;\n }\n return false;\n}", "function get_table_join($select_data, $table, $join_table, $join_data, $join_type, $where_data){\n\t\n\t$this->db->select($select_data);\n\t$this->db->from($table);\n\t$this->db->join($join_table, $join_data, $join_type);\n\t$this->db->where($where_data);\n\t$this->db->order_by(\"sub1_id\",\"asc\");\n\t\n\t$query = $this->db->get();\n\t$result = $query->result_array(); \n\treturn $result;\t\n}", "function loadLedger($year,$id){\r\n$sql = \"SELECT payroll.*, employee.employeeName FROM payroll, employee WHERE payroll.employeeId='$id' AND employee.employeeId='$id' AND payroll.year= '$year' ORDER BY sn DESC\";\r\nreturn $this->query($sql);\r\n}", "public function show_list($p_obj_id)\n {\n $l_sql = 'SELECT isys_catg_relation_list__isys_obj__id__master, isys_catg_relation_list__isys_obj__id__slave, obj.isys_obj__isys_obj_type__id, obj.isys_obj__title AS title\n FROM isys_catg_relation_list\n INNER JOIN isys_obj AS obj ON isys_catg_relation_list__isys_obj__id__slave = obj.isys_obj__id\n INNER JOIN isys_obj AS relObj ON isys_catg_relation_list__isys_obj__id = relObj.isys_obj__id\n WHERE isys_catg_relation_list__isys_obj__id__master = ' . $this->m_dao_rel->convert_sql_id($p_obj_id) . '\n AND obj.isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND isys_catg_relation_list__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND relObj.isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n GROUP BY isys_catg_relation_list__isys_obj__id__slave ';\n\n $l_res = $this->m_dao_rel->retrieve($l_sql);\n\n while ($l_row = $l_res->get_row()) {\n if ($l_row[\"isys_catg_relation_list__isys_obj__id__master\"] == $p_obj_id &&\n (is_null($this->m_obj_arr) || !in_array($l_row[\"isys_catg_relation_list__isys_obj__id__slave\"], $this->m_obj_arr))) {\n if ($l_row[\"isys_obj__isys_obj_type__id\"] == defined_or_default('C__OBJTYPE__IT_SERVICE')) {\n $this->m_its_arr[$l_row[\"isys_catg_relation_list__isys_obj__id__slave\"]] = $l_row[\"title\"];\n }\n\n if (in_array($this->m_dao_rel->get_objTypeID($l_row['isys_catg_relation_list__isys_obj__id__slave']), $this->m_software_obj_types)) {\n $l_sql = 'SELECT isys_catg_relation_list__isys_obj__id\n FROM isys_catg_relation_list\n INNER JOIN isys_obj ON isys_obj__id = isys_catg_relation_list__isys_obj__id\n WHERE isys_catg_relation_list__isys_obj__id__master = ' . $this->m_dao_rel->convert_sql_id($p_obj_id) . '\n AND isys_catg_relation_list__isys_obj__id__slave = ' . $this->m_dao_rel->convert_sql_id($l_row['isys_catg_relation_list__isys_obj__id__slave']) . '\n AND isys_obj__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n AND isys_catg_relation_list__status = ' . $this->m_dao_rel->convert_sql_int(C__RECORD_STATUS__NORMAL) . '\n GROUP BY isys_catg_relation_list__isys_obj__id';\n\n $l_res_app = $this->m_dao_rel->retrieve($l_sql);\n\n while ($l_row_app = $l_res_app->get_row()) {\n $l_its_data = $this->m_dao_its_comp\n ->get_data(null, null, \"AND isys_connection__isys_obj__id = \" . $this->m_dao_rel->convert_sql_id($l_row_app[\"isys_catg_relation_list__isys_obj__id\"]), null, C__RECORD_STATUS__NORMAL)\n ->get_row();\n\n // Check in it service components\n if (isset($l_its_data['isys_obj__id']) &&\n $this->m_dao_rel->get_objTypeID($l_its_data['isys_obj__id']) == defined_or_default('C__OBJTYPE__IT_SERVICE')) {\n if (!array_key_exists($l_its_data['isys_obj__id'], $this->m_its_arr)) {\n $this->m_its_arr[$l_its_data['isys_obj__id']] = $l_its_data['isys_obj__title'];\n }\n }\n }\n }\n\n $this->m_obj_arr[] = $l_row[\"isys_catg_relation_list__isys_obj__id__slave\"];\n $this->new_recurse_relation($l_row[\"isys_catg_relation_list__isys_obj__id__slave\"], $p_obj_id);\n unset($this->m_obj_arr);\n }\n }\n\n return $this;\n }", "function get_gmlas_to_gml_regel_for_class_in_bereich_with_geom($gmlas_class, $bereich_id, $geom_type) {\n\t\t$gml_class = $gmlas_class; # Is this always the case?\n\t\t$gmlas_attributes = $this->get_attributes_with_values_for_class_in_schema($gmlas_class, $this->gmlas_schema);\n\t\t# echo '<pre>'; print_r($gmlas_attributes); echo '</pre>';\n\t\t$mapping_table = $this->get_gmlas_to_gml_mapping_table($gmlas_class);\n\n\t\t$select_sql = '';\n\t\t$gml_attributes = [];\n\n\t\t# Loops through all attributes, comparing them with the mapping table original column (and table)\n\t\t# If matches are found, the target attributes are taken and the associated regel is added to the SQL\n\t\tforeach($gmlas_attributes AS $a) {\n\t\t\tif(!in_array($a, array_column($mapping_table, 'o_column'))) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach($mapping_table as $mapping) {\n\t\t\t\tif(($mapping['o_column'] == $a) and ($mapping['o_table'] == $gml_class)) {\n\t\t\t\t\t# gehoertzubereich wird automatisiert bei der Konvertierung in die Regel eingearbeitet \n\t\t\t\t\t# muss deswegen für Attribute nicht verwendet werden, ggf aber für WHERE filter\n\t\t\t\t\tif($mapping['t_column'] == 'gehoertzubereich') {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t# fix for varying encountered gml-geometry types that are valid for xplanung (according to konformitaetsbedingungen-document) but can cause problems\n\t\t\t\t\t# e.g. in display, in export, for wms/wfs services or are not supported by the konverter\n\t\t\t\t\tif($mapping['t_column'] == 'position') {\n\t\t\t\t\t\tif(($geom_type == 'ST_CurvePolygon') or\n\t\t\t\t\t\t\t($geom_type == 'ST_MultiSurface') or\n\t\t\t\t\t\t\t($geom_type == 'ST_CompoundCurve') or\n\t\t\t\t\t\t\t($geom_type == 'ST_MultiCurve'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$mapping['regel'] = 'ST_CurveToLine(gmlas.position) AS position';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Cast to multi-geometries (konverter-convention)\n\t\t\t\t\t\telse if(($geom_type == 'ST_Point') or\n\t\t\t\t\t\t\t($geom_type == 'ST_LineString') or\n\t\t\t\t\t\t\t($geom_type == 'ST_Polygon'))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$mapping['regel'] = 'ST_Multi(gmlas.position) AS position';\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$mapping['regel'] = 'gmlas.position AS position';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$gml_attributes[] = $mapping['t_column'];\n\t\t\t\t\t$select_sql .= $mapping['regel'];\n\t\t\t\t\t$select_sql .= \",\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t# attributes of normalized gmlas tables, e.g. praesentationsobjekte '_dientzurdarstellungvon', '_wirddargestelltdurch'\n\t\t# TODO generically read all normalized tables\n\t\t# zweckbestimmung e.g. for fp_generischesobjekt_zweckbestimmung\n\t\t$norm_attributes = array(\"wirddargestelltdurch\",\"dientzurdarstellungvon\",\"reftextinhalt\",\"detailliertezweckbestimmung\",\"zweckbestimmung\");\n\t\t$i = 0;\n\t\tforeach($norm_attributes AS $n_a) {\n\t\t\t$i++;\n\t\t\t# check if table exists\n\t\t\t\t$sql_checkexists_norm_table = \"\n\t\t\t\t\tSELECT \n\t\t\t\t\t\tEXISTS (\n\t\t\t\t\t\t SELECT FROM information_schema.tables \n\t\t\t\t\t\t WHERE table_schema = '\" . $this->gmlas_schema . \"'\n\t\t\t\t\t\t AND table_name = '\" . $gml_class . '_' . $n_a . \"'\n\t\t\t\t\t\t);\";\n\t\t\t$ret = $this->pgdatabase->execSQL($sql_checkexists_norm_table, 4, 0);\n\t\t\t$result = pg_fetch_row($ret[1]);\n\t\t\tif($result[0] === 't') {\n\t\t\t\t# single ' escaped later\n\t\t\t\t$norm_1 = \"norm_table_\" . $i;\n\t\t\t\tif($n_a == \"wirddargestelltdurch\" or $n_a == \"dientzurdarstellungvon\" or $n_a == \"reftextinhalt\") {\n\t\t\t\t\t\t$select_sql .= \"(SELECT string_agg(href,',') FROM \" . $this->gmlas_schema . \".\" . $gml_class . \"_\" . $n_a . \" \". $norm_1 . \" WHERE gmlas.id = \" .$norm_1 . \".parent_id) AS \" . $n_a . \",\";\n\t\t\t\t\t$gml_attributes[] = $n_a;\n\t\t\t\t}\n\t\t\t\tif($n_a == \"detailliertezweckbestimmung\" or $n_a == \"zweckbestimmung\") {\n\t\t\t\t\t$special_datatype = \"\";\n\n\t\t\t\t\t$sql = \"\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tudt_name\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\tinformation_schema.columns\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\ttable_schema = 'xplan_gml'\n\t\t\t\t\t\tAND\n\t\t\t\t\t\t\ttable_name = '\" . $gml_class . \"'\n\t\t\t\t\t\tAND\n\t\t\t\t\t\t\tcolumn_name = '\" . $n_a . \"'\n\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\";\n\t\t\t\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t\t\t\t$result = pg_fetch_row($ret[1]);\n\t\t\t\t\t$special_datatype = $result[0];\n\t\t\t\t\tif(substr($special_datatype,0,1) == \"_\") {\n\t\t\t\t\t\t// remove leading underscore (for arrays) and add [] brackets at the end\n\t\t\t\t\t\t$special_datatype = ltrim($special_datatype, \"_\") . \"[]\";\n\t\t\t\t\t}\n\t\t\t\t\tif($special_datatype != \"\") {\n\t\t\t\t\t\t$norm_2 = \"norm_table_\" . $i . \"_\" . $i;\n\t\t\t\t\t\t$norm_3 = \"norm_table_\" . $i . \"_\" . $i . \"_\" . $i;\n\t\t\t\t\t\t$norm_4 = \"norm_table_\" . $i . \"_\" . $i . \"_\" . $i . \"_\" . $i;\n\t\t\t\t\t\t$select_sql .= \"CASE WHEN (SELECT TRUE FROM \" . $this->gmlas_schema . \".\" . $gml_class . \"_\" . $n_a . \" \" . $norm_2 . \" WHERE \" . $norm_2 . \".parent_id = gmlas.id LIMIT 1) THEN ARRAY[((SELECT DISTINCT codespace FROM \" . $this->gmlas_schema . \".\" . $gml_class . \"_\" . $n_a . \" \" . $norm_3 . \" WHERE gmlas.id = \" . $norm_3 . \".parent_id LIMIT 1),\";\n\t\t\t\t\t\t$select_sql .= \"(SELECT string_agg(value,',') FROM \" . $this->gmlas_schema . \".\" . $gml_class . \"_\" . $n_a . \" \" . $norm_4 . \" WHERE gmlas.id = \" . $norm_4 . \".parent_id),NULL)]::xplan_gml.\" . $special_datatype . \" ELSE NULL END AS \" . $n_a . \",\";\n\t\t\t\t\t\t$gml_attributes[] = $n_a;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// Add INSERT INTO and FROM\n\t\t$sql = 'INSERT INTO ' . XPLANKONVERTER_CONTENT_SCHEMA . '.' . $gml_class . '(';\n\t\t$sql .= implode(\",\", $gml_attributes);\n\t\t$sql .= ')';\n\t\t$sql .= ' SELECT ';\n\t\t$sql .= $select_sql;\n\n\t\t# Remove last comma\n\t\tif(substr($sql, -1, 1) == \",\") {\n\t\t\t$sql = substr($sql, 0, -1);\n\t\t}\n\t\t$sql .= ' FROM ' . $this->gmlas_schema . '.' . $gmlas_class . ' gmlas';\n\t\t#Filters only by relevant bereich (in case 2 rules target the same class with different bereich)\n\t\t$sql .= \" WHERE gmlas.gehoertzubereich_href ILIKE '%\" . $bereich_id . \"'\";\n\t\t$sql .= \" AND ST_GeometryType(position) = '\" . $geom_type . \"'\";\n\t\treturn $sql;\n\t}", "public function merge( $id1, $id2 )\n\t{\n\t\t/* We need to tell the driver not to escape our md5 compilation statements */\n\t\t$_fieldEncapsulate = $this->DB->fieldEncapsulate;\n\t\t$this->DB->fieldEncapsulate = '';\n\t\t$this->DB->manual_addslashes = TRUE;\n\t\t\n\t\t/* Run the query - this looks a bit nuts, but basically we're setting any records for\n\t\tlikes on the old item to now be likes on the new, unelss the user has already liked\n\t\tthe new, in which case do nothing and we'll delete the left-overs in a minute */\n\t\t$this->DB->update(\n\t\t\tarray( 'core_like' => 'a' ),\n\t\t\t$this->DB->compileUpdateString( array(\n\t\t\t\t'a.like_id'\t\t\t=> classes_like_registry::getKeyForSql( $id2, 'a.like_member_id' ),\n\t\t\t\t'a.like_lookup_id'\t=> classes_like_registry::getKeyForSql( $id2 ),\n\t\t\t\t'a.like_lookup_area'=> classes_like_registry::getKeyForSql( null, 'a.like_member_id' ),\n\t\t\t\t'a.like_rel_id'\t\t=> intval( $id2 ),\n\t\t\t) ),\n\t\t\t\"a.like_app='{$this->_app}' AND a.like_area='{$this->_area}' AND a.like_rel_id={$id1} AND b.like_id \" . $this->DB->buildIsNull(),\n\t\t\tfalse,\n\t\t\ttrue,\n\t\t\tarray( array(\n\t\t\t\t'from'\t=> array( 'core_like' => 'b' ),\n\t\t\t\t'where'\t=> \"b.like_app='{$this->_app}' AND b.like_area='{$this->_area}' AND b.like_rel_id={$id2}\",\n\t\t\t\t) )\n\t\t\t);\n\t\t\t\n\t\t/* Reset the DB driver */\n\t\t$this->DB->manual_addslashes = FALSE;\n\t\t$this->DB->fieldEncapsulate = $_fieldEncapsulate;\n\t\t\n\t\t/* Remove any stragglers (would happen if user was subscribed to both topics */\n\t\t$this->remove( $id1 );\n\t\t\n\t\t/* Reset the cache */\n\t\tclasses_like_cache::getInstance()->isNowStale( $id1 );\n\t\tclasses_like_cache::getInstance()->isNowStale( $id2 );\n\t}", "function getPropertiesList1($id,$id1){\r\n $q = \"select * from projects where Ptype = '$id' and ProjectType = '$id1'\";\r\n //$result = mysql_query($q);\r\n return $q;\r\n }", "private function sql_join($filter, $structure) {\n\t\t$sql = \"\";\n\t\t$table = $structure['table'];\n\t\t$class = $structure['class'];\n\t\t$pool_class = $class . 'Pool_Model';\n\t\t$full_structure = $pool_class::get_full_structure();\n\t\tforeach ($structure['relations'] as $relation) {\n\t\t\tlist($foreign_key, $foreign_table, $key) = $relation;\n\t\t\t$foreign_structure = $full_structure[$foreign_table];\n\t\t\t$ftable = $foreign_structure['table'];\n\t\t\t$join_expr = ' LEFT JOIN '.$ftable.' AS '.$key;\n\t\t\t$join_expr .= ' ON '.implode(' AND ',array_map(function($fk,$lk) use($key,$table) {\n\t\t\t\treturn \"$key.$fk = $table.$lk\";\n\t\t\t}, $foreign_structure['key'], $foreign_key));\n\t\t\t$sql .= $join_expr;\n\t\t}\n\t\treturn $sql;\n\t}", "public function get_list()\n {\n \n $this->db->select('l.id,l.name');\n $this->db->from('libraries l');\n $this->db->where('l.active',1);\n $this->db->order_by('l.name','ASC');\n \n return $this->db->get()->result();\n }", "public function fetchStudentDetails($lintidreg) {\r\n\t \t$db = Zend_Db_Table::getDefaultAdapter();\r\n $sql = $db->select()\r\n ->from(array('a' => 'tbl_studentregistration'),array('a.FName','a.MName','a.LName','a.registrationId'))\r\n ->joinLeft(array('b'=>'tbl_branchofficevenue'),'a.IdBranch = b.IdBranch',array('b.BranchName'))\r\n ->joinLeft(array('c'=>'tbl_program'),'a.IdProgram = c.IdProgram',array('c.ProgramName','c.IdScheme'))\r\n ->joinLeft(array('d'=>'tbl_intake'),'a.IdIntake = d.IdIntake',array('d.IntakeId'))\r\n ->joinLeft(array('e'=>'tbl_scheme'),'e.IdScheme = c.IdScheme',array('e.EnglishDescription'))\r\n ->joinLeft(array('cm'=>'tbl_collegemaster'),'c.IdCollege = cm.IdCollege',array('cm.CollegeName'))\r\n ->joinLeft(array('deftn'=>'tbl_definationms'),'deftn.idDefinition=a.profileStatus',array('deftn.DefinitionCode'))\r\n ->where('a.IdStudentRegistration = ?',$lintidreg);\r\n $result = $db->fetchRow($sql);\r\n return $result;\r\n }", "public function businessBookingList($lid) {\n $this->db->select('*')->from('ReserveRestaurantTable')->where('ReserveRestaurantTable.lid',$lid);\n $this->db->join('RestaurantTables', 'RestaurantTables.rid = ReserveRestaurantTable.rid');\n $this->db->join('Tables', 'Tables.tid = RestaurantTables.table_type');\n $query = $this->db->get();\n return $query->result();\n }", "public function innerjoin($classname, $classnameon = \"\")\n {\n $this->join = strtolower(get_class($classname));\n\n if (!$classnameon)\n $classnameon = $this->objectName;\n\n $this->query .= \" inner join `\" . $this->join . \"` on \" . $this->join . \".id = \" . strtolower($classnameon) . \".\" . $this->join . \"_id\";\n// $this->query .= \" inner join `\" . $this->join . \"` \";\n\n return $this;\n }", "private static function crawl(SinglyList $lA, SinglyList $lB, $result) {\n\t\t$n = $lA->Count();\n\t\t$m = $lB->Count();\n\t\t\n\t\t// take the tails\n\t\t$crwA = $lA->Tail();\n\t\t$crwB = $lB->Tail();\n\t\t// for every element in list A\n\t\t// $n and $m is the same number\n\t\tfor ($i = 0; $i < $n; $i++) {\n\n\t\t\t$found = $lB->FindCol($crwA->Column());\n\n\t\t\tif ($found !== null)\n\t\t\t\t$result->Append($crwA->Value() + $found->Value(), $crwA->Column());\n\t\t\telse \n\t\t\t\t$result->Append($crwA->Value() + 0 , $crwA->Column());\n\n\t\t\t$crwA = $crwA->Next();\n\t\t}\n\n\t\t// after the firts interations \n\t\t// now try to find the missing elements in \n\t\t// the lists that don't have the column the same with\n\t\t// elements in the first matrix\n\t\tfor ($j = 0; $j < $m; $j++) {\n\t\t\t// try to find element with the column the same as in matrix a\n\t\t\t$fount = $lA->FindCol($crwB->Column());\n\t\t\t// we're interested in just the elements \n\t\t\t// that dosen't have the same column \n\t\t\tif ($found === null)\n\t\t\t\t$result->Append($crwB->Value() + 0, $crwB->Column());\n\n\t\t\t$crwB = $crwB->Next();\n\t\t}\n\t}", "public function multiLoad_1($where) {\n\t\treturn $this->clean($this->get(self::table, -1, '', $where, array(), array('column' => 'course', 'order' => 'ASC')));\n\t}", "public function rgraph_level_subclassof($selected_workspace, $selected_class_uri, $classes_filter_query){\n \n $store_Mysql = $this->connect_workspace($selected_workspace);\n \n $subClassOf_domain_right = 'SELECT DISTINCT ?class ?relation WHERE {\n ?class ?relation <'.$selected_class_uri.'> .\n FILTER ( ?relation = <http://www.w3.org/2000/01/rdf-schema#subClassOf> || ?relation = <http://www.w3.org/2002/07/owl#equivalentClass> ) .\n FILTER isIRI( ?class ) .\n '.$classes_filter_query.'\n }';\n\n $subClassOf_domain_relations_right = $store_Mysql->query($subClassOf_domain_right,'rows');\n for($i=0; $i<count($subClassOf_domain_relations_right); $i++){\n $subClassOf_domain_relations_right[$i]['direction'] = \"right\";\n }\n\n $subClassOf_domain_left = 'SELECT DISTINCT ?class ?relation WHERE {\n <'.$selected_class_uri.'> ?relation ?class .\n FILTER ( ?relation = <http://www.w3.org/2000/01/rdf-schema#subClassOf> || ?relation = <http://www.w3.org/2002/07/owl#equivalentClass> ) .\n FILTER isIRI( ?class ) .\n '.$classes_filter_query.'\n }';\n\n $subClassOf_domain_relations_left = $store_Mysql->query($subClassOf_domain_left,'rows');\n\n for($i=0; $i<count($subClassOf_domain_relations_left); $i++){\n $subClassOf_domain_relations_left[$i]['direction'] = \"left\";\n }\n\n return array_merge((array)$subClassOf_domain_relations_left,(array)$subClassOf_domain_relations_right);\n\n }", "function xiliml_adjacent_join_filter( $join, $in_same_cat, $excluded_categories ) {\n\t\tglobal $post, $wpdb;\n\t\t$curlang = xiliml_get_lang_object_of_post( $post->ID );\n\n\t\tif ( $curlang ) { // only when language is defined !\n\t\t\t$join .= \" LEFT JOIN $wpdb->term_relationships as xtr ON (p.ID = xtr.object_id) LEFT JOIN $wpdb->term_taxonomy as xtt ON (xtr.term_taxonomy_id = xtt.term_taxonomy_id) \";\n\t\t}\n\t\treturn $join;\n\t}", "public function updateClasses($id, $class1, $level1, $class2=14, $level2=0){\n\t\t\t$biclass = 0;\n\t\t\t//pg multiclasse\n\t\t\tif ($class2 != 14){\n\t\t\t\t$biclass = -1;\n\t\t\t}\n\n\t\t\t$query = new Query();\n\t\t\t$query->tables = array('pgdb');\n\t\t\t$query->fields = array('Classe1','Livello1','Classe2','Livello2','Biclasse');\n\t\t\t$query->values = array($class1, $level1, $class2, $level2, $biclass);\n\n\t\t\t$query->filters = \"Id=\".$id;\n\n\t\t\t$query->DoUpdate();\n\n\t\t}", "function get_gmlas_to_gml_mapping_table($class) {\n\t\t$sql = \"SELECT o_table, o_column, t_table, t_column, t_data_type, regel FROM xplankonverter.mappingtable_gmlas_to_gml WHERE t_table = '\" . $class . \"';\";\n\t\t$ret = $this->pgdatabase->execSQL($sql, 4, 0);\n\t\t$result = pg_fetch_all($ret[1]);\n\t\treturn $result;\n\t}", "public function basic_join_setup()\r\n {\r\n \r\n }", "public function query() {\n $query = parent::query();\n $query->join('book', 'b', 'n.nid = b.nid');\n $query->join('menu_links', 'ml', 'b.mlid = ml.mlid');\n $query->isNotNull('ml.mlid');\n return $query;\n }", "function getlist($classname='', $ascending=true, $orderby = 'id',\n\t\t\t\t $fields = array('id'), $limitstart='', $limit='',\n\t\t\t\t $wherea=array(), $boolop = 'AND') {\n\t\tglobal $mysql;\n\t\t$where = null;\n\t\tif (!empty($wherea) && is_array($wherea))\n\t\t\tforeach($wherea as $cond)\n\t\t\t\tif (isset($cond['key']) && isset($cond['value']))\n\t\t\t\t\t$where[] = \" {$cond['key']} = '{$cond['value']}' \";\n\t\tif(!empty($where))\n\t\t\t$where = \" WHERE \".implode($boolop, $where);\n\t\t\t\n\t\tif (empty($classname)) $classname = $this->class_name();\n\t\t$orderdir = \"ORDER BY \".$orderby.\" \";\n\t\t$fields = implode(',', $fields);\n\t\tif ($ascending) $orderdir .= \"ASC\";\n\t\telse $orderdir .= \"DESC\";\n\t\t$limits = '';\n\t\tif ($limitstart != '') {\n\t\t\t$limits = 'LIMIT '.$limitstart;\n\t\t\tif ($limit != '')\n\t\t\t\t$limits .= ', '.$limit;\n\t\t}\n\t\telse if ($limit != '')\n\t\t\t$limits = 'LIMIT '.$limit;\n\t\t$query = \"SELECT \".$fields.\" FROM \".$this->escape($classname).\" $where $orderdir $limits;\";\n\t\t$result = $mysql->select($query, true);\n\t\treturn $result;\n\t}", "public function getClassCheckInBasicInfoBySchoolId($school_id,$checkin_date){\n //$class_list = $query->select('id')->from('classes')->where(['school_id'=>$school_id])->all();\n\n// $sql = 'select class_id,checkin_count,checkout_count,member_count from checkin_class where class_id in (select id from classes where school_id=:school_id) and checkin_date=:checkin_date';\n// $connection = \\Yii::$app->db;\n// $class_checkin_list = $connection->createCommand($sql,[':school_id'=>$school_id,':checkin_date'=>$checkin_date])->queryAll();\n\n //有签到信息的班级\n $query = new Query();\n $class_checkin_list = $query->select('c.id as class_id,c.teacher_id as teacher_id,c.name as class_name,cc.checkin_count,cc.member_count,cc.checkout_count')->from('checkin_class as cc')\n ->innerJoin('classes as c','c.id = cc.class_id')\n ->where(['c.school_id'=>$school_id,'cc.checkin_date'=>$checkin_date])\n ->orderBy('cc.checkin_count desc')\n ->all();\n\n\n\n\n //这个算法是有问题的\n// $query = new Query();\n// $uncheckin_class = $query->select('c.id,c.name,c.teacher_id')->from('classes as c')\n// ->leftJoin('checkin_class as cc','c.id = cc.class_id')\n// ->where(['c.school_id'=>$school_id,'cc.checkin_date'=>$checkin_date])->andWhere('cc.class_id is null')\n// ->all();\n\n //查询没有相关考勤记录的班级\n $sql = \"select id,name,teacher_id from classes where id not in (select class_id from checkin_class where checkin_date = :checkin_date and school_id = :school_id) and school_id = :school_id;\";\n $connection = \\Yii::$app->db;\n $uncheckin_class= $connection->createCommand($sql,[':school_id'=>$school_id,':checkin_date'=>$checkin_date])->queryAll();\n foreach ($uncheckin_class as $class) {\n $sql = 'select count(*) as count from customs where class_id = :class_id and cat_default_id='.HintConst::$ROLE_PARENT;\n $ret = $connection->createCommand($sql,[':class_id'=>$class['id']])->queryOne();\n $class_checkin_list[] = ['class_id'=>$class['id'],'teacher_id'=>$class['teacher_id'],'class_name'=>$class['name'],'checkin_count'=>0,'checkout_count'=>0,'member_count'=>$ret['count']];\n }\n return $class_checkin_list;\n }", "function get_entradas_proveedor_list($id) {\n\t\t$u = new Entrada();\n\t\t$sql=\"select distinct on (e.pr_facturas_id) e.pr_facturas_id, e.id as id1, date(e.fecha) fecha, prf.monto_total as importe_factura, pr.razon_social as proveedor,prf.folio_factura, prf.pr_pedido_id, ef.tag as espacio_fisico, eg.tag as estatuse, e.lote_id, cel.tag as estatus_traspaso \".\n\t\t\t\t\"from entradas as e \".\n\t\t\t\t\"left join cproveedores as pr on pr.id=e.cproveedores_id \".\n\t\t\t\t\"left join pr_facturas as prf on prf.id=e.pr_facturas_id \".\n\t\t\t\t\"left join espacios_fisicos as ef on ef.id=e.espacios_fisicos_id \".\n\t\t\t\t\"left join estatus_general as eg on eg.id=e.estatus_general_id \".\n\t\t\t\t\"left join lotes_pr_facturas as lf on lf.pr_factura_id=prf.id \".\n\t\t\t\t\"left join cestatus_lotes as cel on cel.id=lf.cestatus_lote_id \".\n\t\t\t\t\"where e.estatus_general_id=1 and ctipo_entrada=1 and e.cproveedores_id='$id'\".\n\t\t\t\t\"group by e.pr_facturas_id, e.id, e.fecha, importe_factura, pr.razon_social, prf.folio_factura, prf.pr_pedido_id, ef.tag, eg.tag, e.pr_facturas_id, e.cproveedores_id,e.lote_id, cel.tag \".\n\t\t\t\t\"order by e.pr_facturas_id desc,e.fecha desc\";\n\n\t\t//Buscar en la base de datos\n\t\t$u->query($sql);\n\t\tif($u->c_rows > 0){\n\t\t\treturn $u;\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "function l1st($c) {\n\t#-- $q = 'SELECT unique_name, category, short_desc FROM ng1np ORDER BY unique_name'; --#\n\t$q = 'SELECT unique_name FROM ng1np ORDER BY unique_name';\n\techo 'unique: ';\n \t\tforeach ($c->query($q) as $r) {\n \t\techo '<a href=\"./ng1np.php?q='.$r[unique_name].'\">'.$r[unique_name].'</a>'.\"\\t\";\n \t\t#-- print $r['category'] . \"\\t\"; --#\n \t\t#-- print $r['short_desc'] . \"\\n<br>\"; --#\n \t\t}\n\t}", "function loadLabelsFromDB( $sql ) \n {\n // execute given SQL statment\n $this->db->runSQL( $sql );\n \n // for each returned label\n while ($row = $this->db->retrieveRow() ) {\n \n // store in labels array\n $this->labels[ $row['label_key'] ][ $row['language_id'] ] = $row['label_label'];\n \n } // next label\n \n }", "function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }", "public function fetch_multi($s_where=null,$i_start=null,$i_limit=null)\r\n {\r\n \r\n }", "public function listProductsRelated($params)\n{\n $type = $this->db->real_escape_string($params['type']);\n $prdId = $this->db->real_escape_string($params['prdId']);\n\n if ($type == 'K'){\n $qry = \"SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products AS pr\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE prd_id = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1\n UNION\n SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products_packages AS pk\n INNER JOIN ctt_products AS pr ON pr.prd_id = pk.prd_id\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE pk.prd_parent = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1;\";\n return $this->db->query($qry);\n // cambio ac.prd_id por prd_parent\n } else if($type == 'P') {\n $qry = \"SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_products AS pr\n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE prd_id = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1\n UNION\n SELECT pr.*, sc.sbc_name, ct.cat_name \n FROM ctt_accesories AS ac\n INNER JOIN ctt_products AS pr ON pr.prd_id = ac.prd_parent \n INNER JOIN ctt_subcategories AS sc ON sc.sbc_id = pr.sbc_id\n INNER JOIN ctt_categories AS ct ON ct.cat_id = sc.cat_id\n WHERE ac.prd_parent = $prdId AND pr.prd_status = 1 AND sc.sbc_status = 1 AND ct.cat_status = 1;\";\n return $this->db->query($qry);\n\n } else {\n $qry = \"SELECT * FROM ctt_products WHERE prd_id = $prdId\";\n return $this->db->query($qry);\n }\n}", "public function getAllParkingPassesAndLinkedPassHolder(){\n $this->db->query(\"\n SELECT Parking_Pass_ID, First_Name, Last_Name, Issue_Date_Time, Expiry_Date_Time, Lot_ID, Space_ID\n FROM Parking_Pass\n JOIN Pass_Holder ON Pass_Holder.Customer_ID = Parking_Pass.Customer_ID;\n \");\n\n // ASSIGN RESULT SET\n $results = $this->db->resultSet();\n return $results;\n }", "public function get_join_data(){\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_users');\n\t\t$this->db->join('tbl_roles','tbl_roles.role_id = tbl_users.role_id','inner');\n\t\t$this->db->order_by('user_id','desc');\n\t\t$this->db->where_not_in('del_status',1);\n\t\t$query = $this->db->get();\n\t\treturn $query->result();\n\t}", "public function getTravelLocalApprovalSeqList() {\r\n\t\t$sql = $this->getSql();\r\n\t\t$select = $sql->select(); \r\n\t\t$select->from(array('e' => $this->seqTable))\r\n\t\t ->columns(array('id','ApprovalLevelName','ApprovalSequence'))\r\n\t\t; \r\n\t\t//echo $select->getSqlString(); \r\n\t\t//exit; \r\n\t\treturn $select; \r\n\t}", "public function add_JOIN($left, $right, $jointset) {\n\t\t$cmp = '';\n\t\t$joint = new QRYjoint($left, $right);\n\t\t$jointset->add($joint);\n\t}", "public function fetch_classes($limit,$start)\n {\n $table = $this->return_table();\n $this->db->order_by(\"id\", \"DESC\");\n $this->db->limit($limit, $start);\n $query = $this->db->get($table);\n\n if ($query->num_rows() > 0) {\n foreach ($query->result() as $row) {\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function followup_lists($l_id)\n {\n \n $result = $this->db->query(\"call lead_followup_lists('\".$l_id.\"')\")->result_array();\n save_query_in_log();\n \n return $result;\n }", "protected function left_join($new_column, $column, $operator, $column2){\n\n\t\tlist($this_table, $this_table_coulmn) = explode('.', $column);\n\t\tlist($second_table, $second_table_column) = explode('.', $column2);\n\n\t\t$this_results = $this->_t();\n\n\t\tif($this_results){\n\n\t\t\tforeach($this_results as $file_id => &$row){\n\t\t\t\t\n\t\t\t\tif($new_column == '*'){\n\n\t\t\t\t\t$selection = $second_table::where($second_table_column, $operator, $row->$this_table_coulmn)->get();\n\n\t\t\t\t\tif($selection){\n\n\t\t\t\t\t\t$selection_qty = count(static::object_to_array($selection));\n\n\t\t\t\t\t\tforeach ($selection as $selected_file_id => &$selected_row) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tforeach ($selected_row as $column => $value) {\n\n\t\t\t\t\t\t\t\tif($selection_qty > 1){\n\n\t\t\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$column}[$selected_file_id] = $value;\n\n\t\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$column} = $value;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tunset($selected_file_id, $selected_row);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}else{\n\n\t\t\t\t\tif(is_array($new_column)){\n\n\t\t\t\t\t\t$selection = $second_table::where($second_table_column, $operator, $row->$this_table_coulmn)->only($new_column);\n\n\t\t\t\t\t\tif($selection){\n\n\t\t\t\t\t\t\t$selection_qty = count(static::object_to_array($selection));\n\n\t\t\t\t\t\t\tforeach ($selection as $key => &$selected_array){\n\n\t\t\t\t\t\t\t\tforeach ($selected_array as $column => &$value) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$column}[$key] = $selected_array[$column];\n\n\t\t\t\t\t\t\t\t\tunset($column, $value);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tunset($key, $selected_array);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}else{\n\n\t\t\t\t\t\t$selection = $second_table::where($second_table_column, $operator, $row->$this_table_coulmn)->only($new_column);\n\n\t\t\t\t\t\tif($selection){\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$this_results[$file_id]->{$second_table.'.'.$new_column} = $selection;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tunset($file_id, $row);\n\t\t\t}\n\t\t}\n\n\t\tif($this_results){\n\n\t\t\t$this->_t_set($this_results);\n\t\t}\n\n\t\tunset($this_results);\n\n\t\treturn $this;\n\t}", "protected function getLeftJoins()\n {\n return array(\n \"rr\" => \"entity.requiredExerciseResources\",\n \"rk\" => \"entity.requiredKnowledges\"\n );\n }", "public function list_lend($id){\n\t\t\t//matriculas de los alumnos con idlibro \n\t\t\t//Obtener sus nombres\n\t\t\t$this->db->select('*');\n\t\t\t$this->db->from('prestamo');\n\t\t\t$this->db->join('estudiante','estudiante.matricula = prestamo.matricula');\n\t\t\t$this->db->where('prestamo.idlibro',$id);\n\t\t\t$query=$this->db->get();\n\n\t\t\treturn $query->result();\n\t\t}", "function enquery_view_sql()\n\t{\n\t\t$view_enquery=mysqli_query($this->con,\"SELECT enquery.*,categories.c_name FROM enquery,categories where enquery.c_id=categories.c_id order by enquery.id desc\");\n\t\treturn $view_enquery;\n\t}", "function vehiclelist()\r\n { \r\n // Sub Query2\r\n $this->db->select('imeino')->from('vehicleno_imei_mapping as vim'); \r\n $subQuery2 = $this->db->get_compiled_select();\r\n\r\n // Sub Query1\r\n $this->db->select('max(ag1.id) as id,ag1.imeino')->from('aegis_geofence as ag1')->where(\"ag1.imeino IN ($subQuery2)\", NULL, FALSE);\r\n $this->db->group_by('ag1.imeino'); \r\n $subQuery1 = $this->db->get_compiled_select();\r\n\r\n // Sub Query\r\n $this->db->select('id')->from(\"($subQuery1) as z\", NULL, FALSE);\r\n $subQuery = $this->db->get_compiled_select();\r\n \r\n // Main Query\r\n $query=$this->db->select('*')->from('aegis_geofence as ag,vehicleno_imei_mapping as vim')\r\n ->where(\"vim.isActive='Y' and application_id='3LGB6U2' and in_latitude >'0' and ag.imeino=vim.imeino and ag.id IN ($subQuery)\", NULL, FALSE)->get();\r\n \r\n return $query->result();\r\n \r\n }", "public function fetchRegisteredAcademicProgress($lintidreg) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n\t // get the courses\r\n $sql = $db->select()\r\n ->from(array('a' => 'tbl_academicprogress_subjects'),array('a.*'))\r\n ->joinLeft(array('b' => 'tbl_definationms'),'a.IdCourseType =b.idDefinition',array('b.DefinitionDesc as SubjectType'))\r\n ->joinLeft(array('d'=>'tbl_subjectmaster'),'a.CourseID = d.IdSubject',array('d.SubjectName','d.SubCode'))\r\n ->where('a.IdStudent = ?',$lintidreg)\r\n ->where('a.IsRegistered = ?','1')\r\n ->order('a.Semester');\r\n $result = $db->fetchAll($sql);\r\n return $result;\r\n }", "public function joinCustomer($classId);", "public static function doSelectJoinAllExceptSemester(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n $criteria = clone $criteria;\n\n // Set the correct dbName if it has not been overridden\n // $criteria->getDbName() will return the same object if not set to another value\n // so == check is okay and faster\n if ($criteria->getDbName() == Propel::getDefaultDB()) {\n $criteria->setDbName(RuangLongitudinalPeer::DATABASE_NAME);\n }\n\n RuangLongitudinalPeer::addSelectColumns($criteria);\n $startcol2 = RuangLongitudinalPeer::NUM_HYDRATE_COLUMNS;\n\n RuangPeer::addSelectColumns($criteria);\n $startcol3 = $startcol2 + RuangPeer::NUM_HYDRATE_COLUMNS;\n\n LargeObjectPeer::addSelectColumns($criteria);\n $startcol4 = $startcol3 + LargeObjectPeer::NUM_HYDRATE_COLUMNS;\n\n $criteria->addJoin(RuangLongitudinalPeer::ID_RUANG, RuangPeer::ID_RUANG, $join_behavior);\n\n $criteria->addJoin(RuangLongitudinalPeer::BLOB_ID, LargeObjectPeer::BLOB_ID, $join_behavior);\n\n\n $stmt = BasePeer::doSelect($criteria, $con);\n $results = array();\n\n while ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $key1 = RuangLongitudinalPeer::getPrimaryKeyHashFromRow($row, 0);\n if (null !== ($obj1 = RuangLongitudinalPeer::getInstanceFromPool($key1))) {\n // We no longer rehydrate the object, since this can cause data loss.\n // See http://www.propelorm.org/ticket/509\n // $obj1->hydrate($row, 0, true); // rehydrate\n } else {\n $cls = RuangLongitudinalPeer::getOMClass();\n\n $obj1 = new $cls();\n $obj1->hydrate($row);\n RuangLongitudinalPeer::addInstanceToPool($obj1, $key1);\n } // if obj1 already loaded\n\n // Add objects for joined Ruang rows\n\n $key2 = RuangPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n if ($key2 !== null) {\n $obj2 = RuangPeer::getInstanceFromPool($key2);\n if (!$obj2) {\n \n $cls = RuangPeer::getOMClass();\n\n $obj2 = new $cls();\n $obj2->hydrate($row, $startcol2);\n RuangPeer::addInstanceToPool($obj2, $key2);\n } // if $obj2 already loaded\n\n // Add the $obj1 (RuangLongitudinal) to the collection in $obj2 (Ruang)\n $obj2->addRuangLongitudinal($obj1);\n\n } // if joined row is not null\n\n // Add objects for joined LargeObject rows\n\n $key3 = LargeObjectPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n if ($key3 !== null) {\n $obj3 = LargeObjectPeer::getInstanceFromPool($key3);\n if (!$obj3) {\n \n $cls = LargeObjectPeer::getOMClass();\n\n $obj3 = new $cls();\n $obj3->hydrate($row, $startcol3);\n LargeObjectPeer::addInstanceToPool($obj3, $key3);\n } // if $obj3 already loaded\n\n // Add the $obj1 (RuangLongitudinal) to the collection in $obj3 (LargeObject)\n $obj3->addRuangLongitudinal($obj1);\n\n } // if joined row is not null\n\n $results[] = $obj1;\n }\n $stmt->closeCursor();\n\n return $results;\n }", "public function __construct() { \n $this->regs = selectQuery(\"SELECT reg_id, name FROM regions ORDER BY name\");\n $this->str_types = selectQuery(\"SELECT st_id, type FROM struct_types ORDER BY type\");\n $this->tuses = selectQuery(\"SELECT tus_id, name FROM tuses ORDER BY name\");\n $this->owners = selectQuery(\"SELECT own_id, name FROM owners ORDER BY name\");\n \n //\n $this->res_names = selectQuery(\"SELECT res_id, name \n FROM resources AS res\n INNER JOIN res_types AS rt ON rt.res_typ_id = res.res_typ_id\n WHERE \" . $this->r_type);\n \n //\n $this->res_types = selectQuery(\"SELECT res_typ_id AS rt_id, type AS res_type \n FROM res_types as rt \n WHERE \" . $this->r_type);\n\n // meter_nums <-> resource type relations\n $this->meter_nums = selectQuery(\"SELECT \n am.id AS id, \n am.meter_num AS meter_num, \n res.name AS res_name \n FROM all_meters AS am \n INNER JOIN resources AS res ON res.res_id = am.res_id \n WHERE status = 1 and \" . $this->r_id . \" \n ORDER BY am.meter_num\"); \n \n //\n $this->meter_types = selectQuery(\"SELECT mt_id, type FROM meter_types AS mt ORDER BY type\"); \n\n // agreements\n $this->agrs = selectQuery(\"SELECT \n ag_id, \n agr.name AS name, \n conclusion_date, \n res.name AS res_name \n FROM agreements AS agr \n INNER JOIN resources AS res ON res.res_id = agr.res_id\n WHERE agr.status = 1 and \" . $this->r_id . \" \n ORDER BY ag_id\");\n \n // general table (relations between agreement nums and meters)\n $this->general = selectQuery(\"SELECT \n gen.uid AS uid, \n agr.name AS agr, \n code,\n am.meter_num AS meter_num \n FROM general AS gen\n INNER JOIN agreements AS agr ON gen.ag_id = agr.ag_id\n INNER JOIN all_meters AS am ON am.id = gen.meter_num\n INNER JOIN res_types AS rt ON rt.res_typ_id = am.res_typ_id\n WHERE gen.status = 1 and \" . $this->r_type . \" \n ORDER BY agr.ag_id\"); \n }", "public function setSubUlClassLevel1($subUlClassLevel1)\n {\n $this->subUlClassLevel1 = $subUlClassLevel1;\n return $this;\n }", "function getClCNameCalibration($common_id1,$DbConnection)\n {\n //$query=\"select * FROM calibration WHERE calibration_id IN (SELECT calibration_id from calibration_grouping where account_id='$common_id1' and status=1) and status='1'\";\n $query=\"select calibration.calibration_id,calibration.calibration_name FROM calibration,\".\n \"calibration_grouping USE INDEX(cg_accountid_status) WHERE calibration.status='1' AND calibration.calibration_id=\".\n \"calibration_grouping.calibration_id AND calibration_grouping.account_id='$common_id1'\".\n \" AND calibration_grouping.status=1\";\n\t//echo \"Query=\".$query.\"<br>\";\n $result=mysql_query($query,$DbConnection); \t\t\t\t\t\t\t\n while($row=mysql_fetch_object($result))\n {\n /* $calibration_id=$row->calibration_id; \n $calibration_name=$row->calibration_name; */ \t\t\t\t\t\t\t\t \n $data[]=array('calibration_id'=>$row->calibration_id,'calibration_name'=>$row->calibration_name);\n }\n return $data;\n }", "function get_loop_list($pdb_id)\n {\n ### TESTING THIS QUERY -- REMOVE LINES 30-37 WHEN APPROVED\n // $this->db->select('group_concat(unit_id) AS unit_ids, LI.loop_id', FALSE)\n // ->from('loop_info AS LI')\n // ->join('loop_positions AS LP', 'LI.loop_id = LP.loop_id')\n // ->where('LI.pdb_id', $pdb_id)\n // ->group_by('LI.loop_id');\n // $query = $this->db->get();\n\n // if ( $query->num_rows() > 0 ) {\n // $data = array();\n // foreach($query->result() as $row) {\n // $data[] = '\"' . implode('\",\"', array($row->loop_id, $row->unit_ids)) . '\"';\n // }\n // $table = implode(\"\\n\", $data);\n // } else {\n // $table = 'No loops found';\n // }\n\n // return $table;\n\n\n $this->db->select('loop_info.loop_id, group_concat(unit_id order by position_2023) as unit_ids')\n ->from('loop_info')\n ->join('loop_positions', 'loop_info.loop_id = loop_positions.loop_id')\n ->where('loop_info.pdb_id', $pdb_id)\n ->group_by('loop_info.loop_id');\n $query = $this->db->get();\n\n if ( $query->num_rows() > 0 ) {\n $data = array();\n foreach($query->result() as $row) {\n $data[] = '\"' . implode('\",\"', array($row->loop_id, $row->unit_ids)) . '\"';\n }\n $table = implode(\"\\n\", $data);\n } else {\n $table = 'No loops found';\n }\n\n return $table; \n\n }", "public function getStudentsByClassId($classeId,$lastSeasonId,$ids){\n $this->db->select('students.*,points.sc,points.te');\n $this->db->join('classes','students.classe=classes.id','left');\n $this->db->join('points','points.student=students.id','left');\n $this->db->where('students.classe',$classeId);\n $this->db->where('students.season',$lastSeasonId);\n $this->db->where_not_in('points.subject',$ids);\n return $this->db->get('students')->result();\n }", "public static function doSelectJoinAllExceptRuang(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)\n {\n $criteria = clone $criteria;\n\n // Set the correct dbName if it has not been overridden\n // $criteria->getDbName() will return the same object if not set to another value\n // so == check is okay and faster\n if ($criteria->getDbName() == Propel::getDefaultDB()) {\n $criteria->setDbName(RuangLongitudinalPeer::DATABASE_NAME);\n }\n\n RuangLongitudinalPeer::addSelectColumns($criteria);\n $startcol2 = RuangLongitudinalPeer::NUM_HYDRATE_COLUMNS;\n\n LargeObjectPeer::addSelectColumns($criteria);\n $startcol3 = $startcol2 + LargeObjectPeer::NUM_HYDRATE_COLUMNS;\n\n SemesterPeer::addSelectColumns($criteria);\n $startcol4 = $startcol3 + SemesterPeer::NUM_HYDRATE_COLUMNS;\n\n $criteria->addJoin(RuangLongitudinalPeer::BLOB_ID, LargeObjectPeer::BLOB_ID, $join_behavior);\n\n $criteria->addJoin(RuangLongitudinalPeer::SEMESTER_ID, SemesterPeer::SEMESTER_ID, $join_behavior);\n\n\n $stmt = BasePeer::doSelect($criteria, $con);\n $results = array();\n\n while ($row = $stmt->fetch(PDO::FETCH_NUM)) {\n $key1 = RuangLongitudinalPeer::getPrimaryKeyHashFromRow($row, 0);\n if (null !== ($obj1 = RuangLongitudinalPeer::getInstanceFromPool($key1))) {\n // We no longer rehydrate the object, since this can cause data loss.\n // See http://www.propelorm.org/ticket/509\n // $obj1->hydrate($row, 0, true); // rehydrate\n } else {\n $cls = RuangLongitudinalPeer::getOMClass();\n\n $obj1 = new $cls();\n $obj1->hydrate($row);\n RuangLongitudinalPeer::addInstanceToPool($obj1, $key1);\n } // if obj1 already loaded\n\n // Add objects for joined LargeObject rows\n\n $key2 = LargeObjectPeer::getPrimaryKeyHashFromRow($row, $startcol2);\n if ($key2 !== null) {\n $obj2 = LargeObjectPeer::getInstanceFromPool($key2);\n if (!$obj2) {\n \n $cls = LargeObjectPeer::getOMClass();\n\n $obj2 = new $cls();\n $obj2->hydrate($row, $startcol2);\n LargeObjectPeer::addInstanceToPool($obj2, $key2);\n } // if $obj2 already loaded\n\n // Add the $obj1 (RuangLongitudinal) to the collection in $obj2 (LargeObject)\n $obj2->addRuangLongitudinal($obj1);\n\n } // if joined row is not null\n\n // Add objects for joined Semester rows\n\n $key3 = SemesterPeer::getPrimaryKeyHashFromRow($row, $startcol3);\n if ($key3 !== null) {\n $obj3 = SemesterPeer::getInstanceFromPool($key3);\n if (!$obj3) {\n \n $cls = SemesterPeer::getOMClass();\n\n $obj3 = new $cls();\n $obj3->hydrate($row, $startcol3);\n SemesterPeer::addInstanceToPool($obj3, $key3);\n } // if $obj3 already loaded\n\n // Add the $obj1 (RuangLongitudinal) to the collection in $obj3 (Semester)\n $obj3->addRuangLongitudinal($obj1);\n\n } // if joined row is not null\n\n $results[] = $obj1;\n }\n $stmt->closeCursor();\n\n return $results;\n }", "public function getNominaEtau3($id,$idg)\n { \n $result=$this->adapter->query('select distinct c.idNom, c.id, a.idCon, \n case a.cCosEmp when 0 then a.idCcos\n when 1 then b.idCcos End as idCcos, \n case a.horasCal when 0 then 0 \n when 1 then (c.dias*'.$this->horasDias.') End as horas, 1, \n case when g.valor=2 then \n case when g.tipo = 1 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n End as dev, \n case when g.valor=2 then \n case when g.tipo = 2 then a.valor else 0 End\t\t\t\t \n when g.valor=1 then 0 \n\t\tEnd as ded, h.formula, c.dias, g.tipo , b.id as idEmp , g.idFor , a.diasLab, c.diasVac, a.vaca, \n case when ii.codigo is null then \"\" else ii.codigo end as nitTer \n from n_tip_auto_i a inner join a_empleados b on a.idTauto=b.idTau3\n inner join n_nomina_e c on b.id=c.idEmp \n inner join n_nomina d on d.id=c.idNom\n inner join n_tip_auto_tn e on e.idTnom=d.idTnom \n inner join n_tip_calendario f on f.id=d.idCal\n inner join n_conceptos g on g.id=a.idCon\n inner join n_formulas h on h.id=g.idFor\n left join n_terceros_s i on i.id = g.idTer \n left join n_terceros ii on ii.id = i.idTer \n WHERE not exists (SELECT null from n_nomina_e_d \n where c.id=idInom and a.idCon=idConc and a.idCcos=idCcos and tipo=1 ) \n and d.estado=0 and b.idGrup='.$idg.' and c.idNom='.$id,Adapter::QUERY_MODE_EXECUTE);\n $datos=$result->toArray();\n return $datos; \n }", "public function fngetlandscapelevel($lintidreg,$landscapeID,$isreg) {\r\n $db = Zend_Db_Table::getDefaultAdapter();\r\n\t\t$select = $db->select()\r\n ->from(array('a' => 'tbl_academicprogress_subjects'),array('a.*'))\r\n ->joinLeft(array('b' => 'tbl_landscapeblock'), \" b.IdLandscape = '\".$landscapeID.\"' AND a.Year_Level_Block = b.block \",array('b.block','b.blockname'))\r\n ->joinLeft(array('d'=>'tbl_subjectmaster'),'a.CourseID = d.IdSubject',array('d.SubjectName','d.SubCode'))\r\n ->joinLeft(array('e' => 'tbl_definationms'),'a.IdCourseType =e.idDefinition',array('e.DefinitionDesc as SubjectType'))\r\n ->where(\"a.IdStudent = ?\",$lintidreg)\r\n ->where('a.IsRegistered = ?',$isreg)\r\n ->order('a.Year_Level_Block');\r\n\t\t$larrResult = $db->fetchAll($select);\r\n\t\treturn $larrResult;\r\n\t}" ]
[ "0.6085006", "0.5322063", "0.52307904", "0.5143592", "0.5038736", "0.50117224", "0.4805328", "0.47367635", "0.47178206", "0.47047818", "0.46971208", "0.46917227", "0.46782854", "0.46751997", "0.46632978", "0.46590844", "0.46262386", "0.45911092", "0.45758164", "0.45639122", "0.45420521", "0.45360366", "0.4509437", "0.4509425", "0.4506742", "0.4496169", "0.44919223", "0.44855788", "0.44780865", "0.44752818", "0.44725254", "0.4459832", "0.44454283", "0.4445347", "0.44346383", "0.44330394", "0.443186", "0.44285226", "0.4424921", "0.44153625", "0.4408571", "0.4403207", "0.43924075", "0.4390966", "0.4388269", "0.43858427", "0.4374162", "0.43727103", "0.43679434", "0.43623352", "0.43568784", "0.43548703", "0.43519616", "0.43424383", "0.43394014", "0.4325344", "0.43234327", "0.43029538", "0.43025586", "0.43015748", "0.43011573", "0.42990527", "0.42912766", "0.42912105", "0.4289112", "0.42866704", "0.42862952", "0.42825148", "0.42796293", "0.42773318", "0.4276786", "0.42757392", "0.42741498", "0.4265109", "0.42639244", "0.42608517", "0.42469776", "0.4245373", "0.4241517", "0.4240846", "0.42384487", "0.42382184", "0.42372826", "0.42321023", "0.4230883", "0.42286256", "0.42273167", "0.42257464", "0.4225262", "0.42238435", "0.4218961", "0.42186558", "0.42183906", "0.42118904", "0.4208307", "0.42080212", "0.42078087", "0.41993806", "0.4195345", "0.41929728" ]
0.51748663
3
print_r($hands); //delete after debugging
function showhands($hands, $all=false) //$all flag determines if dealer's first card is shown or not { foreach ($hands as $hand => $cards) { echo "{$hand}'s hand is ";//shows 'Computer's hand is...' and 'Player's hand is...' foreach ($cards as $card=>$value) { if ($hand == "Computer") //Computer { switch ($card) { case 0: if ($all) { echo "({$value})"; } else { echo "(?-?)"; } break; default: echo "({$value})"; break; } } else //Player { echo "({$value})"; } } echo PHP_EOL; } return $hands; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function get_hands() {\n return $this->hands;\n }", "public function GetHandArray(){\r\n\t \r\n\t\treturn $this -> handArray;\r\n\t }", "public function GetHands(){\r\n\t \r\n\t\treturn $this -> hands;\r\n\t }", "public function drawHand(array $hands) {\n\n\t\t$hand = collect($hands)->random();\n\t\t$handClassName = $this->handPath.$hand;\n\t\t$this->hand = new $handClassName();\n\n\t\t$this->output($this->name.' has: '.$hand);\n\t}", "public function removeHand() {\n\t\t\t$this->_hand[] = array();\n\t\t}", "function drawHand(&$deck, &$hand) {\n\t$cardOne = drawACard($deck);\n\t$hand[] = $cardOne;\n\t$cardTwo = drawACard($deck);\n\t$hand[] = $cardTwo;\n\treturn $hand;\n}", "function displayHand ($hand,$column,$locationArray) {\r\n $pictures= array();\r\n // Loop through the card keys in the player's hand\r\n foreach ($hand as $value) {\r\n // Get the location of our pic\r\n array_push($pictures, $locationArray [$value] [$column]);\r\n }\r\n return $pictures;\r\n}", "public function print_cards(array $hands=NULL) {\n if($hands === NULL){\n $hands = $this->get_hands();\n }\n foreach ($hands as $playername => $hand) {\n if($this->browser === FALSE){\n echo $playername . ': ' . implode(' - ', $hand).PHP_EOL;\n } else {\n echo '<div class=\"players\"><div class=\"players playername\">'.$playername.'</div>';\n foreach ($hand as $card) {\n echo $card;\n }\n echo '</div>';\n }\n \n }\n return $this;\n }", "function getHandbook(): array\n {\n }", "public static function getHand(): array\n {\n return array_slice(self::getShuffledDeck(), 0, 10);\n }", "function getHand($playerNumber) \n{\n\tglobal $myDeck;\n\t\n\t#allowing the arrays for players to be used\n\tglobal $allHands;\n\tglobal $player;\n\tglobal $player1;\n\tglobal $player2;\n\tglobal $player3;\n\tglobal $player4;\n\tglobal $cardNumber;\n\tglobal $dupe;\n\t\n\t$isLast_num = $player;\n\t#Creating an array to store the 4 suits of the deck for the PATHWAY.\n\t$mySuits = array(\"clubs\", \"diamonds\", \"hearts\", \"spades\");\n\t\n\t#Creating a flag to control the while loop.\n\t$flag = true;\n\t\n\t#Shuffling all my cards before entering the while loop, so it is random.\n\tshuffle($myDeck);\n\n\t// if($dupe == true)\n\t// {\n\t// while($flag) \n\t// {\n\t// \t$counter_forif = 1;\n\t// \t $randomCard = rand(1,52);\n\t\t \n\t// \t $tempHand = \"<img class='cards' src='img/\". $mySuits[ceil($randomCard / 13) - 1].\"/\" . $card . \".png'/>\";\n\t// \t if($playerNumber == 0)\n\t// \t\t{\n\t// \t\t\tarray_push($player1,$tempHand);\n\t// \t\t}\n\t// \t\tif($playerNumber == 1)\n\t// \t\t{\n\t// \t\t\tarray_push($player2, $tempHand);\n\t// \t\t}\n\t// \t\tif($playerNumber == 2)\n\t// \t\t{\n\t// \t\t\tarray_push($player3, $tempHand);\n\t// \t\t}\n\t// \t\tif($playerNumber == 3)\n\t// \t\t{\n\t// \t\t\tarray_push($player4, $tempHand);\n\t// \t\t}\n\t\t\t\n\t// \t\t$counter_forif +=1;\n\t// \t\t#Displaying the cards.\n\t\t\t\n\t// \t\t//echo $tempHand;\n\t\t\t\n\t// \t\t#If it has reached the amount of cards needed, add to allhands, print and jump out of while loop\n\t// \t\tif($counter_forif == $cardNumber)\n\t// \t\t{\n\t// \t\t\tif($playerNumber == 0)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player1);\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t $flag = false;\n\t// \t\t\t\t}\n\t// \t\t\t}\n\t\t\t\t\n\t// \t\t\tif($playerNumber == 1)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player2);\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t\t$flag = false;\n\t// \t\t\t\t}\n\t// \t\t\t}\n\t\t\t\t\n\t// \t\t\tif($playerNumber == 2)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player3);\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t $flag = false;\n\t// \t\t\t\t} \n\t// \t\t\t}\n\t\t\t\t\n\t// \t\t\tif($playerNumber == 3)\n\t// \t\t\t{\n\t// \t\t\t\tarray_push($allHands,$player4);\n\t\t\t\t\t\n\t// \t\t\t\tif(($playerNumber+1) == $isLast_num)\n\t// \t\t\t\t{\n\t// \t\t\t\t echocards($allHands);\n\t// \t\t\t\t $flag = false;\n\t// \t\t\t\t}\n\t// \t\t\t}\n\t// \t\t}\n\t// \t}\n\t// }\n\n\n\tif($dupe == false)\n\t{\n\t while($flag) \n\t {\n\t \n\t $counter_forif = 1;\n\t \n\t\t $lastCard = array_pop($myDeck);\n\t\t #Selecting what number the card will be (% 13).\n\t\t $card = $lastCard % 13;\n\t\t\n\t\t\t$stuff = $mySuits[ceil($lastCard / 13) - 1];\n\t\t\t//echo \"$stuff\";\n\t\t #Storing the picture into tempHand variable.\n\t\t $tempHand = \"<img class='cards' src='img/$stuff/$card.png'/>\";\n\t\t\n\t\t\n \t\tif($playerNumber == 0)\n \t\t{\n \t\t\tarray_push($player1,$tempHand);\n \t\t}\n \t\tif($playerNumber == 1)\n \t\t{\n \t\t\tarray_push($player2, $tempHand);\n \t\t}\n \t\tif($playerNumber == 2)\n \t\t{\n \t\t\tarray_push($player3, $tempHand);\n \t\t}\n \t\tif($playerNumber == 3)\n \t\t{\n \t\t\tarray_push($player4, $tempHand);\n \t\t}\n \t\t\n \t\t$counter_forif +=1;\n \t\t#Displaying the cards.\n\t\t\n \t\t//echo $tempHand;\n \t\t\n \t\t#If it has reached the amount of cards needed, add to allhands, print and jump out of while loop\n \t\tif($counter_forif == $cardNumber)\n \t\t{\n \t\t\tif($playerNumber == 0)\n \t\t\t{\n \t\t\t\tarray_push($allHands,$player1);\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t\t}\n \t\t\t}\n \t\t\n \t\t\t\n \t\t\tif($playerNumber == 1)\n \t\t\t{\n \t\t\t\tarray_push($allHands,$player2);\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t }\n \t\t\t}\n \t\t\t\n \t\t\tif($playerNumber == 2)\n \t\t\t{\n \t\t\t\tarray_push($allHands,$player3);\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t }\n \t\t\t}\n \t\t\t\n \t\t\tif($playerNumber == 3)\n \t\t\t{\n \n \t\t\t\tarray_push($allHands,$player4);\n \t\t\t\t\n \t\t\t\tif(($playerNumber+1) == $isLast_num)\n \t\t\t\t{\n \t\t\t\t echocards($allHands);\n \t\t\t\t $flag = false;\n \t\t\t\t}\n \t\t\t}\n\t \t}\n\t\t}\n\t}\n}", "public function displayHand() {\n\t\t\t$out = array();\n\t\t\tforeach ($this->_hand as $card) {\n\t\t\t\t$out[] = $card->name();\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\treturn implode(',',$out);\n\t\t}", "public function getCardHand() {\n\t\treturn $this->cardHand;\n\t}", "public function getHand() {\n\t\t\treturn $this->_hand;\n\t\t}", "function displayCards() {\n global $deck;\n foreach ($deck as $card){\n $value = $card['value'];\n $suit = $card['suit'];\n }\n }", "function pocker_flush(array $hand) {\n\n if (count($hand) < 5) return false;\n\n $suits = cards_suits($hand);\n\n $same = array_count_values($suits);\n\n if (count($same) > 1) return false;\n\n return ['value' => highest_value_card($hand)['value'], 'remaining' => []];\n}", "function printvalues(){\n\t\tprint_r([$this->bedroom,$this->bathroom,$this->kitchen, $this->livingroom]);\n\t}", "public function AddToHandArray($hand, $points ){\r\n\t \r\n\t\t$myHandArray = $this-> handArray;\r\n\t \r\n\t\tforeach($myHandArray as $hand){\r\n\t\t\t\r\n\t\t\t$handArray[$hand] = $points ;\r\n\t\t}\r\n\t\r\n\t }", "function straight(array $hand) {\n GLOBAL $RANK;\n\n if (count($hand) < 5) return false;\n\n $values = cards_values($hand);\n\n usort($values, \"by_value\");\n $row = implode($values);\n $pos = strpos($RANK, $row);\n if ($pos === false) return false;\n\n return ['value' => $RANK[$pos], 'remaining' => []];\n}", "function debugdeck($deck) {\n\t$txt = '' ;\n\tforeach ( $deck->main as $id => $card )\n\t\t$txt .= ' - '.$card->name.'\\n' ;\n\tforeach ( $deck->side as $id => $card )\n\t\t$txt .= ' - '.$card->name.'\\n' ;\n\treturn $txt ;\n}", "function generateHand($deck) {\n shuffle($deck);\n $hand = array(); \n \n for ($i = 0; $i < 3; $i++) {\n $cardNum = array_pop($deck);\n $card = mapNumberToCard($cardNum); \n array_push($hand, $card); \n }\n \n return $hand; \n }", "public function stateScores () : void {\r\n $highestHand = 0;\r\n\r\n foreach ($this->players() as $player) {\r\n if ( $player->handValue() > $highestHand && ! $player->busted() )\r\n $highestHand = $player->handValue();\r\n\r\n if ( $player->busted() )\r\n echo 'Player ' . $player->getName() . ' busted with ' . $player->handValue();\r\n else\r\n echo 'Player ' . $player->getName() . \"'s hand : \" . $player->handValue();\r\n echo PHP_EOL;\r\n }\r\n\r\n if ( $this->dealer->handValue() > $highestHand && ! $this->dealer->busted() )\r\n $highestHand = $this->dealer->handValue();\r\n\r\n if ( $this->dealer->busted() )\r\n echo 'Dealer busted with ' . $this->dealer->handValue();\r\n else\r\n echo \"Dealer's hand : \" . $this->dealer->handValue();\r\n echo PHP_EOL;\r\n\r\n echo PHP_EOL, PHP_EOL, \"Highest Hands : \";\r\n foreach ($this->players() as $player)\r\n if ( $player->handValue() == $highestHand )\r\n echo $player->getName() . \" \";\r\n if ( $this->dealer->handValue() == $highestHand )\r\n echo 'Dealer';\r\n echo PHP_EOL, PHP_EOL;\r\n }", "function full_house(array $hand) {\n if (count($hand) < 5) return false;\n\n $suits = cards_values($hand);\n\n $same = array_count_values($suits);\n if (count($same) != 2) return false;\n $two_three = array_flip($same);\n return ['value' => $two_three[3] . $two_three[2], 'remaining' => []];\n}", "function echoHand($hand, $name, $hidden = false) {\n\tif($hidden === true) {\n\t\t$cardString = \"[$hand[0]] [???]\";\n\t} elseif (count($hand) == 2) {\n\t\t$cardString = \"[$hand[0]] [$hand[1]]\";\n\t} else {\n\t\t$cardString = \"[$hand[0]] [$hand[1]] [$hand[2]]\";\n\t}\n\treturn \"$name: $cardString\";\n}", "function royal_flush(array $hand) {\n if (!pocker_flush($hand)) return false;\n $straight = straight($hand);\n if (!$straight) return false;\n if ($straight['value'] !== 'T') return false;\n\n return ['value' => true, 'remaining' => []];\n}", "abstract public function getPlayerHand($player_id): array;", "public function get_hp(){ return $this->_hp;}", "function showMe($output) {\r\n echo '<pre>';\r\n print_r($showMe);\r\n echo '</pre>';\r\n}", "function aurora_borealis() {\n\t$chosen = steamed_hams_get_lyric();\n\techo \"<p id='seymour'>$chosen</p>\";\n}", "function straight_flush(array $hand) {\n if (!pocker_flush($hand)) return false;\n\n return straight($hand);\n}", "public function getHairs()\n {\n return $this->hairs;\n }", "public function getNombreHeures() {\n return $this->nombreHeures;\n }", "function cekkartu($kartu){\n\t$pokerhands = Array (\"nonpaying hand\", \"jacks or better\", \"two pair\", \"three of a kind\", \"straight\", \"flush\", \"full house\", \"four of a kind\", \"straight flush\", \"royal flush\");\n\t\t$cardarr = Array(\"c1\", \"c2\", \"c3\", \"c4\", \"c5\", \"c6\", \"c7\", \"c8\", \"c9\", \"c10\", \"cj\", \"cq\", \"ck\", \"d1\", \"d2\", \"d3\", \"d4\", \"d5\", \"d6\", \"d7\", \n \"d8\", \"d9\", \"d10\", \"dj\", \"dq\", \"dk\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"h7\", \"h8\", \"h9\", \"h10\", \"hj\", \"hq\", \"hk\", \"s1\", \"s2\", \"s3\", \"s4\", \"s5\", \"s6\", \"s7\", \"s8\", \"s9\", \"s10\", \"sj\", \n \"sq\", \"sk\");\n\t//$phand[1] = 0;\n\t$phand[0] = 0;\n\t$flush = 0;\n\t$straight = 0;\n\tfor($i=0;$i<10;$i++){\n\t\t$car[$i] = $cardarr[$kartu[$i]];\n\t\t$suit[$i] = substr($car[$i], 0,1);\n\t\t$rank[$i] = substr($car[$i], 1,2);\n\t\tif ($rank[$i] == \"1\") {\n\t\t\t$ranks[$i] = 14;\n\t\t\t$ranky[$i] = 14;\n\t\t}\n\t\telse if($rank[$i] == \"j\") {\n\t\t\t$ranks[$i] = 11;\n\t\t\t$ranky[$i] = 11;\n\t\t}\n\t\telse if($rank[$i] == \"q\") {\n\t\t\t$ranks[$i] = 12;\n\t\t\t$ranky[$i] = 12;\n\t\t}\n\t\telse if($rank[$i] == \"k\") {\n\t\t\t$ranks[$i] = 13;\n\t\t\t$ranky[$i] = 13;\n\t\t}\n\t\telse {\n\t\t\t$ranks[$i] = $rank[$i]*1;\n\t\t\t$ranky[$i] = $rank[$i]*1;\n\t\t}\n\t}\n\trsort($ranks);\n\tfor($j=0;$j<5;$j++){\n\t\t$x = $j+1;\n\t\t$xrank = $ranks[$j]-1;\n\t\tif ($suit[$j] == $suit[0]) {\n\t\t\t$isflush++;\n\t\t\t//$res = 5;\n\t\t}\n\t\t//echo \"$xrank dan $ranks[$x] dan $ranks[$j]<BR>\";\n\t\tif ($xrank == $ranks[$x]) {\n\t\t\t$isstraight++;\n\t\t}\n\t\t$kind[$rank[$j]] = $kind[$rank[$j]]+1;\n\t\tif ($kind[$rank[$j]] == 4) {\n\t\t\t$iskind = 4;\n\t\t}\n\t\telse if ($kind[$rank[$j]] == 3) {\n\t\t\t$iskind = 3;\n\t\t}\n\t\telse if ($kind[$rank[$j]] == 2) {\n\t\t\t$iskind = 2;\n\t\t}\n\t\t//$iskind = $kind[$rank[$j]];\n\t\t/*\n\t\tif ($kind[$rank[$j]] == 3) {\n\t\t\t$kinds[$rank[$j]] = 3;\n\t\t\tif ($kindy == $rank[$j]) {\n\t\t\t\t$kindy = 0;\n\t\t\t}\n\t\t\t$kindx = $rank[$j];\n\t\t\techo \"$kindy ex $kindx kindyx $rank[$j]<BR>\";\n\t\t}else if ($kind[$rank[$j]] == 2){\n\t\t\t$kinda[$rank[$j]] = 2;\n\t\t\t$kindy = $rank[$j];\n\t\t\techo \"$kindy kindy<BR>\";\n\t\t}\n\t\t*/\n\t\tif ($kind[$rank[$j]] == 2) {\n\t\t\tif ($pairx != $rank[$j]) {\n\t\t\t\t$pairx = $ranky[$j];\n\t\t\t\t$pair++;\n\t\t\t}\n\t\t}\n\t\t//echo \"\".$kind[$rank[$j]].\" dan $rank[$j] kind<BR>\";\n\t\t//if ($rank[$j])\n\t}\n\t//echo \"$isflush dan $isstraight <BR>\";\n\t//echo \"$kinds[$kindx] dan $pairx full <BR>\";\n\tif ($isflush == 5 && $isstraight == 4) {\n\t\t//$phand[1] = 1;\n\t\t//echo \"$ranks[0]\";\n\t\tif ($ranks[0] == 14) {\n\t\t\t$royalflush = 1;\n\t\t\t$phand[0] = 1;\n\t\t}\n\t\telse {\n\t\t\t$straightflush = 1;\n\t\t\t$phand[0] = 2;\n\t\t}\n\t}else if ($iskind == 4) {\n\t\t$fourofakind = 1;\n\t\t$phand[0] = 3;\n\t}else if ($pair == 2 && $iskind == 3) {\n\t\t$fullhouse = 1;\n\t\t$phand[0] = 4;\n\t}\n\t//else if ($kinds[$kindx] == 3 && $kinda[$kindy] == 2) {\n\t//\t$fullhouse = 1;\n\t//}\n\telse if ($isflush == 5) {\n\t\t//$phand[1] = 1;\n\t\t$flush = 1;\n\t\t$phand[0] = 5;\n\t}else if ($isstraight == 4) {\n\t\t//$phand[1] = 1;\n\t\t$straight = 1;\n\t\t$phand[0] = 6;\n\t}else if ($iskind == 3) {\n\t\t$threeofakind = 1;\n\t\t$phand[0] = 7;\n\t}else if ($pair == 2) {\n\t\t$twopair = 1;\n\t\t$phand[0] = 8;\n\t}else if ($pair == 1) {\n\t\tif ($pairx >= 11) {\n\t\t\t$onepair = 1;\n\t\t\t$phand[0] = 9;\n\t\t}else {\n\t\t\t$none = 1;\n\t\t}\n\t}else{\n\t\t$none = 1;\n\t\t//echo \"habis\";\n\t}\n\t//echo \"$royalflush royal<BR>\";\n\t//echo \"$straightflush sflush<BR>\";\n\t//echo \"$fourofakind fourkind<BR>\";\n\t//echo \"$fullhouse fhouse<BR>\";\n\t//echo \"$flush flush<BR>\";\n\t//echo \"$straight straight<BR>\";\n\t//echo \"$threeofakind threekind<BR>\";\n\t//echo \"$twopair two<BR>\";\n\t//echo \"$onepair pair<BR>\";\n\t//echo \"$none none<BR>\";\n/*\n\t$flush = isflush($totaljoker,$kartusort,$hand);\n\t$straight = isstraight($totaljoker,$kartusort,$hand);\n\t$straightflush = isstraightflush($totaljoker,$kartusort,$hand,$flush,$strait);\n\t$royalflush = isroyalflush($straightflush);\n\n\t$fourkind = isfourofakind($totaljoker,$kartusort,$hand);\n\t$twopair = istwopairall($totaljoker,$kartusort,$hand);\n\t$threekind = isthreeofakind($totaljoker,$kartusort,$hand);\n\n$kartututupgb4 = isthreeofakindyy($totaljoker,$kartusort,$hand);\n$kartututupgball = istwopairallyy($totaljoker,$kartusort,$hand);\n\n$fullhouse = isfullhouse($totaljoker,$kartusort,$hand,$kartututupgb4,$kartututupgball,$twopair,$threekind);\n\n$acepair = isacepair($totaljoker,$kartusort,$hand);\n*/\n\t//$phand[2] = $ranky;\n\treturn $phand;\n}", "function scrapbots_pair_up_scrapbots ($armies){\n\tdebug(\"Pairing up Bots\");\n\t$attacker = scrapbots_choose_fighter($armies['attacker']);\n\tdebug(\"Debugging attacker at pairup\");\n\tdebug($attacker);\n\t$defender = scrapbots_choose_fighter($armies['defender']);\n\t$duellers = array(\"attacker\"=>$attacker, \"defender\"=>$defender);\n\tdebug(\"Debugging defender at pairup\");\n\tdebug($defender);\n\tdebug(\"Duellers in this round:\");\n\tdebug($duellers);\n\treturn $duellers;\n}", "function cards_suits(array $hand):array {\n return array_map(function ($el) {return strval($el[1]);}, $hand);\n}", "public function getAwards()\n {\n return $this->getFieldArray('586');\n }", "public function clear(){\n\t\t$this->pile = array();\n\t}", "private static function getShuffledDeck(): array\n {\n $deck = range(0, 51);\n shuffle($deck);\n return $deck;\n }", "function pokerWinner($player1Hand){\n $pairCount = 0;\n $twoPairCount = 0;\n $threeOfAKind = 0;\n $fourOfAKindCount = 0;\n $straightCount = 0;\n $flushCount = 0;\n $fullHouseCount = 0;\n $fourOfAKindCount = 0;\n $straightFlushCount = 0;\n $royalFlushCount = 0;\n $consecutive = 0;\n $value = 10;\n\n $matchingCardCount = pairFinder($player1Hand);\n\n if($matchingCardCount == 3){\n \n $fourOfAKindCount = 1;\n $threeOfAKind = 1;\n $pairCount = 2;\n }\n\n if($matchingCardCount == 2){\n $threeOfAKind = 1;\n $pairCount = 1;\n }\n\n if($matchingCardCount == 1){\n $pairCount = 1;\n\n }\n\n //check for two pairs\n if(twoPairFinder($player1Hand)){\n $pairCount = 2;\n $twoPairCount = 1;\n }\n\n\n\n if(straightFinder($player1Hand)){\n $straightCount = 1;\n\n\n }\n\n //check for flush\n if(flushFinder($player1Hand)){\n $flushCount = 1;\n\n }\n\n //check for straight flush\n if($flushCount == 1 && $straightCount == 1){\n $straightFlushCount = 1;\n }\n\n //check for royal flush\n if($straightFlushCount == 1){\n if(royalFlushFinder($player1Hand)){\n $royalFlushCount = 1;\n }\n }\n\n //Testing area\n\n // echo 'The $pairCount is: ' . $pairCount . \"\\n\" . \"\\n\";\n // echo 'The $twoPairCount is: ' . $twoPairCount . \"\\n\" . \"\\n\";\n // echo 'The $threeOfAKind is: ' . $threeOfAKind . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightCount is: ' . $straightCount . \"\\n\" . \"\\n\";\n // echo 'The $flushCount is: ' . $flushCount . \"\\n\" . \"\\n\";\n // echo 'The $fullHouseCount is: ' . $fullHouseCount . \"\\n\" . \"\\n\";\n // echo 'The $fourOfAKindCount is: ' . $fourOfAKindCount . \"\\n\" . \"\\n\";\n // echo 'The $straightFlushCount is: ' . $straightFlushCount . \"\\n\" . \"\\n\";\n // echo 'The $royalFlushCount is: ' . $royalFlushCount . \"\\n\" . \"\\n\";\n\n\n //Give out points\n if($royalFlushCount == 1){\n $value = 10;\n return $value;\n }\n\n if($straightFlushCount == 1){\n $value = 9;\n return $value;\n }\n\n if($fourOfAKindCount == 1){\n $value = 8;\n return $value;\n }\n\n if($fullHouseCount == 1){\n $value = 7;\n return $value;\n }\n\n if($flushCount == 1){\n $value = 6;\n return $value;\n }\n\n if($straightCount == 1){\n $value = 5;\n return $value;\n }\n\n if($threeOfAKind == 1){\n $value = 4;\n return $value;\n }\n\n if($twoPairCount == 1){\n $value = 3;\n return $value;\n }\n\n if($pairCount == 1){\n $value = 2;\n return $value;\n }\n\n else{\n $value = 1;\n return $value;\n }\n\n\n}", "function rh($spades, $hearts, $diamonds, $clubs) {\n return \"<span class='handContent'>\" .\n \"<span style='color: black'>&spades;</span> $spades<br/>\" .\n \"<span style='color: red'>&hearts;</span> $hearts<br/>\" .\n \"<span style='color: red'>&diams;</span> $diamonds<br/>\" .\n \"<span style='color: black'>&clubs;</span> $clubs<br/>\" .\n \"</span>\";\n}", "function pre_r ( $array ) {\n\t\t\t\t\techo '<pre>';\n\t\t\t\t\tprint_r($array);\n\t\t\t\t\techo'</pre>';\n\n\t\t\t\t\t//hhahahahahahahhahahahah borges\n\t\t\t\t}", "function prettyPrint($moves) {\n echo '<pre>',print_r($moves,1),'</pre>';\n\n}", "function makeCards() {\n\t\t\n\t\t$cards = explode(\" \", $this->me->get(\"cards\"));\n\t\t$i = 0;\n\t\t$rv = \"gamestate.cards = [];\";\n\t\t\n\t\tforeach ($cards as $value) {\n\t\t\t$name = getOneThing(\"name\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$description = getOneThing(\"description\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"] = new Object();\\n\";\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"].name = '\".$name.\"';\\ngamestate.cards[\".$i.\"].description = '\".$description.\"';\\n\";\n\t\t\t$i++;\n\t\t\t}\n\t\t\n\t\n\t\treturn $rv;\n\t\t\n\t\n\t}", "public function getSharps() {\n return $this->sharps;\n }", "function showDishes($output) {\n\tforeach ($output as $value) {\n\t\tfor ($i=0; $i < count($value); $i++) { \n\t\t\techo \"'\".$value[$i].\"' \";\n\t\t}\n\t\techo \"<br>\";\n\t}\n}", "public function hit(){\n array_push($this->hand,mt_rand(1,11));\n $this->score = array_sum($this->hand);\n }", "function handleResponse($data) {\n global $linebreak;\n foreach($data as $hand) {\n $player = new HandView($hand);\n echo $player->html().$linebreak;\n }\n}", "function drawCard (&$deck) {\n \n $suit = array_rand($deck);\n $card = array_rand($deck[$suit]);\n \n // Determine the face value of the card.\n\t// Face cards are worth 10\n\tif ($card >=10){\n $card_value = 10;\n }\n else {\n $card_value = $card;\n }\n \n $return_value = array('display' =>\n ($card < 10) ? $suit. \"0{$card}.jpg\" :\n \"$suit{$card}.jpg\", 'value' => $card_value);\n // returns a two element array showing a card's suit & face value\n \n unset($deck[$suit][$card]);\n \n return $return_value;\n // returns a two-element array showing a card's suit and face value\n }", "protected function dumpGameScheme(array $scheme)\n {\n foreach ($scheme as $row) {\n $rowString = '';\n foreach ($row as $box) {\n /** @var $box BoxInterface */\n if ($box->isMine()) {\n $value = 'X';\n } else {\n $value = $box->isOpen() ? $box->getValue() : '-';\n }\n $rowString .= $value.' ';\n }\n VarDumper::dump($rowString);\n }\n }", "function ch($spades, $hearts, $diamonds, $clubs) {\n return '<span class=\"handWrapper\">' .\n rh($spades, $hearts, $diamonds, $clubs) .\n '</span>';\n}", "public function eyes()\n {\n return $this->dummy->eyes();\n }", "protected function hp()\n {\n return [\n 'die' => $this->base()->hp_die,\n 'recomended' => $this->base()->hp,\n ];\n }", "function displayPlayer(){\n $player_cards = array_column($_SESSION['player'], 'display');\n\n foreach ($player_cards as $player_display){\n echo $player_display . \" \";\n }\n}", "public function GetOwedShirts()\n {\n $dbTalker = new DbTalker();\n return $dbTalker->GetOwedShirts();\n }", "public function hasHandstatus(){\n return $this->_has(7);\n }", "public function initializeCards()\n {\n\n for($i=0;$i<count($this->suits);$i++){\n for($j=0;$j<count($this->rank);$j++){\n $this->deckofCards[$i][$j] = $this->rank[$j].\" \".$this->suits[$i];\n }\n }\n return $this->deckofCards;\n }", "function GetHuntRewards () {\n return unserialize($this->hunt_rewards);\n }", "public function hasHands(){\n return $this->_has(31);\n }", "function getCardDeck () { \n\n $cards = array(1 => 'A', 2, 3, 4, 5, 6, 7, 8, 9, 10, 'J', 'Q', 'K');\n $deck = array( 'S' => $cards,\n 'H' => $cards,\n 'C' => $cards,\n 'D' => $cards);\n return $deck;\n}", "private function getJumps(& $deck){\n\t\t$cards=$deck->getCards();\n\t\t\n\t\t$straight=array();\t//array for straight , ace is copied as 1\n\t\t$doubles=array();\t//array for dublicates\n\t\t$lastCardVal=0;\n\t\t// generate counters\n\t\t\tforeach ($cards as $card){\n\t\t\t//echo $card->value.',';\n\t\t\t\tif ($lastCardVal==0){\n\t\t\t\t\t$lastCardVal=$card->value;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=1;\n\t\t\t\t\t$straight[]=$jump;\n\t\t\t\t\t$doubles[]=$jump;\n\t\t\t\t}else{\n\t\t\t\t\t$lastCardVal=$card->value - $lastCardVal;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=$lastCardVal;\n\t\t\t\t\t$lastCardVal=$card->value;\n\t\t\t\t\t$straight[]=$jump;\n\t\t\t\t\t$doubles[]=$jump;\n\t\t\t\t}\n\t\t\t\tunset($jump);\n\t\t\t\t// if ace , add to start of [straight]ers\n\t\t\t\tif ($card->value==14){\n\t\t\t\t\t$x=$straight[0]->card->value;\n\t\t\t\t\tif($x==14){$x=1;}\n\t\t\t\t\t$newJump=$x-1;\n\t\t\t\t\t$straight[0]->val=$newJump;\n\t\t\t\t\t\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=1;\n\t\t\t\t\tarray_unshift($straight,$jump);\n\t\t\t\t}\n\t\t\t}//end foreach\n\t\t\t\n\t\t\t$sCount=count($straight)-1;\n\t\t\t$new_straight=array();\n\t\t\t$lastNStraighter=0;\n\t\t// flip straights values (inverse the diffirence)\n\t\t\tfor ($i=$sCount ; $i>=0 ; $i--){\n\t\t\t\t$card=$straight[$i]->card;\n\t\t\t\t\n\t\t\t\tif ($lastNStraighter==0){\n\t\t\t\t\t$lastNStraighter=$card->value;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=1;\n\t\t\t\t\t$new_straight[]=$jump;\n\t\t\t\t}else{\n\t\t\t\t\t$lastNStraighter=$lastNStraighter - $card->value;\n\t\t\t\t\t$jump->card=$card;\n\t\t\t\t\t$jump->val=$lastNStraighter;\n\t\t\t\t\t$lastNStraighter=$card->value;\n\t\t\t\t\t$new_straight[]=$jump;\n\t\t\t\t}\n\t\t\t\tunset($jump);\n\t\t\t}//\n\t\t\t\n\t\t\tunset($straight);\n\t\t\t$straight = $new_straight;\n\t\t// get straights\n\t\t\t$sCount=count($straight);\n\t\t\t$straightCounters=array();\n\t\t\t$lastStraightCounter=0;\n\t\t\t//echo \"\\n\";\n\t\t\tfor ($i=0 ; $i<$sCount ; $i++){\n\t\t\t\t//echo $i.'-';\n\t\t\t\tif (!isset($straightCounters[$lastStraightCounter]->cards)){ // create cards array\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->cards=array();\n\t\t\t\t}//\n\t\t\t\tif ($straight[$i]->val==1){\t// if next card , add it and count it\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->count=$straightCounters[$lastStraightCounter]->count+1;\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->cards[]=$straight[$i]->card;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($straight[$i]->val==0 && $straightCounters[$lastStraightCounter]->count>0){\t// if same card , just add it to know the suites\n\t\t\t\t\t$straightCounters[$lastStraightCounter]->cards[]=$straight[$i]->card;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($straight[$i]->val>1 && $straightCounters[$lastStraightCounter]->count>0){\n\t\t\t\t\t$lastStraightCounter++;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t}//end for\n\t\t\t\n\t\t// get doubles (count how many zeros series)\n\t\t\t$dCount=count($doubles);\n\t\t\t$doubleCounters=array();\n\t\t\t$lastDblCounter=0;\n\t\t\tfor ($i=0 ; $i<$dCount ; $i++){\n\t\t\t\tif (!isset($doubleCounters[$lastDblCounter]->cards)){ // create cards array\n\t\t\t\t\t$doubleCounters[$lastDblCounter]->cards=array();\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($doubles[$i]->val==0){\t// if same card , add it and count it\n\t\t\t\t\t$doubleCounters[$lastDblCounter]->count=$doubleCounters[$lastDblCounter]->count+1;\n\t\t\t\t\t$doubleCounters[$lastDblCounter]->cards[]=$doubles[$i]->card;\n\t\t\t\t}//\n\t\t\t\t\n\t\t\t\tif ($doubles[$i]->val>0 && $doubleCounters[$lastDblCounter]->count>0){\t// if diffirent card , generate next counter\n\t\t\t\t\t$lastDblCounter++;\n\t\t\t\t}//\n\t\t\t}//end for\n\t\t\t\n\t\t\t\n\t\t$result->straights=$straightCounters;\n\t\t$result->doubles=$doubleCounters;\n\t\t\n\t\t//print_r($straight);\n\t\t//print_r($result);\n\t\t\n\t\treturn $result;\n\t}", "function computer_turn($json)\n{\n $json[$_SESSION['game']]['computer_points'] = count_points($json[$_SESSION['game']]['computer_cards']);\n while ($json[$_SESSION['game']]['computer_points'] < 17) {\n array_push($json[$_SESSION['game']]['computer_cards'], get_ran_card());\n $json[$_SESSION['game']]['computer_points'] = count_points($json[$_SESSION['game']]['computer_cards']);\n }\n\n $json[$_SESSION['game']]['action'] = \"restart\";\n save_json($json);\n echo get_results($json);\n}", "public function reset()\n {\n $this->values[self::_HEROES] = array();\n }", "function cards_values(array $hand):array {\n return array_map(function ($el) {return strval($el[0]);}, $hand);\n}", "protected function cards()\n {\n return [\n new Help,\n ];\n }", "function pr($array)\n{\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n}", "public function hasHair(){\n return $this->_has(14);\n }", "function deal() {\r\n for($i=0; $i<1; $i++) {\r\n global $deck;\r\n $card = array_pop($deck);\r\n return $card['value'] . ' of ' . $card['suit'] . '<br />';\r\n\r\n //create card values\r\n }\r\n}", "function createPlayers()\n {\n createDeck();\n \n $points = 0;\n $name = \"\";\n $hand = array();\n \n $players = array();\n \n for ($i = 0; $i < 4; $i++)\n {\n switch ($i)\n {\n case 0:\n $name = \"Cody\";\n array_push($players, $name, $points, $hand);\n break;\n case 1:\n $name = \"Kara\";\n array_push($players, $name, $point, $hand);\n break;\n case 2:\n $name = \"Fernando\";\n array_push($players, $name, $point, $hand);\n break;\n case 3:\n $name = \"Dani\";\n array_push($players, $name, $point, $hand);\n break;\n default:\n break;\n }\n }\n \n var_dump($players);\n }", "function debug ($what){\r\n echo '<pre>';\r\n if (is_array($what)) {\r\n\t\tprint_r ($what);\r\n }else{\r\n var_dump ($what);\r\n }\r\n echo '</pre>';\r\n}", "public function display()\n\t{\n\t\tprint_r(\"<br/>RedheadDuck looks like this!<br/>\");\n\t}", "public function reset()\n {\n $this->values[self::_HEROS] = array();\n }", "public function hasMaxHand(){\n return $this->_has(8);\n }", "function playerHit($name, $deck, $player, $dealer, $bet, $insuranceBet, $bankroll){\n\t$newCard = drawACard($deck);\n\t$player[] = $newCard;\n\t$total = getTotal($player);\n\t//echo out each card and total\n\tforeach ($player as $card) {\n\t\techo '[' . $card['card'] . ' ' . $card['suit'] . '] ';\n\t}\n\techo $name . ' total = ' . $total . PHP_EOL;\n\t//notify when player busts\n\tif (getTotal($player) > 21) {\n\t\tevaluateHands($name, $player, $dealer, $bet, $insuranceBet, $bankroll);\n\t}\n\treturn $player;\n}", "function pp( $a ){\n echo \"<pre>\";\n print_r( $a );\n echo \"</pre>\";\n }", "static function printr($array)\n {\n echo '<pre>' . print_r($array, true) . '</pre>';\n }", "public function setCardHand(Deck $deck) {\n\t\t$this->cardHand = $deck;\n\t}", "public function getEyes()\n {\n return $this->eyes;\n }", "function print_array($array) {\n\n echo \"<pre>\";\n\n print_r($array);\n\n echo \"</pre>\";\n\n }", "function pre($data){\r\n echo \"<pre>\";\r\n print_r($data);\r\n echo \"</pre>\";\r\n return FALSE;\r\n}", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "public function getCards()\n {\n return $this->cards;\n }", "function _pre($array) { echo '<pre>'; print_r ($array); echo '</pre>'; }", "function four_of_a_kind(array $hand) {\n $values = cards_values($hand);\n\n $four = false;\n\n foreach(array_count_values($values) as $val => $c)\n if($c === 4) $four = strval($val);\n\n if ($four === false) return false;\n\n return ['value' => $four, 'remaining' => remove_values($hand, $four)];\n}", "function setHandbook(array $handbooks): void\n {\n }", "function hallo_spaceboy() {\n\t$chosen = hallo_spaceboy_get_lyric();\n\techo \"<p id='spaceboy'>$chosen</p>\";\n}", "function print_pre($array){\n\t\techo '<pre>';\n\t\tprint_r($array);\n\t\techo '</pre>';\n\t}", "public static function awards()\n {\n return [\n self::SCORE_GOLD,\n self::SCORE_SILVER,\n self::SCORE_BRONZE,\n self::SCORE_FORTH,\n self::SCORE_FIFTH\n ];\n }", "public function __construct($hand_pairs_of_game)\n {\n $this->_hand_pairs_of_game = $hand_pairs_of_game;\n }", "function drawCard(&$hand, &$deck, $drawNumber) {\n\t$card1 = array_rand($deck);\n\t$hand[] = $deck[$card1];\n\tif($drawNumber == 2) {\n\t\t$card2 = array_rand($deck);\n\t\t$hand[] = $deck[$card2];\n\t\tunset($deck[$card2]);\n\t}\n\tunset($deck[$card1]);\n}", "function dump($array) {\n\treturn \"<pre>\" . htmlentities(print_r($array, 1)) . \"</pre>\";\n}", "function createDeck()\n {\n // suit, bool, val\n // 4 arrays\n $suit = \"\";\n $drawn = FALSE;\n \n $deck = array();\n \n for ($i = 0; $i < 4; $i++)\n { // suit type\n switch($i) \n {\n case 0:\n $suit = \"heart\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n case 1:\n $suit = \"diamond\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n case 2:\n $suit = \"spade\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n case 3:\n $suit = \"clover\";\n for ($j = 0; $j < 12; $j++)\n {\n $card = array($suit, $j + 1, $drawn);\n array_push($deck, $card); \n }\n break;\n default:\n break;\n }\n }\n \n // checks what the array is\n var_dump($deck);\n }", "function printArray($array){\n echo \"<pre>\";\n print_r($array);\n echo \"</pre>\";\n }", "public static function mntList()\n{\nreturn array_keys(self::$phk_tab);\n}", "public function run()\n {\n $hero = [\n ['realName'=>'Clack Kent', 'heroName'=>'Superman', 'power'=>'Bisa Terbang', 'kindofPower'=>'Bisa Terbang','gender'=>'Laki-laki', 'height'=>'160', 'weight'=>'60', 'bornDate'=>'1998-12-06'],\n ['realName'=>'Doktor Steven Vincen Strange', 'heroName'=>'Doktor Strange', 'power'=>'Ilmu Sihir', 'kindofPower'=>'Ilmu Sihir','gender'=>'Laki-Laki', 'height'=>'165', 'weight'=>'65', 'bornDate' =>'1889-11-12'],\n ['realName'=>'Thor', 'heroName'=>'Thor', 'power'=>'Odinforce', 'kindofPower'=>'Odinforce','gender'=>'Laki-Laki', 'height'=>'150', 'weight'=>'50', 'bornDate' =>'1990-06-25'],\n ['realName'=>'Carol Danvers', 'heroName'=>'Capten Marvel', 'power'=>'Fisik Yang Kuat', 'kindofPower'=>'Fisik Yang Kuat','gender'=>'Laki-laki', 'height'=>'170', 'weight'=>'68', 'bornDate'=>'1988-11-04'],\n ['realName'=>'Toni Stark', 'heroName'=>'War machine', 'power'=>'Laser', 'kindofPower'=>'Laser','gender'=>'Laki-Laki', 'height'=>'168', 'weight'=>'55', 'bornDate' =>'1996-01-27'],\n ['realName'=>'Sam Wilson', 'heroName'=>'Captain Amera', 'power'=>'Tameng Yang Kuat', 'kindofPower'=>'Tameng Yang Kuat','gender'=>'Laki-Laki', 'height'=>'150', 'weight'=>'78', 'bornDate' =>'1897-04-30'],\n ['realName'=>'Bruce Banner', 'heroName'=>'Hulk', 'power'=>'Kuat', 'kindofPower'=>'Kuat','gender'=>'Laki-Laki', 'height'=>'165', 'weight'=>'57', 'bornDate'=>'1886-12-29'],\n ['realName'=>'Bruce Wayne', 'heroName'=>'Batman', 'power'=>'Mempunyai akal canggih', 'kindofPower'=>'Mempunyai akal canggih','gender'=>'Laki-Laki', 'height'=>'177', 'weight'=>'70', 'bornDate' =>'1995-10-01'],\n ['realName'=>'Don Heck', 'heroName'=>'Ironman', 'power'=>'Armot', 'kindofPower'=>'Armor','gender'=>'Laki-Laki', 'height'=>'155', 'weight'=>'75', 'bornDate' =>'1890-02-20'],\n ['realName'=>'Pitter Parker', 'heroName'=>'Spiderman', 'power'=>'Kecepatan', 'kindofPower'=>'Kecepatan','gender'=>'Laki-Laki', 'height'=>'155', 'weight'=>'75', 'bornDate' =>'1890-02-20'],\n ];\n DB::table('hero')->insert($hero);\n }", "public function getCardHiddenStand() {\n\t\treturn $this->cardHiddenStand;\n\t}", "public function getHandName($playerHand){\n $result = 'Scissor';\n\n if($playerHand == 1){\n $result = 'Rock';\n }elseif($playerHand == 2) {\n $result = 'Paper';\n }\n return $result;\n\n}", "public function getVariableHarmonizationsList() {\n return $this->_get(4);\n }", "function drawACard(&$deck) {\n\t$randomKey = array_rand($deck);\n\t$randomCard = $deck[$randomKey];\n\tunset($deck[$randomKey]);\n\treturn $randomCard;\n}", "function showHeaquarters() \r\n\t{\r\n\t\t$valuesHeadquarters = $this->Headquarter->find('all', array('order' => 'Headquarter.headquarter_name ASC'));\r\n\t\t$x=0;\r\n\t\tforeach ($valuesHeadquarters as $value)\r\n\t\t{\r\n\t\t\tif($x==0)\r\n\t\t\t\t$resultadoHeadquarters[0] = 'Seleccione una jefatura';\r\n\t\t\telse\r\n\t\t\t\t$resultadoHeadquarters[$value['Headquarter']['id']]= $value['Headquarter']['headquarter_name'];\r\n\t\t\t\t\r\n\t\t\t$x++;\r\n\t\t}\r\n\t\t\r\n\t\treturn $resultadoHeadquarters;\r\n\t}" ]
[ "0.7346324", "0.6978806", "0.6794774", "0.63933057", "0.63307226", "0.6094427", "0.6092971", "0.60794055", "0.5890431", "0.5885085", "0.58527577", "0.5824898", "0.5730695", "0.5697511", "0.5629474", "0.5622418", "0.55275327", "0.5507061", "0.54699624", "0.545067", "0.5410966", "0.5304933", "0.5300272", "0.5213915", "0.5179647", "0.5161308", "0.514164", "0.51201594", "0.5068831", "0.50557977", "0.5050009", "0.5028862", "0.50279933", "0.5004203", "0.4982908", "0.49192464", "0.49175236", "0.4904891", "0.49045187", "0.48976398", "0.48953742", "0.4887936", "0.48775828", "0.48629928", "0.4852411", "0.48483884", "0.48329192", "0.48160765", "0.4815403", "0.48005998", "0.4787431", "0.47780308", "0.47761443", "0.47738206", "0.47729516", "0.4745106", "0.474152", "0.47395077", "0.473697", "0.47121632", "0.46997258", "0.4690786", "0.4684015", "0.46748412", "0.465625", "0.46526664", "0.46373454", "0.4633405", "0.46295673", "0.462804", "0.46125543", "0.4606474", "0.45975047", "0.45970365", "0.45914418", "0.45851955", "0.4577989", "0.4567347", "0.4560537", "0.45571232", "0.45571232", "0.45571232", "0.4550666", "0.45355916", "0.45348752", "0.45344532", "0.45315668", "0.45292687", "0.4526725", "0.4517905", "0.4516872", "0.45148852", "0.45084238", "0.4505914", "0.45044398", "0.4499323", "0.44942766", "0.44873145", "0.44849446", "0.44843015" ]
0.6249308
5
Create the Form definition.
public function buildForm(FormBuilderInterface $builder, array $options) { parent::buildForm($builder, $options); $builder ->add('leftHanded', CheckboxType::class) ->add('headstock', TextType::class) ->add('body', TextType::class) ->add('amplification', TextType::class) ->add('strings', IntegerType::class) ->add('frets', IntegerType::class) ->add('tuning') ; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "public function createForm();", "public function createForm();", "abstract public function createForm();", "abstract public function createForm();", "public function createForm()\n {\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Resources);\n\n $form->text('name', '名称')->rules('required',['required' => '请输入 配置项的名称']);\n\n $form->radio('type', '类型')->options(Resources::TYPE);\n\n $form->cropper('url','图片');\n\n $form->number('sort_num','排序');\n\n $form->textarea('memo','备注');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "private function createFormDefinition()\n {\n $id = $this->getServiceId('form_type');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('form'));\n $definition\n ->setArguments([$this->options['entity']])\n ->addTag('form.type', [\n 'alias' => sprintf('%s_%s', $this->prefix, $this->resourceName)]\n )\n ;\n $this->container->setDefinition($id, $definition);\n }\n }", "protected function form()\n {\n $form = new Form(new Direction());\n\n $form->text('name', __(trans('hhx.name')));\n $form->text('intro', __(trans('hhx.intro')));\n $form->image('Img', __(trans('hhx.img')))->move('daily/direction')->uniqueName();\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.status'));;\n $form->number('order_num', __(trans('hhx.order_num')));\n $form->hidden('all_num', __(trans('hhx.all_num')))->default(0.00);\n $form->decimal('stock', __(trans('hhx.stock')));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n \n $form->display('id', 'ID');\n $form->select('company_id', '公司名称')->options(Company::getSelectOptions());\n $form->text('project_name', '项目名称');\n $form->image('project_photo', '项目图片')->uniqueName()->move('public/photo/images/custom_thum/');\n $form->url('link_url', '项目链接');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1'=> '保密'])->default('0');\n //$form->display('created_at', 'Created At');\n //$form->display('updated_at', 'Updated At');\n\n return $form;\n }", "public function buildForm()\n {\n }", "protected function form()\n {\n $form = new Form(new CompanyCulture());\n\n $form->text('name', '企业名称')->rules('required');\n $form->text('en_name', '企业名称(en)')->rules('required');\n $form->image('image_url', '图片')->rules('required|image');\n $form->editor('content', '内容')->rules('required');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`列表`按钮\n $tools->disableList();\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "protected function buildForm()\n {\n $this->form = Yii::createObject(array_merge([\n 'scenario' => $this->scenario,\n 'parent_id' => $this->parent_id,\n 'parentTariff' => $this->parentTariff,\n 'tariff' => $this->tariff,\n ], $this->getFormOptions()));\n }", "public function buildForm()\n {\n $this\n ->add(\n 'new_organization_group',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\OrganizationGroupInformation',\n 'label' => false,\n ]\n ]\n )\n ->add(\n 'group_admin_information',\n 'collection',\n [\n 'type' => 'form',\n 'options' => [\n 'class' => 'App\\SuperAdmin\\Forms\\GroupAdmin',\n 'label' => false,\n ]\n ]\n )\n ->addSaveButton();\n }", "protected function form()\n {\n $this->opt();\n $form = new Form(new ComDep);\n\n $form->text('alias', 'Alias');\n $form->text('name', 'Name');\n $form->select('company_id', 'Company')->options($this->optcom);\n $form->select('id_com_dep_admin', 'Company department admin')->options($this->optcomdep);\n $form->select('service_type_id', 'Service type')->options($this->optsertype);\n $form->textarea('info', 'Info');\n $form->textarea('info_for_vp_admin', 'Info for vp admin');\n $form->text('address', 'Address');\n $form->textarea('info_station', 'Info station');\n $form->text('telephone', 'Telephone');\n $form->text('e_mail', 'E mail');\n $form->text('class', 'Class');$form->saving(function (Form $form) {\n $form->model()->id_admin_add=Admin::user()->id;\n });\n\n return $form;\n }", "public function CreateForm();", "protected function form()\n {\n $form = new Form(new Cate());\n\n $form->text('name', __('Name'));\n $form->url('link', __('Link'));\n $form->text('thumb', __('Thumb'));\n $form->switch('status', __('Status'));\n $form->number('sort', __('Sort'));\n $form->datetime('createtime', __('Createtime'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "public function xadmin_createform() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$form_title = $args [1];\n\t\t$form_type = @$args [2] ? $args [2] : 'blank';\n\t\t\n\t\t/* Load Model */\n\t\t$form = $this->getModel ( 'form' );\n\t\t$this->session->returnto ( 'forms' );\n\t\t\n\t\t/* create the form */\n\t\t$form->createNewForm ( $form_title, $form_type );\n\t\t\n\t\t$this->loadPluginModel ( 'forms' );\n\t\t$plug = Plugins_Forms::getInstance ();\n\t\t\n\t\t$plug->_pluginList [$form_type]->onAfterCreateForm ( $form );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( 'xforms' );\n\t\n\t}", "protected function form()\n {\n $form = new Form(new SpecificationTemplate());\n\n $form->text('name', __('Name'));\n $form->keyValues('content', __('Content'));\n $form->number('sort', __('Sort'))->default(0);\n $form->switch('is_display', __('Is display'))->default(1);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Cases);\n\n $form->select('cate_id', '分类')->options('/admin/api/getcasecate');\n $form->select('algw_id', '顾问')->options('/admin/api/getgw');\n $form->text('title', '标题');\n $form->text('keywords', 'SEO关键字');\n $form->text('description', 'SEO描述');\n $form->text('desc', '副标题');\n $form->text('author', '来源');\n $form->radio('is_tj', '推荐')->options([0=>'否',1=>'是']);\n $form->image('thumb', '缩略图')->uniqueName();\n $form->editor('data', '详情');\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity);\n\n $form->text('log_name', 'Log name');\n $form->textarea('description', 'Description');\n $form->number('subject_id', 'Subject id');\n $form->text('subject_type', 'Subject type');\n $form->number('causer_id', 'Causer id');\n $form->text('causer_type', 'Causer type');\n $form->text('properties', 'Properties');\n\n return $form;\n }", "public function create() {\r\n\t\r\n\t$form = new Form();\r\n\t$form->setTranslator($this->translator);\r\n\treturn $form;\r\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('log_name', __('Log name'));\n $form->text('description', __('Description'));\n $form->number('subject_id', __('Subject id'));\n $form->text('subject_type', __('Subject type'));\n $form->number('causer_id', __('Causer id'));\n $form->text('causer_type', __('Causer type'));\n $form->textarea('properties', __('Properties'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Purchase());\n if ($form->isCreating()) {\n $form->select('consumer_id', \"客户\")->options(Consumer::all()->pluck('full_name', 'id'))->required();\n $form->select('house_id', \"购买房源\")->options(House::purchasable()->pluck('readable_name', 'id'))->required();\n }\n $form->datetime('started_at', \"生效日期\");\n $form->datetime('ended_at', \"结束日期\");\n $form->select('sell_type', \"出售方式\")->options(Purchase::$type)->required();\n $form->currency('price', \"成交价格\")->symbol('¥')->required();\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Site);\n\n $form->select('category_id', '分类')->options(SiteCategory::selectOptions(null, ''))->rules('required');\n $form->text('title', '标题')->attribute('autocomplete', 'off')->rules('required|max:50');\n $form->image('thumb', '图标')->resize(120, 120)->uniqueName();\n $form->text('describe', '描述')->attribute('autocomplete', 'off')->rules('required|max:300');\n $form->url('url', '地址')->attribute('autocomplete', 'off')->rules('required|max:250');\n $this->disableFormFooter($form);\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Terrace());\n\n $form->image('image', __('平台图片'))->rules('required', ['required' => '平台图片不能为空']);\n $form->text('name', __('平台名称'))->rules('required', ['required' => '平台名称不能为空']);\n $form->text('path', __('外链'))->rules('required', ['required' => '平台外链不能为空']);\n $form->text('notice_info', __('提示语'))->rules('required', ['required' => '平台提示语不能为空']);\n $form->radio('status','状态')->options(['1' => '未推荐', '2'=> '已推荐'])->default(1);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new News);\n\n $form->text('title', '题目');\n // $form->number('category_id', '分类');\n $form->select('category_id','分类')->options('/api/admin_categories');\n // $form->textarea('content', 'Content');\n $form->ueditor('content','新闻内容')->rules('required');\n // $form->text('thumbnail', '封面图');\n $form->image('thumbnail', '封面图')->move('public/uploads/thunbnails');\n $form->number('status', '状态');\n $form->number('read_count', '阅读次数');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Task);\n\n $form->text('eid', 'Eid');\n $form->text('store', 'Store');\n $form->text('etype', 'Etype');\n $form->text('uid', 'Uid');\n $form->text('uname', 'Uname');\n $form->text('qq', 'Qq');\n $form->number('qtype', 'Qtype');\n $form->number('times', 'Times')->default(1);\n $form->textarea('content', 'Content');\n $form->text('deadline', 'Deadline');\n $form->file('file', 'File');\n $form->number('isok', 'Isok');\n $form->number('istag', 'Istag');\n $form->text('sid', 'Sid');\n $form->text('sname', 'Sname');\n $form->text('score', 'Score');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Dictionary());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n\n $form->select('type', __('Type'))->options(Dictionary::TYPES);\n $form->text('option', __('Title'))->required();\n $form->text('slug', __('Slug'))->rules('nullable|regex:/(\\w\\d\\_)*/', [\n 'regex' => 'Только латинские буквы и знаки подчеркивания',\n ]);\n $form->text('alternative', __('Alternative'));\n $form->switch('approved', __('Approved'))->default(1);\n $form->number('sort', __('Sort'));\n\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Information);\n \n \n\n $form->text('name', __('项目名称'))->autofocus()->placeholder('例:上汽大众新能源汽车工厂项目')->required();\n $form->text('industry', __('行业类别'))->required();\n $form->currency('investment', __('投资金额'))->icon('fa-usd')->required(); \n $form->text('cont_name', __('资方联系人'))->placeholder('选填内容,可为空');\n $form->text('cont_phone', __('资方联系方式'))->placeholder('选填内容,可为空');\n $form->text('staff_name', __('工作人员姓名'));\n $form->text('staff_phone', __('工作人员电话'));\n $form->hidden('adminuser_id', __('adminuser_id'))->value(Admin::user()->id);\n $form->textarea('content', __('项目情况'))->required()->placeholder('请填写项目介绍(包括项目投资额度、产业类别等)、项目需求(如土地、排放、能耗等)、谈判进度等......');\n\n\n\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n $form->setAction('../admin/myinfo');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new MachinesStyle());\n\n $form->text('style_name', __('型号名称'));\n\n $form->select('aa', __('所属类型'))->options(MachinesType::where('state', '1')->get()->pluck('name', 'id'))->load('factory_id', '/api/getAdminFactory');\n\n $form->select('factory_id', __('所属厂商'))->required();\n\n $form->ignore(['aa']);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Posts);\n\n $form->text('title', 'Title');\n $form->text('content', 'Content');\n $form->text('video_url', 'Video url');\n $form->switch('status', '审核状态')->states( [ \n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'primary'],\n 'on' => ['value' => 1, 'text' => '通过', 'color' => 'default']\n ]);\n $form->number('content_type', 'Content type');\n $form->number('member_id', 'Member id');\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Platform());\n\n $form->text('platform_number', __('Platform number'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n $form->text('platform_name', __('Platform name'))\n ->creationRules(['required', 'max:30', 'unique:platforms'])\n ->updateRules(['required', 'max:30']);\n\n $form->footer(function ($footer){\n $footer->disableEditingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Engine());\n\n $form->text('name', __('Name'))\n ->required();\n $form->select('power_station_id', __('Power station'))\n ->options(PowerStation::all()->pluck('name', 'id'))\n ->required();\n $form->image('photo', __('Photo'));\n $form->textarea('details', __('Details'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member);\n\n $form->text('open_id', 'Open id');\n $form->text('wx_open_id', 'Wx open id');\n $form->text('access_token', 'Access token');\n $form->number('expires', 'Expires');\n $form->text('refresh_token', 'Refresh token');\n $form->text('unionid', 'Unionid');\n $form->text('nickname', 'Nickname');\n $form->switch('subscribe', 'Subscribe');\n $form->switch('sex', 'Sex');\n $form->text('headimgurl', 'Headimgurl');\n $form->switch('disablle', 'Disablle');\n $form->number('time', 'Time');\n $form->mobile('phone', 'Phone');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Sections());\n\n $form->text('name', __('Nazwa'));\n $form->text('pageId', __('ID sekcji (w sensie HTML)'));\n $form->textarea('content', __('Zawartość'));\n $form->textarea('style', __('Style(CSS'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new NewEnergy());\n\n $form->number('user_id', __('User id'));\n $form->text('car_id', __('车辆ID'));\n $form->image('start_mileage', __('开始'));\n $form->image('end_mileage', __('介绍'));\n $form->decimal('mileage', __('里程 / 时间'));\n $form->select('type', __('类型'))->options([\n \"1\" => \"电动车\",\n \"2\" => \"燃油车\",\n ]);\n $form->select('status', __('状态'))->options([\n \"1\" => \"审核中\",\n \"10\" => \"审核拒绝\",\n \"20\" => \"审核撤销\",\n \"30\" => \"审核通过\"\n ]);\n $form->text('remark', __('Remark'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Procurement);\n\n $form->number('u_id', 'U id');\n $form->number('brand', 'Brand');\n $form->number('type', 'Type');\n $form->number('models', 'Models');\n $form->number('material', 'Material');\n $form->decimal('area', 'Area');\n $form->radio('status', '审核')->options(['0' => '待审核', '1'=> '通过','2'=>'未通过'])->default('0');\n $form->number('room_city', 'Room city');\n $form->text('address', 'Address');\n $form->number('brick_time', 'Brick time')->default(1);\n $form->text('images', 'Images');\n $form->number('ctime', 'Ctime');\n $form->number('utime', 'Utime');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BuSong);\n\n// $form->number('serialid', __('Serialid'));\n $form->text('svrkey', __('svrkey'));\n $form->text('songname', __('歌名'));\n $form->text('singer', __('歌星'));\n $form->select('langtype', __('语种'))->options([0=>'国语',1=>'粤语',2=>'英语',3=>'台语',4=>'日语',5=>'韩语',6=>'不详']);\n $form->text('remarks', __('备注'));\n $form->datetime('createdate', __('创建时间'))->default(date('Y-m-d H:i:s'));\n $form->select('ischeck', __('是否检查'))->options([0=>'否',1=>'是']);\n $form->select('buState', __('状态'))->options([0=>'新增',1=>'处理中',2=>'完成',3=>'歌曲信息出错',4=>'取消无法处理',5=>'已上传',6=>'彻底删除']);\n $form->text('musicdbpk', __('musicdbpk'));\n $form->text('optionRemarks', __('操作日志'));\n\n return $form;\n }", "function buildForm(){\n\t\t# menampilkan form\n\t}", "protected function form()\n {\n $form = new Form(new SiteHelp);\n\n $form->select('site_help_category_id', __('site-help::help.site_help_category_id'))\n ->options(SiteHelpCategory::pluck('name', 'id'));\n $form->text('title', __('site-help::help.title'));\n $form->number('useful', __('site-help::help.useful'))->default(0);\n $form->textarea('desc', __('site-help::help.desc'));\n $form->image('thumbnail', __('site-help::help.thumbnail'))\n ->removable()\n ->uniqueName()\n ->move('site-help');\n $form->UEditor('content', __('site-help::help.content'));\n $form->select('status', __('site-help::help.status.label'))\n ->default(1)\n ->options(__('site-help::help.status.value'));\n\n return $form;\n }", "public function buildForm()\n {\n $this\n ->addMeasureList()\n ->addAscendingList()\n ->addTitles(['class' => 'indicator_title_title_narrative', 'narrative_true' => true])\n ->addDescriptions(['class' => 'indicator_description_title_narrative'])\n ->addCollection('reference', 'Activity\\Reference', 'reference', [], trans('elementForm.reference'))\n ->addAddMoreButton('add_reference', 'reference')\n ->addBaselines()\n ->addPeriods()\n ->addAddMoreButton('add_period', 'period')\n ->addRemoveThisButton('remove_indicator');\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function createForm() {\n module_load_include('inc', 'islandora_form_builder', 'FormGenerator');\n $form_values = &$this->formState['values'];\n $file = isset($form_values['ingest-file-location']) ? $form_values['ingest-file-location'] : '';\n $form['#attributes']['enctype'] = 'multipart/form-data';\n $form['indicator']['ingest-file-location'] = array(\n '#type' => 'file',\n '#title' => t('Upload Document'),\n '#size' => 48,\n '#description' => t('Select file to be added the the object.'),\n );\n $form_generator = FormGenerator::CreateFromModel($this->contentModelPid, $this->contentModelDsid);\n $form[FORM_ROOT] = $form_generator->generate($this->formName); // TODO get from user .\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Ingest'),\n '#prefix' => t('Please be patient. Once you click next there may be a number of files created. ' .\n 'Depending on your content model this could take a few minutes to process.<br />')\n );\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Project());\n $form->text('name', '项目名称')->rules('required')->required();\n $form->url('url', '项目地址')->rules('required')->required();\n $form->text('username', '账号');\n $form->text('password', '密码');\n $status = [\n 'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],\n 'off' => ['value' => 2, 'text' => '禁用', 'color' => 'danger'],\n ];\n $form->switch('status', '状态')->states($status)->default(1);\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new ThemePoster());\n\n $form->select('domain_id', __('domain_id'))->options(DomainConfig::getDomainMap())->rules('required');\n $form->radio('type', __('type'))->options(ThemePoster::getTypeMap())->when(1, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Product::getCategoryMap()->toArray()))->rules('required');\n\n })->when(2, function (Form $form){\n $form->select('type_id', __('type_id'))->options(array_merge(['0' => '总列表'], Article::getCategoryMap()))->rules('required');\n\n });\n $form->text('title', __('title'))->rules('required');\n $form->text('alt', __('alt'))->rules('required');\n $form->image('site', '图片尺寸 1600*300')\n ->uniqueName()\n ->rules('required|max:150')->resize(1600, 300);\n $form->url('link', __('link'));\n $form->switch('is_show', __('is_show'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BackPeopleInfo());\n\n $form->text('name', __('姓名'));\n $form->text('id_num', __('身份证号码'));\n $form->mobile('phone', __('手机号码'));\n $form->text('address', __('楼栋房号'));\n $form->text('originatin', __('始发地'));\n $form->date('back_date', __('返回日期'))->default(date('Y-m-d'));\n $form->date('isolate_date', __('隔离日期'))->default(date('Y-m-d'));\n $form->text('isolate_flag', __('解除隔离'))->default('否');\n $form->text('isolate_level', __('隔离等级'))->default('普通');\n $form->text('qrcode_flag', __('网格化管理'))->default('否');\n $form->text('vehicle_info', __('交通工具'));\n $form->text('remarks', __('备注'));\n\n return $form;\n }", "private function createForm()\n\t{\n\t\t$builder = $this->getService('form')->create();\n\t\t$builder->setValidatorService($this->getService('validator'));\n\t\t$builder->setFormatter(new BasicFormFormatter());\n\t\t$builder->setDesigner(new DoctrineDesigner($this->getDoctrine(), 'Entity\\User',array('location')));\n\n\t\t$builder->getField('location')->setRequired(true);\n\t\t$builder->submit($this->getRequest());\n\n\t\treturn $builder;\n\t}", "protected function form()\n {\n $form = new Form(new Good);\n $form->text('name', __('名称'))->rules('required');\n $form->decimal('amount', __('价格'))->default(0.00)->rules('required');\n $form->text('unit', __('单位'))->rules('required');\n $form->image('list_img', __('缩略图(320*320)'))->creationRules('required');\n $form->hasMany('goodsimgs', __('轮播图(640*640)'),function(Form\\NestedForm $form){\n $form->image('img',__('轮播图'))->creationRules('required');\n });\n $form->kindeditor('describe', __('描述'));\n // 去掉`查看`checkbox\n $form->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $form->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $form->disableCreatingCheck();\n return $form;\n }", "protected function form()\n {\n $form = new Form(new FinancialPrizeModel);\n\n $form->display('id', 'ID');\n $form->select('user_id', '用户名')->options(UserModel::getAllUsersPluck())->rules('required');\n $form->select('type', '类型')->options(FinancialPrizeModel::getCommonPluck())->rules('required');\n $form->month('date', '所属月份')->format('YYYY-MM')->rules('required');\n $form->number('money', '金额');\n $form->text('mark', '简要说明')->help('奖项具体名称等,最多输入100字');\n $form->hidden('year', 'year');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->saving(function (Form $f) {\n $f->year = substr($f->date, 0, 4);\n $f->date = $f->date . '-01';\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Blog());\n\n $form->text('title', __('Title'));\n $form->text('sub_title', __('Sub title'));\n $form->text('tag', __('Tag'));\n $form->textarea('body', __('Body'));\n $form->text('posted_by', __('Posted by'));\n $form->datetime('posted_at', __('Posted at'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', 'No');\n $form->number('user_id', 'User id');\n $form->textarea('address', 'Address');\n $form->decimal('total_amount', 'Total amount');\n $form->textarea('remark', 'Remark');\n $form->datetime('paid_at', 'Paid at')->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', 'Payment method');\n $form->text('payment_no', 'Payment no');\n $form->text('refund_status', 'Refund status')->default('pending');\n $form->text('refund_no', 'Refund no');\n $form->switch('closed', 'Closed');\n $form->switch('reviewed', 'Reviewed');\n $form->text('ship_status', 'Ship status')->default('pending');\n $form->textarea('ship_data', 'Ship data');\n $form->textarea('extra', 'Extra');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Article);\n\n $form->text('title', '标题')->rules('required', ['标题不可为空']);\n $form->cropper('cover', '封面')->uniqueName();\n $form->multipleImage('covers', '多封面')->help('可选');\n $form->select('category_id', '类型')->options(ArticleCategory::all()->pluck('title', 'id'));\n $form->number('read_count', '阅读数');\n $form->number('share_count', '分享数');\n $form->number('like_count', '喜欢数');\n $form->switch('cover_state', '是否显示多图封面');\n $form->datetime('show_at', '显示时间')->default(now());\n $form->textarea('desc', '描述');\n $form->UEditor('detail', '文章详情');\n\n $form->saving(function (Form $form) {\n $form->detail = str_replace('crossorigin=\"anonymous\"', '', $form->detail);\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CompanyPortfolio);\n $form->text('title_ar', 'اسم العمل عربي')->rules('required');\n $form->text('title_en', 'اسم العمل انجليزي')->rules('required');\n $form->text('description_ar', 'وصف الشركة عربي')->rules('required');\n $form->text('description_en', 'وصف الشركة انجليزي')->rules('required');\n $form->select('company_id', 'الشركة')->options(Company::pluck('title_ar', 'id')->all())->rules('required');\n $form->multipleImage('images', 'الصور')->removable()->rules('required');\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->mobile('phone', __('手机号'));\n $form->text('uname', __('姓名'));\n $form->text('wechat', __('微信号'));\n $form->text('phonenumber', __('联系电话'));\n $form->text('position', __('岗位'));\n $form->text('company', __('公司'));\n $form->switch('role', __('角色'));\n $form->switch('state', __('核实状态'));\n $form->datetime('create_date', __('创建时间'))->default(date('Y-m-d H:i:s'));\n // $form->text('openid', __('Openid'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goodss);\n $form->switch('is_enable','状态')->options([\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'primary'],\n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'default'],\n ]);\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n //$footer->disableReset();\n\n // 去掉`提交`按钮\n //$footer->disableSubmit();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n $Adv=new Adv();\n $form = new Form($Adv);\n $platform= $Adv->platform;\n $type= $Adv->type;\n $status= $Adv->status;\n $list_array=[\n array(\"field\"=>\"title\",\"title\"=>\"标题\",\"type\"=>\"text\"),\n array(\"field\"=>\"platform\",\"title\"=>\"平台\",\"type\"=>\"select\",\"array\"=>$platform),\n array(\"field\"=>\"type\",\"title\"=>\"类型\",\"type\"=>\"select\",\"array\"=>$type),\n array(\"field\"=>\"image\",\"title\"=>\"图片\",\"type\"=>\"image\"),\n array(\"field\"=>[\"start_time\",\"end_time\"],\"title\"=>\"活动时间\",\"type\"=>\"datetimeRange\"),\n array(\"field\"=>\"font1\",\"title\"=>\"字段1\",\"type\"=>\"text\"),\n array(\"field\"=>\"font2\",\"title\"=>\"字段2\",\"type\"=>\"text\"),\n array(\"field\"=>\"font3\",\"title\"=>\"字段3\",\"type\"=>\"text\"),\n array(\"field\"=>\"font4\",\"title\"=>\"字段4\",\"type\"=>\"text\"),\n array(\"field\"=>\"font5\",\"title\"=>\"字段5\",\"type\"=>\"text\"),\n array(\"field\"=>\"status\",\"title\"=>\"状态\",\"type\"=>\"switch\",\"array\"=>$status),\n array(\"field\"=>\"created_at\",\"title\"=>\"创建时间\",\"type\"=>\"value\")\n ];\n BaseControllers::set_form($form,$list_array);\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Specialization);\n\n $form->text('full_name', 'Полное найменование')->rules('required|max:255');\n $form->text('short_name', 'Краткое найменование')->rules('required|max:255');\n $form->text('code', 'Код специальности')->rules('nullable|max:100');\n $form->select('cathedra_id', 'Кафедра')->options(Cathedra::all()->pluck('name', 'id'))\n ->rules('required|numeric|exists:cathedras,id');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Boarding()); \n \n $form->select('pet_id',__('Pet Name'))->options(Pet::all()->pluck('name','id'))->rules('required');\n $form->select('reservation_id',__('Reservation'))->options(Reservation::all()->pluck('date','id'))->rules('required');\n $form->select('cage_id',__('Available Cages'))->options(Cage::get()->where(\"availability\",\"Available\")->pluck('id','id'))->rules('required');\n $form->datetime('end_date', __('End date'))->default(date('Y-m-d H:i:s'))->rules('required');\n \n return $form; \n }", "protected function form()\n {\n $form = new Form(new Banner);\n\n $form->text('title', 'Title');\n $form->image('image', 'Image')->rules('required')->move('images/banners');\n $form->switch('status', 'Published')->default(1);\n\n $form->footer(function ($footer) {\n // disable `View` checkbox\n $footer->disableViewCheck();\n\n // disable `Continue editing` checkbox\n $footer->disableEditingCheck();\n\n // disable `Continue Creating` checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n return Admin::form(FactoryModel::class, function (Form $form) {\n\n $form->display('id', 'ID');\n $form->text('name','厂家名称')->rules('required');\n $form->text('boss','老板')->rules('required');\n $form->text('telephone','手机号');\n $form->text('address','地址');\n $form->text('mark','备注');\n\n $form->display('created_at', 'Created At');\n $form->display('updated_at', 'Updated At');\n });\n }", "protected function form()\n {\n $form = new Form(new WechatEvent);\n\n $form->text('title', '事件标题')->help('起说明性作用');\n $form->text('key', 'Key')->default(md5(time()));\n $form->select('event', '事件类型')->options(WechatEvent::EVENTLIST);\n $form->text('method', '执行方法')->help('namespace\\\\class@method');\n $form->select('wechat_message_id', '消息')->options(WechatMessage::select('id', 'title')->pluck('title', 'id'));\n\n return $form;\n }", "protected function form()\n {\n $categoryModel = new ArticleCategory();\n $form = new Form(new ArticleCategory);\n\n $form->select('parent_id', '父级分类')->options($categoryModel::selectOptions())->default(1);\n $form->text('title', '标题')->required();\n $form->text('description', trans('description'));\n $form->image('avatar', trans('avatar'));\n $form->number('order', __('Order'))->default(1)->setDisplay(false);\n\n return $form;\n }", "public function cs_generate_form() {\n global $post;\n }", "public function buildForm()\n {\n $this->add('organization_identifier_code', 'text', ['label' => trans('elementForm.organisation_identifier_code')])\n ->add('provider_activity_id', 'text', ['label' => trans('elementForm.provider_activity_id')])\n ->addSelect('type', $this->getCodeList('OrganisationType', 'Activity'), trans('elementForm.type'), $this->addHelpText('Activity_ParticipatingOrg-type'))\n ->addNarrative('provider_org_narrative')\n ->addAddMoreButton('add_provider_org_narrative', 'provider_org_narrative');\n }", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', __('No'));\n $form->number('user_id', __('User id'));\n $form->textarea('address', __('Address'));\n $form->decimal('total_amount', __('Total amount'));\n $form->textarea('remark', __('Remark'));\n $form->datetime('paid_at', __('Paid at'))->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', __('Payment method'));\n $form->text('payment_no', __('Payment no'));\n $form->text('refund_status', __('Refund status'))->default('pending');\n $form->text('refund_no', __('Refund no'));\n $form->switch('closed', __('Closed'));\n $form->switch('reviewed', __('Reviewed'));\n $form->text('ship_status', __('Ship status'))->default('pending');\n $form->textarea('ship_data', __('Ship data'));\n $form->textarea('extra', __('Extra'));\n\n return $form;\n }", "protected function buildForm()\n {\n $this->formBuilder\n ->add('host', 'text', array(\n 'data' => ElasticProduct::getConfigValue('host'),\n 'required' => false,\n 'attr' => ['placeholder' => 'localhost'],\n 'label' => Translator::getInstance()->trans('Host', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'host'\n )\n ))\n ->add('port', 'text', array(\n 'data' => ElasticProduct::getConfigValue('port'),\n 'required' => false,\n 'attr' => ['placeholder' => '9200'],\n 'label' => Translator::getInstance()->trans('Port', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'port'\n )\n ))\n ->add('username', 'text', array(\n 'data' => ElasticProduct::getConfigValue('username'),\n 'required' => false,\n 'label' => Translator::getInstance()->trans('Username', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'username'\n )\n ))\n ->add('password', PasswordType::class, array(\n 'data' => ElasticProduct::getConfigValue('password'),\n 'required' => false,\n 'label' => Translator::getInstance()->trans('Password', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'password'\n )\n ))\n ->add('index_prefix', 'text', array(\n 'data' => ElasticProduct::getConfigValue('index_prefix'),\n 'required' => false,\n 'attr' => ['placeholder' => 'my_website_name'],\n 'label' => Translator::getInstance()->trans('Index prefix', array(), ElasticProduct::DOMAIN_NAME),\n 'label_attr' => array(\n 'for' => 'index_prefix'\n )\n ));\n }", "public function buildForm()\n {\n $this\n ->add('group_name', 'text')\n ->add(\n 'organizations',\n 'choice',\n [\n 'choices' => $this->getOrganizationName(),\n 'attr' => ['style' => 'height:100px'],\n 'multiple' => true\n ]\n )\n ->add(\n 'group_identifier',\n 'text',\n [\n 'attr' => [\n 'id' => 'group_identifier'\n ],\n 'help_block' => [\n 'text' => \"Your group identifier will be used as a prefix for your organisation group. We recommend that you use a short abbreviation that uniquely identifies your organisation group. If your group identifier is 'abc' the username for the group created with this registration will be 'abc_group'.\",\n 'tag' => 'p',\n 'attr' => ['class' => 'help-block']\n ],\n 'label' => 'Group Identifier'\n ]\n );\n }", "protected function form()\n {\n $form = new Form(new Goods);\n\n $form->text('title', trans('admin.title'))->required()->rules('required');\n $form->text('slogan', trans('admin.slogan'))->required()->rules('required');\n $form->text('name', trans('admin.name'))->required()->rules('required');\n $form->decimal('price', trans('admin.price'))->required()->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Config);\n\n $form->text('key', '配置项')->readOnly();\n\n $form->text('value', '值');\n\n $form->text('desc', '描述');\n\n $form->tools(function(Form\\Tools $tools) {\n $tools->disableView();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Category());\n \n $form->text('erp_id', __('ID(ERP用)'));\n $form->select('parent_id', __('中分類'))->options(\n\n Category::Mid()->pluck('name', 'id')\n\n )->required();\n \n $form->text('name', __('小分類名稱'));\n $form->hidden('type', __('Type'))->default(3);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }", "function buildForm()\r\n {\r\n $this->buildTabs();\r\n // tab caption\r\n $this->addElement('header', null,\r\n 'Progress2 Generator - Control Panel: save PHP/CSS code');\r\n\r\n $code[] =& $this->createElement('checkbox', 'P', null, 'PHP');\r\n $code[] =& $this->createElement('checkbox', 'C', null, 'CSS');\r\n $this->addGroup($code, 'phpcss', 'PHP and/or StyleSheet source code:');\r\n\r\n // Buttons of the wizard to do the job\r\n $this->buildButtons(array('next','apply'));\r\n }", "private function getCreateForm()\n\t{\n\t\t$form = new Zend_Form();\n\t\t$form->setAttrib('id', 'formCommentCreate');\n\n\t\t$comment_type = new Zend_Form_Element_Select('comment_type');\n\t\t$comment_type->setRequired(true)\n\t\t->setMultiOptions(\n\t\tarray(\tApplication_Model_Enum_CommentType::THUMBS_UP => 'Thumbs up',\n\t\t\t\t\tApplication_Model_Enum_CommentType::THUMBS_DOWN => 'Thumbs down'));\n\t\t$form->addElement($comment_type);\n\n\t\t$comment = new Zend_Form_Element_Textarea('comment');\n\t\t$comment->setRequired(true)\n\t\t->addValidator('stringLength', false, 50);\n\t\t$form->addElement($comment);\n\n\t\treturn $form;\n\t}", "protected function form()\n {\n $form = new Form(new UsersOpenclose);\n\n $form->text('srvkey', __('srvkey'));\n $form->text('KtvBoxid', __('机器码'));\n $form->datetime('opendate', __('开房时间'))->default(date('Y-m-d H:i:s'));\n $form->datetime('closedate', __('关房时间'))->default(date('Y-m-d H:i:s'));\n $form->select('feesmode', __('收费模式'))->options([0=>'非扫码收费',1=>'扫码收费']);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goods);\n $form->display('id', 'ID');\n $form->text('name', '名称');\n $arr = (new AdminModel('goods_type'))->getAll('',['type','id']);\n $array = [];\n foreach ($arr as $key => $value) {\n\n $array[$value['id']] = $value['type'];\n }\n $form->select('type', '分类')->options($array);\n $form->text('stock', '库存');\n $form->text('price', '积分价格');\n $form->textarea('desc', '详情');\n $form->switch('status', '是否上架')->value(0);\n $form->image('cover','封面图')->uniqueName()->move('goods_img')->options(['overwriteInitial' => true]);\n $form->multipleImage('image','内容图片')->help('请上传多张内容图')->removable()->uniqueName()->move('goods_img')->options(['overwriteInitial' => true]);\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Product());\n\n $form->text('product_core', __('Product core'));\n $form->text('title', __('Title'));\n $form->text('long_title', __('Long title'));\n $form->text('bar_code', __('Bar code'));\n $form->number('category_id', __('Category id'));\n $form->switch('status', __('Status'));\n $form->select('audit_status', '审核状态')->options(\n [0 => '未进行审核', 1 => '审核已通过', 2 => '审核未通过']\n );\n $form->number('shop_id', __('Shop id'));\n $form->number('description_id', __('Description id'));\n $form->decimal('rating', __('Rating'));\n $form->number('sold_count', __('Sold count'));\n $form->number('review_count', __('Review count'));\n $form->decimal('price', __('Price'));\n $form->image('image', __('Image'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BorrowComment);\n\n $form->text('shared_book_name', __('Shared book name'));\n $form->text('student_name', __('Student name'));\n $form->image('student_avatar', __('Student avatar'));\n $form->textarea('content', __('Content'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Enseignant());\n\n $form->text('matricule', __('Matricule'));\n $form->text('nom', __('Nom'));\n $form->text('postnom', __('Postnom'));\n $form->text('prenom', __('Prenom'));\n $form->text('sexe', __('Sexe'));\n $form->text('grade', __('Grade'));\n $form->text('fonction', __('Fonction'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new gameLog());\n\n $form->text('onlyId', ___('OnlyId'));\n $form->number('bigBlindIndex', ___('BigBlindIndex'));\n $form->number('gameNums', ___('GameNums'));\n $form->number('smallBlindIndex', ___('SmallBlindIndex'));\n $form->textarea('tableCards', ___('TableCards'));\n $form->number('tableId', ___('TableId'));\n $form->textarea('tableSeat1Str1', ___('TableSeat1Str1'));\n $form->textarea('tableSeat1Str2', ___('TableSeat1Str2'));\n $form->textarea('tableSeat1Str3', ___('TableSeat1Str3'));\n $form->textarea('tableSeat1Str4', ___('TableSeat1Str4'));\n $form->textarea('tableSeat1Str5', ___('TableSeat1Str5'));\n $form->textarea('tableSeat1Str6', ___('TableSeat1Str6'));\n $form->textarea('tableSeat1Str7', ___('TableSeat1Str7'));\n $form->number('time', ___('Time'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new V_MRQC_SSBRModel);\n\n $form->display('id', __('ID'));\n $form->display('created_at', __('Created At'));\n $form->display('updated_at', __('Updated At'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Carousel);\n\n $form->select('carousel_category_id', __('carousel::carousel.carousel_category_id'))\n ->options(CarouselCategory::all()->pluck('name', 'id'));\n $form->text('title', __('carousel::carousel.title'));\n $form->text('url', __('carousel::carousel.url'));\n $form->image('img_src', __('carousel::carousel.img_src'))\n ->removable()\n ->uniqueName()\n ->move('carousel');\n $form->text('alt', __('carousel::carousel.alt'));\n $form->textarea('remark', __('carousel::carousel.remark'));\n $form->select('status', __('carousel::carousel.status.label'))\n ->default(1)\n ->options(__('carousel::carousel.status.value'));\n $form->datetime('start_time', __('carousel::carousel.start_time'))\n ->default(date('Y-m-d H:i:s'));\n $form->datetime('end_time', __('carousel::carousel.end_time'))\n ->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BrandCooperation);\n\n $form->text('name', '品牌名称')->rules('required');\n $form->editor('content', '品牌详情')->rules('required');\n $form->image('logo', '品牌图标')->rules('required|image');\n $form->image('logo_hover', '品牌图标(hover)')->rules('required|image');\n// $form->multipleImage('images_url', '品牌图片')->removable()->rules(function ($form) {\n// // 如果不是编辑状态,则添加字段必填验证\n// if (!$id = $form->model()->id) {\n// return 'required|image';\n// } else {\n// return 'image';\n// }\n// });\n $form->file('video', '视频')->rules('mimetypes:video/avi,video/mp4');\n $form->image('image_url', '品牌图片')->rules('image');\n $form->radio('is_show', '显示&隐藏')->options([1 => '显示', 0 => '隐藏'])->default(1);\n $form->text('sort', '排序')->default(0);\n \n $form->text('company_name', '厂家名称')->disable();\n $form->text('contact', '联系人')->disable();\n $form->text('tel', '联系电话')->disable();\n $form->text('address', '厂家地址')->disable();\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n });\n\n return $form;\n }", "public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n }", "public function definition() {\n global $CFG;\n $mform = $this->_form;\n // Define hidden element for id.\n $id = $this->_customdata['id'];\n $mform->addElement('hidden', 'id', $id);\n $mform->setType('id', PARAM_INT);\n\n // Define hidden element for course id.\n $courseid = $this->_customdata['courseid'];\n $mform->addElement('hidden', 'courseid', $courseid);\n $mform->setType('courseid', PARAM_INT);\n // Text element to hold name data.\n $mform->addElement('text', 'name', get_string('name', 'tool_sumitnegi'));\n $mform->setType('name', PARAM_NOTAGS);\n // Checkbox to set completion for the record.\n $mform->addElement('checkbox', 'completed', get_string('completed', 'tool_sumitnegi'));\n $mform->addElement('editor', 'description_editor', get_string('description', 'tool_sumitnegi'),\n null, tool_sumitnegi\\api::editor_options());\n $mform->setType('description', PARAM_RAW);\n $this->add_action_buttons();\n }", "protected function form()\n {\n $form = new Form(new GuestBook);\n\n $form->textarea('body', __('Body'));\n $form->number('user_id', __('User id'));\n $form->number('guest_id', __('Guest id'));\n $form->number('guest_book_id', __('Guest book id'));\n\n return $form;\n }", "protected function createForm()\n {\n if (!$this->form) {\n $this->form = new \\Gems_Form(array('class' => 'form-horizontal', 'role' => 'form'));\n $this->mailElements->setForm($this->form);\n }\n return $this->form;\n }", "protected function form()\n {\n $form = new Form(new Product);\n $form->select('type_id', __('分类名称'))->options(Type::all()->pluck('name','id'));\n $form->text('name', __('产品名称'));\n $states = [\n 'off' => ['value' => 0, 'text' => '否', 'color' => 'danger'],\n 'on' => ['value' => 1, 'text' => '是', 'color' => 'success'],\n ];\n $form->switch('pop','是否推荐')->states($states);\n $form->select('recommend_id','推荐分类')->options(Recommend::all()->pluck('name','id'));\n $form->textarea('description', __('产品描述'));\n $form->image('logo', __('logo图'));\n $form->text('price', __('价格'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new $this->currentModel);\n\n $form->tab('基本信息', function ($form) {\n\n //$form->display('id', 'ID');\n //$form->text('keyword', '关键词');\n $form->text('static_url', '静态地址')->help(\"如果输入:New-York-Downtown.html,则访问地址为:http://www.yinjispace.com/article/<span style='color:#F00;'>New-York-Downtown.html</span>\");\n $form->radio('article_status', '状态')->options(['0' => '草稿', '1' => '审核中', '2' => '已发布'])->default('0');\n $form->radio('display', '公开度')->options(['0' => '公开', '-1' => '保密'])->default('0');\n $form->datetime('release_time', '发布时间')->format('YYYY-MM-DD HH:mm:ss');\n // $form->datetime('created_at','发布时间')->format('YYYY-MM-DD HH:mm:ss');\n $form->multipleSelect('category_ids', '分类')->options(ArticleCategory::getSelectOptions());\n $form->multipleSelect('topic_ids', '专题')->options(Topic::getSelectOptions());\n $form->text('tag_ids', '标签(逗号分隔)');\n $form->text('view_num', '浏览数')->default(0);\n $form->text('like_num', '点赞数')->default(0);\n $form->text('favorite_num', '收藏数')->default(0);\n $form->text('vip_download', '下载地址');\n //$form->multipleSelect('designer_id', '设计师ID')->options(Designer::getSelectOptions());\n $form->multipleSelect('designer_id', '设计师')->options(function ($ids) {\n $designer = Designer::find($ids);\n if ($designer) {\n return $designer->pluck('title_cn', 'id');\n }\n\n })->ajax('/admin/article/get_designer_select_options');\n $form->text('article_source', '文章来源');\n $form->text('article_source_url', '文章来源URL');\n $form->image('custom_thum', '自定义封面')\n ->uniqueName()\n ->widen(880)\n ->move('public/photo/images/custom_thum/');\n $form->image('special_photo', '特色照片')\n ->uniqueName()\n ->widen(1920)\n ->move('public/photo/images/special_photo/');\n $form->text('seo_title', 'SEO标题');\n $form->text('seo_keyword', 'SEO关键词');\n $form->text('seo_desc', 'SEO描述');\n })->tab('中文', function ($form) {\n\n $form->text('title_designer_cn', '标题(设计师)');\n $form->text('title_name_cn', '标题(项目名称)');\n $form->text('title_intro_cn', '标题(项目介绍)');\n $form->text('description_cn', '自定义描述(中)');\n $form->text('location_cn', '地域(中)');\n $form->ckeditor('detail.content_cn', '正文(中)');\n\n })->tab('English', function ($form) {\n\n $form->text('title_designer_en', '标题(设计师)');\n $form->text('title_name_en', '标题(项目名称)');\n $form->text('title_intro_en', '标题(项目介绍)');\n $form->text('description_en', '自定义描述(英)');\n $form->text('location_en', '地域(英)');\n $form->ckeditor('detail.content_en', '正文(英)');\n\n });\n\n //保存前回调\n $form->saving(function (Form $form) {\n if (empty($form->model()->release_time)) {\n $form->release_time = date('Y-m-d H:i:s');\n }\n });\n\n $form->saved(function (Form $form) {\n $tags = explode(',', $form->tag_ids);\n foreach ($tags as $tag) {\n echo $tag;\n $ret = ArticleTag::firstOrCreate(['name_cn' => trim($tag)]);\n }\n\n });\n\n\n return $form;\n }", "protected function form()\n {\n return Form::make(new Liuchengku(), function (Form $form) {\n\t\t\t$form->display('id');\n\t\t\t$form->text('brand','品牌名称')->required();\n\t\t\t$form->tab('加盟流程', function (Form $form) {\n\t\t\t\t $form->textarea('jmlc','加盟流程')->rows(12);\n\t\t\t\t /* $form->editor('jmlc','加盟流程')->options([\n\t\t\t\t\t//'toolbar' => ['undo redo | styleselect | bold italic | link image',],\n\t\t\t\t\t'toolbar' => [],\n\t\t\t\t]); */\n\t\t\t\t})->tab('加盟支持', function (Form $form) {\n\t\t\t\t $form->editor('jmzc','加盟支持');\n\t\t\t\t})->tab('加盟优势', function (Form $form) {\n\t\t\t\t $form->editor('jmys','加盟优势');\n\t\t\t\t});\n //$form->text('type');\n //$form->text('retype');\n\t\t\t//$form->text('is_make');\n\t\t\t//$form->text('user_id');\n $form->hidden('user_id');\n\t\t\t$form->hidden('is_make');\n\t\t\t$form->display('created_at');\n $form->display('updated_at');\n $form->saving(function (Form $form) {\n if ($form->isCreating()) {\n $form->user_id=Admin::user()->id;\n\t\t\t\t\t$form->is_make=1;\n\t\t\t\t\t}\n });\n });\n }", "protected function form()\n {\n $form = new Form(new Formulario());\n\n $form->text('name', 'Nombre')\n ->required()\n ->creationRules(['required', \"unique:formularios\"])\n ->updateRules(['required', \"unique:formularios,name,{{id}}\"]);\n $form->text('description', 'Descripción');\n\n $fields = Field::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('fields', 'Campos')->options($fields);\n\n $forms = Formulario::all()->pluck('name', 'id')->toArray();\n $form->select('go_to_formulario', 'Continuar a formulario')->options($forms);\n\n $form->divider('Quiénes tienen acceso a este Formulario?');\n\n $permissions = Permission::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('permissions', 'Permisos')->options($permissions);\n\n $roles = Role::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('roles', 'Roles')->options($roles);\n\n return $form;\n }", "function create() {\n\t\tglobal $tpl, $lng;\n\n\t\t$form = $this->initForm(TRUE);\n\t\tif ($form->checkInput()) {\n\t\t\tif ($this->createElement($this->getPropertiesFromPost($form))) {\n\t\t\t\tilUtil::sendSuccess($lng->txt('msg_obj_modified'), TRUE);\n\t\t\t\t$this->returnToParent();\n\t\t\t}\n\t\t}\n\n\t\t$form->setValuesByPost();\n\t\t$tpl->setContent($form->getHtml());\n\t}", "function createForm(){\n\t\t$this->createFormBase();\n\t\t$this->addElement('reset','reset','Reset');\t\t\t\n\t\t$tab['seeker_0'] = '0';\n\t\t$this->setDefaults($tab);\n\t\t$this->addElement('submit','bouton_add_pi','Add a contact',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_contact'\"));\n\t\t$this->createVaFormResolution();\n\t\t$this->createFormGeoCoverage();\n\t\t$this->createFormGrid();\t\n\t\t//Required format\n\t\t$dformat = new data_format;\n\t\t$dformat_select = $dformat->chargeFormDestFormat($this,'required_data_format','Required data format','NetCDF');\n\t\t$this->addElement($dformat_select);\n\t\t$this->getElement('organism_0')->setLabel(\"Organism short name\");\n\t\t$this->getElement('project_0')->setLabel(\"Useful in the framework of\");\n\t\t$this->getElement('dats_abstract')->setLabel(\"Abstract \");\n\t\t$this->getElement('dats_purpose')->setLabel(\"Purpose\");\n\t\t$this->getElement('database')->setLabel(\"Data center\");\n\t\t$this->getElement('new_db_url')->setLabel(\"Data center url\");\n\t\t$this->getElement('dats_use_constraints')->setLabel(\"Access and use constraints\");\t\t\t\n\t\t$this->getElement('sensor_resol_tmp')->setLabel('Temporal (hh:mm:ss)');\t\t\t\n\t\t$this->getElement('place_alt_min_0')->setLabel(\"Altitude min\");\n\t\t$this->getElement('place_alt_max_0')->setLabel(\"Altitude max\");\n\t\t$this->getElement('data_format_0')->setLabel(\"Original data format\");\n\t\t$this->addElement('file','upload_doc','Attached document');\n\t\t$this->addElement('submit','upload','Upload');\n\t\t$this->addElement('submit','delete','Delete');\n\t\t\n\t\tfor ($i = 0; $i < $this->dataset->nbVars; $i++){\n\t\t\t$this->getElement('methode_acq_'.$i)->setLabel(\"Parameter processing related information\");\n\t\t}\n\t\t$this->addElement('submit','bouton_add_variable','Add a parameter',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_param'\"));\n\t\t\n\t\t$this->addElement('submit','bouton_add_projet','Add a project',array('onclick' => \"document.getElementById('frmvadataset').action += '#a_general'\"));\n\t\t$option = array();\n\t\t$option['default'] = \"\";\n\t\t$option['model'] = \"Model\";\n\t\t$option['instrument'] = \"Instrument\";\n\t\t$option['satellite'] = \"Satellite\";\n\t\t$this->addElement('select','source_type','source type :',$option,array('onchange' => \"DeactivateButtonAddSource()\",'onclick' => \"DeactivateButtonAddSource();\",'onmouseover' => 'DeactivateButtonAddSource();' ));\n\t\t$this->addElement('submit','bouton_add_source','Add a source',array('disabled' => 'true','onclick' => \"document.getElementById('frmvadataset').action += '#a_source'\",'onmouseout' => 'DeactivateButtonAddSource();'));\n\t\t\n\t\tif (isset ( $this->dataset->dats_sensors ) && ! empty ( $this->dataset->dats_sensors )) {\n\t\t\t$this->dats_sensors = array();\n\t\t\t$this->dats_sensors = $this->dataset->dats_sensors ;\n\t\t}\n\t\tif (isset ( $this->dataset->sites ) && ! empty ( $this->dataset->sites )) {\n\t\t\t$this->sites = array();\n\t\t\t$this->sites = $this->dataset->sites;\n\t\t}\n\t\t\n\t\tif ( isset ( $this->dataset->dats_id ) && $this->dataset->dats_id > 0) {\n\t\t\tif (isset ( $this->dataset->nbModFormSensor )){\n\t\t\t\tif($this->dataset->nbModForm <= $this->dataset->nbModFormSensor ){\n\t\t\t\t\t$this->dataset->nbModForm = $this->dataset->nbModFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbSatFormSensor )){\n\t\t\t\t//$this->dataset->nbSatFormSensor = $this->dataset->nbSatFormSensor - 1;\n\t\t\t\tif($this->dataset->nbSatForm <= $this->dataset->nbSatFormSensor){\n\t\t\t\t\t$this->dataset->nbSatForm = $this->dataset->nbSatFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset ( $this->dataset->nbInstruFormSensor )){\n\t\t\t\tif($this->dataset->nbInstruForm <= $this->dataset->nbInstruFormSensor){\n\t\t\t\t\t$this->dataset->nbInstruForm = $this->dataset->nbInstruFormSensor;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->dataset->nbModForm > 0)\n\t\t\t$this->addMod();\n\t\tif($this->dataset->nbInstruForm > 0)\n\t\t\t$this->addInstru();\t\n\t\tif($this->dataset->nbSatForm > 0)\n\t\t\t$this->addSat();\n\t\t\n\t\t$this->dataset->dats_sensors = null ;\n\t\t$this->dataset->sites = null;\n\t}", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('currency', __('Currency'));\n $form->number('amount', __('Amount'));\n $form->number('state', __('State'));\n $form->number('game_id', __('Game id'));\n $form->number('user_id', __('User id'));\n $form->text('product_id', __('Product id'));\n $form->text('product_name', __('Product name'));\n $form->text('cp_order_id', __('Cp order id'));\n $form->text('callback_url', __('Callback url'));\n $form->text('callback_info', __('Callback info'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member());\n\n $form->text('open_id', __('微信openid'));\n $form->image('head', __('头像'));\n $form->text('nickname', __('昵称'));\n $form->mobile('mobile', __('手机号码'));\n $form->text('email', __('邮箱'));\n $form->text('name', __('姓名'));\n $form->text('weixin', __('微信号'));\n $form->text('qq', __('qq'));\n $form->text('city', __('所在城市'));\n $form->text('yidudian', __('易读点'));\n $form->text('integral', __('积分'));\n $form->text('balance', __('余额'));\n $states = [\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'success'],\n 'off' => ['value' => 0, 'text' => '冻结', 'color' => 'danger'],\n ];\n $form->switch('status', '是否使用')->states($states);\n return $form;\n }", "protected function form()\n {\n $form = new Form(new City());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n $form->text('name', __('field.name'));\n $form->text('slug', __('field.slug'));\n $form->text('description', __('field.description'));\n $form->number('sort', __('field.sort'))->default(0);\n $form->hasMany('files', __('field.images'), function (Form\\NestedForm $form) {\n $form->image('file', __('field.image'))\n ->options(['showClose'=>false])\n ->options(['fileActionSettings'=>['showRemove'=>true]])\n ->options(['otherActionButtons'=>ImageHelper::previewRotateButtons()])\n ->uniqueName();\n $form->number('sort', __('field.sort'))->default(0);\n });\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Movie());\n\n $form->text('title', __('名字'));\n $form->number('director', __('导演'));\n $form->text('describe', __('简介'));\n $form->number('rate', __('评价'));\n $form->switch('released', __('是否上映'));\n $form->datetime('release_at', __('发行时间'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BoxOrder);\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Usertype());\n\n $form->text('usertype', '类型名称')->rules('required|max:10');\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableList();\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Leavetime());\n\n /*$form->select('designer_id',__('设计师'))->options(function ($id) {\n $designer = Designer::find($id);\n\n if ($designer) {\n return [$designer->id => $designer->name];\n }\n })->ajax('/admin/api/designer')->required();*/\n $form->select('designer_id',__('设计师'))->options(Designer::all()->pluck('name', 'id'))->required();\n $form->radio('type', __('请假类型'))->options(['0' => '全天', '1'=> '半天'])->default(0)\n ->required()->help('如果请假为半天请填写请假时间段, 全天无需填写时间段');\n $form->date('date', __('请假日期'))->default(date('Y-m-d'));\n $form->embeds('time',__('时间段'), function ($form) {\n $form->select('start_time', __('开始时间'))->options(Worktime::all()->pluck('time', 'id'));\n $form->select('end_time', __('结束时间'))->options(Worktime::all()->pluck('time', 'id'));\n\n });\n return $form;\n }" ]
[ "0.785096", "0.7786465", "0.7786465", "0.776722", "0.776722", "0.76634437", "0.76254475", "0.75540817", "0.7551564", "0.7443507", "0.74177533", "0.7402114", "0.7384385", "0.7375861", "0.73576987", "0.73296344", "0.73074406", "0.7305967", "0.7298659", "0.72959924", "0.7271806", "0.7262428", "0.72468966", "0.7238791", "0.7228533", "0.7214665", "0.72146016", "0.7212097", "0.7201567", "0.72003484", "0.7177151", "0.716192", "0.71498", "0.71483773", "0.7147857", "0.71379256", "0.7135024", "0.71330076", "0.712551", "0.7116316", "0.71115285", "0.71114624", "0.71084696", "0.71044135", "0.7103202", "0.71005857", "0.7090023", "0.7088318", "0.70862395", "0.70848536", "0.7080636", "0.70804054", "0.70550835", "0.70501333", "0.70403993", "0.70318025", "0.70299286", "0.70296293", "0.70196056", "0.70163274", "0.6990957", "0.6980746", "0.69725925", "0.6972555", "0.6969814", "0.69690794", "0.6965755", "0.6965585", "0.69645035", "0.69616115", "0.69599146", "0.69542587", "0.69511855", "0.6947468", "0.69362104", "0.69360113", "0.6934842", "0.6934582", "0.6931797", "0.69313514", "0.69312894", "0.6929964", "0.6929551", "0.692764", "0.6921381", "0.6918586", "0.6916528", "0.6915794", "0.6911416", "0.69094855", "0.69074506", "0.6903826", "0.68920344", "0.6876515", "0.6872537", "0.6866629", "0.6862453", "0.68622816", "0.68584967", "0.685692", "0.6855861" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { if ($select = request()->query('list')) { return $this->accountRepository->listAll($this->formatFields($select)); } else $data = AccountResource::collection($this->accountRepository->getAllPaginate()); return $this->respondWithData($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Run the database seeds.
public function run() { $settings = [ 'site-on' => '1', 'support-email' => '[email protected]', ]; foreach ($settings as $settingKey => $settingValue) { $checkExists = DB::table('settings')->where('s_key', $settingKey)->count(); if ($checkExists > 0) { echo "Setting '".$settingKey."' already registered.\n"; continue; } DB::table('settings')->insert([ 's_key' => $settingKey, 's_value' => $settingValue, 'created_at' => now() ]); echo "Setting '".$settingKey."' registered.\n"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function run()\n {\n // $this->call(UserTableSeeder::class);\n // $this->call(PostTableSeeder::class);\n // $this->call(TagTableSeeder::class);\n // $this->call(PostTagTableSeeder::class);\n\n /*AB - use faker to populate table see file ModelFactory.php */\n factory(App\\Editeur::class, 40) ->create();\n factory(App\\Auteur::class, 40) ->create();\n factory(App\\Livre::class, 80) ->create();\n\n for ($i = 1; $i < 41; $i++) {\n $number = rand(2, 8);\n for ($j = 1; $j <= $number; $j++) {\n DB::table('auteur_livre')->insert([\n 'livre_id' => rand(1, 40),\n 'auteur_id' => $i\n ]);\n }\n }\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Let's truncate our existing records to start from scratch.\n Assignation::truncate();\n\n $faker = \\Faker\\Factory::create();\n \n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 40; $i++) {\n Assignation::create([\n 'ad_id' => $faker->numberBetween(1,20),\n 'buyer_id' => $faker->numberBetween(1,6),\n 'seller_id' => $faker->numberBetween(6,11),\n 'state' => NULL,\n ]);\n }\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n \t$faker = Faker::create();\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$post = new Post;\n \t\t$post->title = $faker->sentence();\n \t\t$post->body = $faker->paragraph();\n \t\t$post->category_id = rand(1, 5);\n \t\t$post->save();\n \t}\n\n \t$list = ['General', 'Technology', 'News', 'Internet', 'Mobile'];\n \tforeach($list as $name) {\n \t\t$category = new Category;\n \t\t$category->name = $name;\n \t\t$category->save();\n \t}\n\n \tfor($i=0; $i<20; $i++) {\n \t\t$comment = new Comment;\n \t\t$comment->comment = $faker->paragraph();\n \t\t$comment->post_id = rand(1,20);\n \t\t$comment->save();\n \t}\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call(RoleTableSeeder::class);\n $this->call(UserTableSeeder::class);\n \n factory('App\\Cat', 5)->create();\n $tags = factory('App\\Tag', 8)->create();\n\n factory(Post::class, 15)->create()->each(function($post) use ($tags){\n $post->comments()->save(factory(Comment::class)->make());\n $post->tags()->attach( $tags->random(mt_rand(1,4))->pluck('id')->toArray() );\n });\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('post')->insert(\n [\n 'title' => 'Test Post1',\n 'desc' => str_random(100).\" post1\",\n 'alias' => 'test1',\n 'keywords' => 'test1',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post2',\n 'desc' => str_random(100).\" post2\",\n 'alias' => 'test2',\n 'keywords' => 'test2',\n ]\n );\n DB::table('post')->insert(\n [\n 'title' => 'Test Post3',\n 'desc' => str_random(100).\" post3\",\n 'alias' => 'test3',\n 'keywords' => 'test3',\n ]\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \t$faker = Factory::create();\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\tDepartment::create([\n \t\t\t'name' => $department\n \t\t]);\n \t}\n \tforeach ($this->collections as $key => $collection) {\n \t\tCollection::create([\n \t\t\t'name' => $collection\n \t\t]);\n \t}\n \t\n \t\n \tfor ($i=0; $i < 40; $i++) {\n \t\tUser::create([\n \t\t\t'name' \t=>\t$faker->name,\n \t\t\t'email' \t=>\t$faker->email,\n \t\t\t'password' \t=>\tbcrypt('123456'),\n \t\t]);\n \t} \n \t\n \t\n \tforeach ($this->departments as $key => $department) {\n \t\t//echo ($key + 1) . PHP_EOL;\n \t\t\n \t\tfor ($i=0; $i < 10; $i++) { \n \t\t\techo $faker->name . PHP_EOL;\n\n \t\t\tArt::create([\n \t\t\t\t'name'\t\t\t=> $faker->sentence(2),\n \t\t\t\t'img'\t\t\t=> $this->filenames[$i],\n \t\t\t\t'medium'\t\t=> 'canvas',\n \t\t\t\t'department_id'\t=> $key + 1,\n \t\t\t\t'user_id'\t\t=> $this->userIndex,\n \t\t\t\t'dimension'\t\t=> '18.0 x 24.0',\n\t\t\t\t]);\n \t\t\t\t\n \t\t\t\t$this->userIndex ++;\n \t\t}\n \t}\n \t\n \tdd(\"END\");\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->dataCategory();\n factory(App\\Model\\Category::class, 70)->create();\n factory(App\\Model\\Producer::class, rand(5,10))->create();\n factory(App\\Model\\Provider::class, rand(5,10))->create();\n factory(App\\Model\\Product::class, 100)->create();\n factory(App\\Model\\Album::class, 300)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n\n factory('App\\User', 10 )->create();\n\n $users= \\App\\User::all();\n $users->each(function($user){ factory('App\\Category', 1)->create(['user_id'=>$user->id]); });\n $users->each(function($user){ factory('App\\Tag', 3)->create(['user_id'=>$user->id]); });\n\n\n $users->each(function($user){\n factory('App\\Post', 10)->create([\n 'user_id'=>$user->id,\n 'category_id'=>rand(1,20)\n ]\n );\n });\n\n $posts= \\App\\Post::all();\n $posts->each(function ($post){\n\n $post->tags()->attach(array_unique([rand(1,20),rand(1,20),rand(1,20)]));\n });\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $types = factory(\\App\\Models\\Type::class, 5)->create();\n\n $cities = factory(\\App\\Models\\City::class, 10)->create();\n\n $cities->each(function ($city) {\n $districts = factory(\\App\\Models\\District::class, rand(2, 5))->create([\n 'city_id' => $city->id,\n ]);\n\n $districts->each(function ($district) {\n $properties = factory(\\App\\Models\\Property::class, rand(2, 5))->create([\n 'type_id' => rand(1, 5),\n 'district_id' => $district->id\n ]);\n\n $properties->each(function ($property) {\n $galleries = factory(\\App\\Models\\Gallery::class, rand(3, 10))->create([\n 'property_id' => $property->id\n ]);\n });\n });\n });\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n\n $categories = factory(App\\Models\\Category::class, 10)->create();\n\n $categories->each(function ($category) {\n $category\n ->posts()\n ->saveMany(\n factory(App\\Models\\Post::class, 3)->make()\n );\n });\n }", "public function run()\n {\n $this->call(CategoriesTableSeeder::class);\n\n $users = factory(App\\User::class, 5)->create();\n $recipes = factory(App\\Recipe::class, 30)->create();\n $preparations = factory(App\\Preparation::class, 70)->create();\n $photos = factory(App\\Photo::class, 90)->create();\n $comments = factory(App\\Comment::class, 200)->create();\n $flavours = factory(App\\Flavour::class, 25)->create();\n $flavour_recipe = factory(App\\FlavourRecipe::class, 50)->create();\n $tags = factory(App\\Tag::class, 25)->create();\n $recipe_tag = factory(App\\RecipeTag::class, 50)->create();\n $ingredients = factory(App\\Ingredient::class, 25)->create();\n $ingredient_preparation = factory(App\\IngredientPreparation::class, 300)->create();\n \n \n \n DB::table('users')->insert(['name' => 'SimpleUtilisateur', 'email' => '[email protected]', 'password' => bcrypt('SimpleMotDePasse')]);\n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n // Sample::truncate();\n // TestItem::truncate();\n // UOM::truncate();\n Role::truncate();\n User::truncate();\n\n // factory(Role::class, 4)->create();\n Role::create([\n 'name'=> 'Director',\n 'description'=> 'Director type'\n ]);\n\n Role::create([\n 'name'=> 'Admin',\n 'description'=> 'Admin type'\n ]);\n Role::create([\n 'name'=> 'Employee',\n 'description'=> 'Employee type'\n ]);\n Role::create([\n 'name'=> 'Technician',\n 'description'=> 'Technician type'\n ]);\n \n factory(User::class, 20)->create()->each(\n function ($user){\n $roles = \\App\\Role::all()->random(mt_rand(1, 2))->pluck('id');\n $user->roles()->attach($roles);\n }\n );\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Admin',\n 'email' => '[email protected]',\n 'avatar' => \"avatar\",\n 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi',\n ]);\n $this->call(CategorySeeder::class);\n // \\App\\Models\\Admin::factory(1)->create();\n \\App\\Models\\User::factory(10)->create();\n // \\App\\Models\\Category::factory(50)->create();\n \\App\\Models\\PetComment::factory(50)->create();\n $pets = \\App\\Models\\Pet::factory(50)->create();\n foreach ($pets as $pet) {\n \\App\\Models\\PetTag::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\PetPhotoUrl::factory(1)->create(['pet_id' => $pet->id]);\n \\App\\Models\\Order::factory(1)->create(['pet_id' => $pet->id]);\n };\n }", "public function run()\n { \n\n $this->call(RoleSeeder::class);\n \n $this->call(UserSeeder::class);\n\n Storage::deleteDirectory('socials-icon');\n Storage::makeDirectory('socials-icon');\n $socials = Social::factory(7)->create();\n\n Storage::deleteDirectory('countries-flag');\n Storage::deleteDirectory('countries-firm');\n Storage::makeDirectory('countries-flag');\n Storage::makeDirectory('countries-firm');\n $countries = Country::factory(18)->create();\n\n // Se llenan datos de la tabla muchos a muchos - social_country\n foreach ($countries as $country) {\n foreach ($socials as $social) {\n\n $country->socials()->attach($social->id, [\n 'link' => 'https://www.facebook.com/ministeriopalabrayespiritu/'\n ]);\n }\n }\n\n Person::factory(50)->create();\n\n Category::factory(7)->create();\n\n Video::factory(25)->create(); \n\n $this->call(PostSeeder::class);\n\n Storage::deleteDirectory('documents');\n Storage::makeDirectory('documents');\n Document::factory(25)->create();\n\n }", "public function run()\n {\n $faker = Faker::create('id_ID');\n /**\n * Generate fake author data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('author')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Generate fake publisher data\n */\n for ($i=1; $i<=50; $i++) { \n DB::table('publisher')->insert([\n 'name' => $faker->name\n ]);\n }\n /**\n * Seeding payment method\n */\n DB::table('payment')->insert([\n ['name' => 'Mandiri'],\n ['name' => 'BCA'],\n ['name' => 'BRI'],\n ['name' => 'BNI'],\n ['name' => 'Pos Indonesia'],\n ['name' => 'BTN'],\n ['name' => 'Indomaret'],\n ['name' => 'Alfamart'],\n ['name' => 'OVO'],\n ['name' => 'Cash On Delivery']\n ]);\n }", "public function run()\n {\n DatabaseSeeder::seedLearningStylesProbs();\n DatabaseSeeder::seedCampusProbs();\n DatabaseSeeder::seedGenderProbs();\n DatabaseSeeder::seedTypeStudentProbs();\n DatabaseSeeder::seedTypeProfessorProbs();\n DatabaseSeeder::seedNetworkProbs();\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n // MyList::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 3; $i++) {\n MyList::create([\n 'title' => 'List-'.($i+1),\n 'color' => $faker->sentence,\n 'icon' => $faker->randomDigitNotNull,\n 'index' => $faker->randomDigitNotNull,\n 'user_id' => 1,\n ]);\n }\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Products::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few products in our database:\n for ($i = 0; $i < 50; $i++) {\n Products::create([\n 'name' => $faker->word,\n 'sku' => $faker->randomNumber(7, false),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n User::create([\n 'name' => 'Pablo Rosales',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'status' => 1,\n 'role_id' => 1,\n 'movil' => 0\n ]);\n\n User::create([\n 'name' => 'Usuario Movil',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'status' => 1,\n 'role_id' => 3,\n 'movil' => 1\n ]);\n\n Roles::create([\n 'name' => 'Administrador'\n ]);\n Roles::create([\n 'name' => 'Operaciones'\n ]);\n Roles::create([\n 'name' => 'Comercial'\n ]);\n Roles::create([\n 'name' => 'Aseguramiento'\n ]);\n Roles::create([\n 'name' => 'Facturación'\n ]);\n Roles::create([\n 'name' => 'Creditos y Cobros'\n ]);\n\n factory(App\\Customers::class, 100)->create();\n }", "public function run()\n {\n // php artisan db:seed --class=StoreTableSeeder\n\n foreach(range(1,20) as $i){\n $faker = Faker::create();\n Store::create([\n 'name' => $faker->name,\n 'desc' => $faker->text,\n 'tags' => $faker->word,\n 'address' => $faker->address,\n 'longitude' => $faker->longitude($min = -180, $max = 180),\n 'latitude' => $faker->latitude($min = -90, $max = 90),\n 'created_by' => '1'\n ]);\n }\n\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n echo 'seeding permission...', PHP_EOL;\n $permissions = [\n 'role-list',\n 'role-create',\n 'role-edit',\n 'role-delete',\n 'formation-list',\n 'formation-create',\n 'formation-edit',\n 'formation-delete',\n 'user-list',\n 'user-create',\n 'user-edit',\n 'user-delete'\n ];\n foreach ($permissions as $permission) {\n Permission::create(['name' => $permission]);\n }\n echo 'seeding users...', PHP_EOL;\n\n $user= User::create(\n [\n 'name' => 'Mr. admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'remember_token' => null,\n ]\n );\n echo 'Create Roles...', PHP_EOL;\n Role::create(['name' => 'former']);\n Role::create(['name' => 'learner']);\n Role::create(['name' => 'admin']);\n Role::create(['name' => 'manager']);\n Role::create(['name' => 'user']);\n\n echo 'seeding Role User...', PHP_EOL;\n $user->assignRole('admin');\n $role = $user->assignRole('admin');\n $role->givepermissionTo(Permission::all());\n\n \\DB::table('languages')->insert(['name' => 'English', 'code' => 'en']);\n \\DB::table('languages')->insert(['name' => 'Français', 'code' => 'fr']);\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(PermissionsSeeder::class);\n $this->call(RolesSeeder::class);\n $this->call(ThemeSeeder::class);\n\n //\n\n DB::table('paypal_info')->insert([\n 'client_id' => '',\n 'client_secret' => '',\n 'currency' => '',\n ]);\n DB::table('contact_us')->insert([\n 'content' => '',\n ]);\n DB::table('setting')->insert([\n 'site_name' => ' ',\n ]);\n DB::table('terms_and_conditions')->insert(['terms_and_condition' => 'text']);\n }", "public function run()\n {\n $this->call([\n UserSeeder::class,\n ]);\n\n User::factory(20)->create();\n Author::factory(20)->create();\n Book::factory(60)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UserSeeder::class);\n $this->call(RolePermissionSeeder::class);\n $this->call(AppmodeSeeder::class);\n\n // \\App\\Models\\Appmode::factory(3)->create();\n \\App\\Models\\Doctor::factory(100)->create();\n \\App\\Models\\Unit::factory(50)->create();\n \\App\\Models\\Broker::factory(100)->create();\n \\App\\Models\\Patient::factory(100)->create();\n \\App\\Models\\Expence::factory(100)->create();\n \\App\\Models\\Testcategory::factory(100)->create();\n \\App\\Models\\Test::factory(50)->create();\n \\App\\Models\\Parameter::factory(50)->create();\n \\App\\Models\\Sale::factory(50)->create();\n \\App\\Models\\SaleItem::factory(100)->create();\n \\App\\Models\\Goption::factory(1)->create();\n \\App\\Models\\Pararesult::factory(50)->create();\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // DB::table('roles')->insert(\n // [\n // ['name' => 'admin', 'description' => 'Administrator'],\n // ['name' => 'student', 'description' => 'Student'],\n // ['name' => 'lab_tech', 'description' => 'Lab Tech'],\n // ['name' => 'it_staff', 'description' => 'IT Staff Member'],\n // ['name' => 'it_manager', 'description' => 'IT Manager'],\n // ['name' => 'lab_manager', 'description' => 'Lab Manager'],\n // ]\n // );\n\n // DB::table('users')->insert(\n // [\n // 'username' => 'admin', \n // 'password' => Hash::make('password'), \n // 'active' => 1,\n // 'name' => 'Administrator',\n // 'email' => '[email protected]',\n // 'role_id' => \\App\\Role::where('name', 'admin')->first()->id\n // ]\n // );\n\n DB::table('status')->insert([\n // ['name' => 'Active'],\n // ['name' => 'Cancel'],\n // ['name' => 'Disable'],\n // ['name' => 'Open'],\n // ['name' => 'Closed'],\n // ['name' => 'Resolved'],\n ['name' => 'Used'],\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create([\n 'name' => 'Qwerty',\n 'email' => '[email protected]',\n 'password' => bcrypt('secretpassw'),\n ]);\n\n factory(User::class, 59)->create([\n 'password' => bcrypt('secretpassw'),\n ]);\n\n for ($i = 1; $i < 11; $i++) {\n factory(Category::class)->create([\n 'name' => 'Category ' . $i,\n ]);\n }\n\n for ($i = 1; $i < 101; $i++) {\n factory(Product::class)->create([\n 'name' => 'Product ' . $i,\n ]);\n }\n }", "public function run()\n {\n\n \t// Making main admin role\n \tDB::table('roles')->insert([\n 'name' => 'Admin',\n ]);\n\n // Making main category\n \tDB::table('categories')->insert([\n 'name' => 'Other',\n ]);\n\n \t// Making main admin account for testing\n \tDB::table('users')->insert([\n 'name' \t\t=> 'Admin',\n 'email' \t=> '[email protected]',\n 'password' => bcrypt('12345'),\n 'role_id' => 1,\n 'created_at' => date('Y-m-d H:i:s' ,time()),\n 'updated_at' => date('Y-m-d H:i:s' ,time())\n ]);\n\n \t// Making random users and posts\n factory(App\\User::class, 10)->create();\n factory(App\\Post::class, 35)->create();\n }", "public function run()\n {\n $faker = Faker::create();\n\n \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Chef',\n 'salario' => '15000.00'\n ));\n\n\t\t \\DB::table('positions')->insert(array (\n 'codigo' => strtoupper($faker->randomLetter).$faker->postcode,\n 'nombre' => 'Mesonero',\n 'salario' => '12000.00'\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = \\Faker\\Factory::create();\n\n foreach (range(1,5) as $index) {\n Lista::create([\n 'name' => $faker->sentence(2),\n 'description' => $faker->sentence(10), \n ]);\n } \n\n foreach (range(1,20) as $index) {\n $n = $faker->sentence(2);\n \tTarea::create([\n \t\t'name' => $n,\n \t\t'description' => $faker->sentence(10),\n 'lista_id' => $faker->numberBetween(1,5),\n 'slug' => Str::slug($n),\n \t\t]);\n } \n }", "public function run()\n {\n $faker = Faker::create('lt_LT');\n\n DB::table('users')->insert([\n 'name' => 'user',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n DB::table('users')->insert([\n 'name' => 'user2',\n 'email' => '[email protected]',\n 'password' => Hash::make('123')\n ]);\n\n foreach (range(1,100) as $val)\n DB::table('authors')->insert([\n 'name' => $faker->firstName(),\n 'surname' => $faker->lastName(),\n \n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(UsersTableSeeder::class);\n\n // DB::table('users')->insert([\n // 'name' => 'User1',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('password'),\n // ]);\n\n\n $faker = Faker::create();\n \n foreach (range(1,10) as $index){\n DB::table('companies')->insert([\n 'name' => $faker->company(),\n 'email' => $faker->email(10).'@gmail.com',\n 'logo' => $faker->image($dir = '/tmp', $width = 640, $height = 480),\n 'webiste' => $faker->domainName(),\n \n ]);\n }\n \n \n foreach (range(1,10) as $index){\n DB::table('employees')->insert([\n 'first_name' => $faker->firstName(),\n 'last_name' => $faker->lastName(),\n 'company' => $faker->company(),\n 'email' => $faker->str_random(10).'@gmail.com',\n 'phone' => $faker->e164PhoneNumber(),\n \n ]);\n }\n\n\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n Flight::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 100; $i++) {\n\n\n Flight::create([\n 'flightNumber' => $faker->randomNumber(5),\n 'depAirport' => $faker->city,\n 'destAirport' => $faker->city,\n 'reservedWeight' => $faker->numberBetween(1000 - 10000),\n 'deptTime' => $faker->dateTime('now'),\n 'arrivalTime' => $faker->dateTime('now'),\n 'reservedVolume' => $faker->numberBetween(1000 - 10000),\n 'airlineName' => $faker->colorName,\n ]);\n }\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n /**\n * Dummy seeds\n */\n DB::table('metas')->truncate();\n $faker = Faker::create();\n\n for ($i=0; $i < 10; $i++) { \n DB::table('metas')->insert([\n 'id_rel' => $faker->randomNumber(),\n 'titulo' => $faker->sentence,\n 'descricao' => $faker->paragraph,\n 'justificativa' => $faker->paragraph,\n 'valor_inicial' => $faker->numberBetween(0,100),\n 'valor_atual' => $faker->numberBetween(0,100),\n 'valor_final' => $faker->numberBetween(0,10),\n 'regras' => json_encode([$i => [\"values\" => $faker->words(3)]]),\n 'types' => json_encode([$i => [\"values\" => $faker->words(2)]]),\n 'categorias' => json_encode([$i => [\"values\" => $faker->words(4)]]),\n 'tags' => json_encode([$i => [\"values\" => $faker->words(5)]]),\n 'active' => true,\n ]);\n }\n\n\n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n\n $faker = Faker::create();\n\n $lessonIds = Lesson::lists('id')->all(); // An array of ID's in that table [1, 2, 3, 4, 5, 7]\n $tagIds = Tag::lists('id')->all();\n\n foreach(range(1, 30) as $index)\n {\n // a real lesson id\n // a real tag id\n DB::table('lesson_tag')->insert([\n 'lesson_id' => $faker->randomElement($lessonIds),\n 'tag_id' => $faker->randomElement($tagIds),\n ]);\n }\n }", "public function run()\n {\n $this->call(CategoriasTableSeeder::class);\n $this->call(UfsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(UserTiposTableSeeder::class);\n factory(App\\User::class, 2)->create();\n/* factory(App\\Models\\Categoria::class, 20)->create();*/\n/* factory(App\\Models\\Anuncio::class, 50)->create();*/\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n Language::truncate();\n Reason::truncate();\n Report::truncate();\n Category::truncate();\n Position::truncate();\n\n $languageQuantity = 10;\n $reasonQuantity = 10;\n $reportQuantity = 10;\n $categoryQuantity = 10;\n $positionQuantity = 10;\n\n factory(Language::class,$languageQuantity)->create();\n factory(Reason::class,$reasonQuantity)->create();\n \n factory(Report::class,$reportQuantity)->create();\n \n factory(Category::class,$categoryQuantity)->create();\n \n factory(Position::class,$positionQuantity)->create();\n\n }", "public function run()\n {\n // \\DB::statement('SET_FOREIGN_KEY_CHECKS=0');\n \\DB::table('users')->truncate();\n \\DB::table('posts')->truncate();\n // \\DB::table('category')->truncate();\n \\DB::table('photos')->truncate();\n \\DB::table('comments')->truncate();\n \\DB::table('comment_replies')->truncate();\n\n \\App\\Models\\User::factory()->times(10)->hasPosts(1)->create();\n \\App\\Models\\Role::factory()->times(10)->create();\n \\App\\Models\\Category::factory()->times(10)->create();\n \\App\\Models\\Comment::factory()->times(10)->hasReplies(1)->create();\n \\App\\Models\\Photo::factory()->times(10)->create();\n\n \n // \\App\\Models\\User::factory(10)->create([\n // 'role_id'=>2,\n // 'is_active'=>1\n // ]);\n\n // factory(App\\Models\\Post::class, 10)->create();\n // $this->call(UsersTableSeeder::class);\n }", "public function run()\n {\n $this->call([\n ArticleSeeder::class, \n TagSeeder::class,\n Arttagrel::class\n ]);\n // \\App\\Models\\User::factory(10)->create();\n \\App\\Models\\Article::factory()->count(7)->create();\n \\App\\Models\\Tag::factory()->count(15)->create(); \n \\App\\Models\\Arttagrel::factory()->count(15)->create(); \n }", "public function run()\n {\n $this->call(ArticulosTableSeeder::class);\n /*DB::table('articulos')->insert([\n 'titulo' => str_random(50),\n 'cuerpo' => str_random(200),\n ]);*/\n }", "public function run()\n {\n $this->call(CategoryTableSeeder::class);\n $this->call(ProductTableSeeder::class);\n\n \t\t\n\t\t\tDB::table('users')->insert([\n 'first_name' => 'Ignacio',\n 'last_name' => 'Garcia',\n 'email' => '[email protected]',\n 'password' => bcrypt('123456'),\n 'role' => '1',\n 'avatar' => 'CGnABxNYYn8N23RWlvTTP6C2nRjOLTf8IJcbLqRP.jpeg',\n ]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->call(RoleSeeder::class);\n $this->call(UserSeeder::class);\n\n Medicamento::factory(50)->create();\n Reporte::factory(5)->create();\n Cliente::factory(200)->create();\n Asigna_valor::factory(200)->create();\n Carga::factory(200)->create();\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n TicketSeeder::class\n ]);\n\n DB::table('departments')->insert([\n 'abbr' => 'IT',\n 'name' => 'Information Technologies',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'email_verified_at' => Carbon::now(),\n 'password' => Hash::make('admin'),\n 'department_id' => 1,\n 'avatar' => 'default.png',\n 'created_at' => Carbon::now(),\n 'updated_at' => Carbon::now(),\n ]);\n\n DB::table('role_user')->insert([\n 'role_id' => 1,\n 'user_id' => 1\n ]);\n }", "public function run()\n {\n \\App\\Models\\Article::factory(20)->create();\n \\App\\Models\\Category::factory(5)->create();\n \\App\\Models\\Comment::factory(40)->create();\n\n \\App\\Models\\User::create([\n \"name\"=>\"Alice\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n \\App\\Models\\User::create([\n \"name\"=>\"Bob\",\n \"email\"=>'[email protected]',\n 'password' => Hash::make('password'),\n ]);\n }", "public function run()\n {\n /** \n * Note: You must add these lines to your .env file for this Seeder to work (replace the values, obviously):\n SEEDER_USER_FIRST_NAME = 'Firstname'\n SEEDER_USER_LAST_NAME = 'Lastname'\n\t\tSEEDER_USER_DISPLAY_NAME = 'Firstname Lastname'\n\t\tSEEDER_USER_EMAIL = [email protected]\n SEEDER_USER_PASSWORD = yourpassword\n */\n\t\tDB::table('users')->insert([\n 'user_first_name' => env('SEEDER_USER_FIRST_NAME'),\n 'user_last_name' => env('SEEDER_USER_LAST_NAME'),\n 'user_name' => env('SEEDER_USER_DISPLAY_NAME'),\n\t\t\t'user_email' => env('SEEDER_USER_EMAIL'),\n 'user_status' => 1,\n \t'password' => Hash::make((env('SEEDER_USER_PASSWORD'))),\n 'permission_fk' => 1,\n 'created_at' => Carbon::now()->format('Y-m-d H:i:s'),\n 'updated_at' => Carbon::now()->format('Y-m-d H:i:s')\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class,3)->create()->each(\n \tfunction($user)\n \t{\n \t\t$user->questions()\n \t\t->saveMany(\n \t\t\tfactory(App\\Question::class, rand(2,6))->make()\n \t\t)\n ->each(function ($q) {\n $q->answers()->saveMany(factory(App\\Answer::class, rand(1,5))->make());\n })\n \t}\n );\n }\n}", "public function run()\n {\n $faker = Faker::create();\n\n // $this->call(UsersTableSeeder::class);\n\n DB::table('posts')->insert([\n 'id'=>str_random(1),\n 'user_id'=> str_random(1),\n 'title' => $faker->name,\n 'body' => $faker->safeEmail,\n 'created_at' => date('Y-m-d H:i:s'),\n 'updated_at' => date('Y-m-d H:i:s'),\n ]);\n }", "public function run()\n\t{\n\t\tDB::table(self::TABLE_NAME)->delete();\n\n\t\tforeach (seed(self::TABLE_NAME) as $row)\n\t\t\t$records[] = [\n\t\t\t\t'id'\t\t\t\t=> $row->id,\n\t\t\t\t'created_at'\t\t=> $row->created_at ?? Carbon::now(),\n\t\t\t\t'updated_at'\t\t=> $row->updated_at ?? Carbon::now(),\n\n\t\t\t\t'sport_id'\t\t\t=> $row->sport_id,\n\t\t\t\t'gender_id'\t\t\t=> $row->gender_id,\n\t\t\t\t'tournamenttype_id'\t=> $row->tournamenttype_id ?? null,\n\n\t\t\t\t'name'\t\t\t\t=> $row->name,\n\t\t\t\t'external_id'\t\t=> $row->external_id ?? null,\n\t\t\t\t'is_top'\t\t\t=> $row->is_top ?? null,\n\t\t\t\t'logo'\t\t\t\t=> $row->logo ?? null,\n\t\t\t\t'position'\t\t\t=> $row->position ?? null,\n\t\t\t];\n\n\t\tinsert(self::TABLE_NAME, $records ?? []);\n\t}", "public function run()\n\t{\n\t\tDB::table('libros')->truncate();\n\n\t\t$faker = Faker\\Factory::create();\n\n\t\tfor ($i=0; $i < 10; $i++) { \n\t\t\tLibro::create([\n\n\t\t\t\t'titulo'\t\t=> $faker->text(40),\n\t\t\t\t'isbn'\t\t\t=> $faker->numberBetween(100,999),\n\t\t\t\t'precio'\t\t=> $faker->randomFloat(2,3,150),\n\t\t\t\t'publicado'\t\t=> $faker->numberBetween(0,1),\n\t\t\t\t'descripcion'\t=> $faker->text(400),\n\t\t\t\t'autor_id'\t\t=> $faker->numberBetween(1,3),\n\t\t\t\t'categoria_id'\t=> $faker->numberBetween(1,3)\n\n\t\t\t]);\n\t\t}\n\n\t\t// Uncomment the below to run the seeder\n\t\t// DB::table('libros')->insert($libros);\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 10)->create()->each(function ($user) {\n // Seed the relation with 5 purchases\n // $videos = factory(App\\Video::class, 5)->make();\n // $user->videos()->saveMany($videos);\n // $user->videos()->each(function ($video){\n // \t$video->videometa()->save(factory(App\\VideoMeta::class)->make());\n // \t// :( \n // });\n factory(App\\User::class, 10)->create()->each(function ($user) {\n\t\t\t factory(App\\Video::class, 5)->create(['user_id' => $user->id])->each(function ($video) {\n\t\t\t \tfactory(App\\VideoMeta::class, 1)->create(['video_id' => $video->id]);\n\t\t\t // $video->videometa()->save(factory(App\\VideoMeta::class)->create(['video_id' => $video->id]));\n\t\t\t });\n\t\t\t});\n\n });\n }", "public function run()\n {\n // for($i=1;$i<11;$i++){\n // DB::table('post')->insert(\n // ['title' => 'Title'.$i,\n // 'post' => 'Post'.$i,\n // 'slug' => 'Slug'.$i]\n // );\n // }\n $faker = Faker\\Factory::create();\n \n for($i=1;$i<20;$i++){\n $dname = $faker->name;\n DB::table('post')->insert(\n ['title' => $dname,\n 'post' => $faker->text($maxNbChars = 200),\n 'slug' => str_slug($dname)]\n );\n }\n }", "public function run()\n {\n $this->call([\n CountryTableSeeder::class,\n ProvinceTableSeeder::class,\n TagTableSeeder::class\n ]);\n\n User::factory()->count(10)->create();\n Category::factory()->count(5)->create();\n Product::factory()->count(20)->create();\n Section::factory()->count(5)->create();\n Bundle::factory()->count(20)->create();\n\n $bundles = Bundle::all();\n // populate bundle-product table (morph many-to-many)\n Product::all()->each(function ($product) use ($bundles) {\n $product->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray(),\n ['default_quantity' => rand(1, 10)]\n );\n });\n // populate bundle-tags table (morph many-to-many)\n Tag::all()->each(function ($tag) use ($bundles) {\n $tag->bundles()->attach(\n $bundles->random(2)->pluck('id')->toArray()\n );\n });\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n Contract::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Contract::create([\n 'serialnumbers' => $faker->numberBetween($min = 1000000, $max = 2000000),\n 'address' => $faker->address,\n 'landholder' => $faker->lastName,\n 'renter' => $faker->lastName,\n 'price' => $faker->numberBetween($min = 10000, $max = 50000),\n 'rent_start' => $faker->date($format = 'Y-m-d', $max = 'now'),\n 'rent_end' => $faker->date($format = 'Y-m-d', $max = 'now'),\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker=Faker\\Factory::create();\n\n for($i=0;$i<100;$i++){\n \tApp\\Blog::create([\n \t\t'title' => $faker->catchPhrase,\n 'description' => $faker->text,\n 'showns' =>true\n \t\t]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // TO PREVENT CHECKS FOR foreien key in seeding\n\n User::truncate();\n Category::truncate();\n Product::truncate();\n Transaction::truncate();\n\n DB::table('category_product')->truncate();\n\n User::flushEventListeners();\n Category::flushEventListeners();\n Product::flushEventListeners();\n Transaction::flushEventListeners();\n\n $usersQuantities = 1000;\n $categoriesQuantities = 30;\n $productsQuantities = 1000;\n $transactionsQuantities = 1000;\n\n factory(User::class, $usersQuantities)->create();\n factory(Category::class, $categoriesQuantities)->create();\n\n factory(Product::class, $productsQuantities)->create()->each(\n function ($product) {\n $categories = Category::all()->random(mt_rand(1, 5))->pluck('id');\n $product->categories()->attach($categories);\n });\n\n factory(Transaction::class, $transactionsQuantities)->create();\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(PermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n\n $this->call(BusinessTableSeeder::class);\n $this->call(PrinterTableSeeder::class);\n factory(App\\Tag::class,10)->create();\n factory(App\\Category::class,10)->create();\n factory(App\\Subcategory::class,50)->create();\n factory(App\\Provider::class,10)->create();\n factory(App\\Product::class,24)->create()->each(function($product){\n\n $product->images()->saveMany(factory(App\\Image::class, 4)->make());\n\n });\n\n\n factory(App\\Client::class,10)->create();\n }", "public function run()\n {\n Article::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 50; $i++) {\n Article::create([\n 'name' => $faker->sentence,\n 'sku' => $faker->paragraph,\n 'price' => $faker->number,\n ]);\n }\n }", "public function run()\n {\n Storage::deleteDirectory('public/products');\n Storage::makeDirectory('public/products');\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n $this->call(ProductSeeder::class);\n Order::factory(4)->create();\n Order_Detail::factory(4)->create();\n Size::factory(100)->create();\n }", "public function run()\n {\n $this->call(RolSeeder::class);\n\n $this->call(UserSeeder::class);\n Category::factory(4)->create();\n Doctor::factory(25)->create();\n Patient::factory(50)->create();\n Status::factory(3)->create();\n Appointment::factory(100)->create();\n }", "public function run()\n\t{\n\t\t\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 0');\n\n\t\t$faker = \\Faker\\Factory::create();\n\n\t\tTodolist::truncate();\n\n\t\tforeach(range(1, 50) as $index)\n\t\t{\n\n\t\t\t$user = User::create([\n\t\t\t\t'name' => $faker->name,\n\t\t\t\t'email' => $faker->email,\n\t\t\t\t'password' => 'password',\n\t\t\t\t'confirmation_code' => mt_rand(0, 9),\n\t\t\t\t'confirmation' => rand(0,1) == 1\n\t\t\t]);\n\n\t\t\t$list = Todolist::create([\n\t\t\t\t'name' => $faker->sentence(2),\n\t\t\t\t'description' => $faker->sentence(4),\n\t\t\t]);\n\n\t\t\t// BUILD SOME TASKS FOR EACH LIST ITEM\n\t\t\tforeach(range(1, 10) as $index) \n\t\t\t{\n\t\t\t\t$task = new Task;\n\t\t\t\t$task->name = $faker->sentence(2);\n\t\t\t\t$task->description = $faker->sentence(4);\n\t\t\t\t$list->tasks()->save($task);\n\t\t\t}\n\n\t\t}\n\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS = 1'); \n\n\t}", "public function run()\n {\n Campus::truncate();\n Canteen::truncate();\n Dorm::truncate();\n\n $faker = Faker\\Factory::create();\n $schools = School::all();\n foreach ($schools as $school) {\n \tforeach (range(1, 2) as $index) {\n\t \t$campus = Campus::create([\n\t \t\t'school_id' => $school->id,\n\t \t\t'name' => $faker->word . '校区',\n\t \t\t]);\n\n \t$campus->canteens()->saveMany(factory(Canteen::class, mt_rand(2,3))->make());\n $campus->dorms()->saveMany(factory(Dorm::class, mt_rand(2,3))->make());\n\n }\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n 'name' => 'admin',\n 'email' => '[email protected]',\n 'password' => bcrypt('admin'),\n 'seq_q'=>'1',\n 'seq_a'=>'admin'\n ]);\n\n // DB::table('bloods')->insert([\n // ['name' => 'A+'],\n // ['name' => 'A-'],\n // ['name' => 'B+'],\n // ['name' => 'B-'],\n // ['name' => 'AB+'],\n // ['name' => 'AB-'],\n // ['name' => 'O+'],\n // ['name' => 'O-'],\n // ]);\n\n \n }", "public function run()\n {\n // $this->call(UserTableSeeder::class);\n \\App\\User::create([\n 'name'=>'PAPE SAMBA NDOUR',\n 'email'=>'[email protected]',\n 'password'=>bcrypt('Admin1122'),\n ]);\n\n $faker = Faker::create();\n\n for ($i = 0; $i < 100 ; $i++)\n {\n $firstName = $faker->firstName;\n $lastName = $faker->lastName;\n $niveau = \\App\\Niveau::inRandomOrder()->first();\n \\App\\Etudiant::create([\n 'prenom'=>$firstName,\n 'nom'=>$lastName,\n 'niveau_id'=>$niveau->id\n ]);\n }\n\n\n }", "public function run()\n {\n //\n DB::table('foods')->delete();\n\n Foods::create(array(\n 'name' => 'Chicken Wing',\n 'author' => 'Bambang',\n 'overview' => 'a deep-fried chicken wing, not in spicy sauce'\n ));\n\n Foods::create(array(\n 'name' => 'Beef ribs',\n 'author' => 'Frank',\n 'overview' => 'Slow baked beef ribs rubbed in spices'\n ));\n\n Foods::create(array(\n 'name' => 'Ice cream',\n 'author' => 'Lou',\n 'overview' => ' A sweetened frozen food typically eaten as a snack or dessert.'\n ));\n\n }", "public function run()\n {\n // Let's truncate our existing records to start from scratch.\n News::truncate();\n\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 10; $i++) {\n News::create([\n 'title' => $faker->sentence,\n 'summary' => $faker->sentence,\n 'content' => $faker->paragraph,\n 'imagePath' => '/img/exclamation_mark.png'\n ]);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(App\\User::class, 3)->create();\n factory(App\\Models\\Category::class, 3)\n ->create()\n ->each(function ($u) {\n $u->courses()->saveMany(factory(App\\Models\\Course::class,3)->make())->each(function ($c){\n $c->exams()->saveMany(factory(\\App\\Models\\Exam::class,3)->make())->each(function ($e){\n $e->questions()->saveMany(factory(\\App\\Models\\Question::class,4)->make())->each(function ($q){\n $q->answers()->saveMany(factory(\\App\\Models\\Answer::class,4)->make())->each(function ($a){\n $a->correctAnswer()->save(factory(\\App\\Models\\Correct_answer::class)->make());\n });\n });\n });\n });\n\n });\n\n }", "public function run()\n {\n \\DB::table('employees')->delete();\n\n $faker = \\Faker\\Factory::create('ja_JP');\n\n $role_id = ['1','2','3'];\n\n for ($i = 0; $i < 10; $i++) {\n \\App\\Models\\Employee::create([\n 'last_name' =>$faker->lastName() ,\n 'first_name' => $faker->firstName(),\n 'mail' => $faker->email(),\n 'password' => Hash::make( \"password.$i\"),\n 'birthday' => $faker->date($format='Y-m-d',$max='now'),\n 'role_id' => $faker->randomElement($role_id)\n ]);\n }\n }", "public function run()\n {\n\n DB::table('clients')->delete();\n DB::table('trips')->delete();\n error_log('empty tables done.');\n\n $random_cities = City::inRandomOrder()->select('ar_name')->limit(5)->get();\n $GLOBALS[\"random_cities\"] = $random_cities->pluck('ar_name')->toArray();\n\n $random_airlines = Airline::inRandomOrder()->select('code')->limit(5)->get();\n $GLOBALS[\"random_airlines\"] = $random_airlines->pluck('code')->toArray();\n\n factory(App\\Client::class, 5)->create();\n error_log('Client seed done.');\n\n\n factory(App\\Trip::class, 50)->create();\n error_log('Trip seed done.');\n\n\n factory(App\\Quicksearch::class, 10)->create();\n error_log('Quicksearch seed done.');\n }", "public function run()\n {\n // Admins\n User::factory()->create([\n 'name' => 'Zaiman Noris',\n 'username' => 'rognales',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n User::factory()->create([\n 'name' => 'Affiq Rashid',\n 'username' => 'affiqr',\n 'email' => '[email protected]',\n 'active' => true,\n ]);\n\n // Only seed test data in non-prod\n if (! app()->isProduction()) {\n Member::factory()->count(1000)->create();\n Staff::factory()->count(1000)->create();\n\n Participant::factory()\n ->addSpouse()\n ->addChildren()\n ->addInfant()\n ->addOthers()\n ->count(500)\n ->hasUploads(2)\n ->create();\n }\n }", "public function run()\n {\n $this->call([\n RoleSeeder::class,\n UserSeeder::class,\n ]);\n\n \\App\\Models\\Category::factory(4)->create();\n \\App\\Models\\View::factory(6)->create();\n \\App\\Models\\Room::factory(8)->create();\n \n $rooms = \\App\\Models\\Room::all();\n // \\App\\Models\\User::all()->each(function ($user) use ($rooms) { \n // $user->rooms()->attach(\n // $rooms->random(rand(1, \\App\\Models\\Room::max('id')))->pluck('id')->toArray()\n // ); \n // });\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n Employee::factory()->create(['email' => '[email protected]']);\n Brand::factory()->count(3)->create();\n $this->call([\n TagSeeder::class,\n AttributeSeeder::class,\n AttributeValueSeeder::class,\n ProductSeeder::class,\n ]);\n }", "public function run()\n {\n $this->call(RolesTableSeeder::class); // crée les rôles\n $this->call(PermissionsTableSeeder::class); // crée les permissions\n\n factory(Employee::class,3)->create();\n factory(Provider::class,1)->create();\n\n $user = User::create([\n 'name'=>'Alioune Bada Ndoye',\n 'email'=>'[email protected]',\n 'phone'=>'773012470',\n 'password'=>bcrypt('123'),\n ]);\n Employee::create([\n 'job'=>'Informaticien',\n 'user_id'=>User::where('email','[email protected]')->first()->id,\n 'point_id'=>Point::find(1)->id,\n ]);\n $user->assignRole('admin');\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(User::class, 1)\n \t->create(['email' => '[email protected]']);\n\n factory(Category::class, 5)->create();\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n $this->call(rootSeed::class);\n factory(App\\Models\\Egresado::class,'hombre',15)->create();\n factory(App\\Models\\Egresado::class,'mujer',15)->create();\n factory(App\\Models\\Administrador::class,5)->create();\n factory(App\\Models\\Notificacion::class,'post',10)->create();\n factory(App\\Models\\Notificacion::class,'mensaje',5)->create();\n factory(App\\Models\\Egresado::class,'bajaM',5)->create();\n factory(App\\Models\\Egresado::class,'bajaF',5)->create();\n factory(App\\Models\\Egresado::class,'suscritam',5)->create();\n factory(App\\Models\\Egresado::class,'suscritaf',5)->create();\n }", "public function run()\n {\n \n User::factory(1)->create([\n 'rol'=>'EPS'\n ]);\n Person::factory(10)->create();\n $this->call(EPSSeeder::class);\n $this->call(OfficialSeeder::class);\n $this->call(VVCSeeder::class);\n $this->call(VaccineSeeder::class);\n }", "public function run()\n {\n // $faker=Faker::create();\n // foreach(range(1,100) as $index)\n // {\n // DB::table('products')->insert([\n // 'name' => $faker->name,\n // 'price' => rand(10,100000)/100\n // ]);\n // }\n }", "public function run()\n {\n $this->call([\n LanguagesTableSeeder::class,\n ListingAvailabilitiesTableSeeder::class,\n ListingTypesTableSeeder::class,\n RoomTypesTableSeeder::class,\n AmenitiesTableSeeder::class,\n UsersTableSeeder::class,\n UserLanguagesTableSeeder::class,\n ListingsTableSeeder::class,\n WishlistsTableSeeder::class,\n StaysTableSeeder::class,\n GuestsTableSeeder::class,\n TripsTableSeeder::class,\n ReviewsTableSeeder::class,\n RatingsTableSeeder::class,\n PopularDestinationsTableSeeder::class,\n ImagesTableSeeder::class,\n ]);\n\n // factory(App\\User::class, 5)->states('host')->create();\n // factory(App\\User::class, 10)->states('hostee')->create();\n\n // factory(App\\User::class, 10)->create();\n // factory(App\\Models\\Listing::class, 30)->create();\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n Grade::truncate();\n Schema::enableForeignKeyConstraints();\n\n $faker = \\Faker\\Factory::create();\n\n for ($i = 0; $i < 10; $i++) {\n Grade::create([\n 'letter' => $faker->randomElement(['а', 'б', 'в']),\n 'school_id' => $faker->unique()->numberBetween(1, School::count()),\n 'level' => 1\n ]);\n }\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n factory(App\\User::class,5)->create();//5 User created\n factory(App\\Model\\Genre::class,5)->create();//5 genres\n factory(App\\Model\\Film::class,6)->create();//6 films\n factory(App\\Model\\Comment::class, 20)->create();// 20 comments\n }", "public function run()\n {\n\n $this->call(UserSeeder::class);\n factory(Empresa::class,10)->create();\n factory(Empleado::class,50)->create();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n User::create([\n 'name' => 'jose luis',\n 'email' => '[email protected]',\n 'password' => bcrypt('xxxxxx'),\n 'role' => 'admin',\n ]);\n\n Category::create([\n 'name' => 'inpods',\n 'description' => 'auriculares inalambricos que funcionan con blouthue genial'\n ]);\n\n Category::create([\n 'name' => 'other',\n 'description' => 'otra cosa diferente a un inpods'\n ]);\n\n\n /* Create 10 products */\n Product::factory(10)->create();\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Russell'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Bitfumes'\n ]);\n\n factory(User::class)->create([\n 'email' => '[email protected]',\n 'name' => 'Paul'\n ]);\n }", "public function run()\n {\n $user_ids = [1,2,3];\n $faker = app(\\Faker\\Generator::class);\n $posts = factory(\\App\\Post::class)->times(50)->make()->each(function($post) use ($user_ids,$faker){\n $post->user_id = $faker->randomElement($user_ids);\n });\n \\App\\Post::insert($posts->toArray());\n }", "public function run()\n {\n // Vaciar la tabla.\n Favorite::truncate();\n $faker = \\Faker\\Factory::create();\n // Crear artículos ficticios en la tabla\n\n // factory(App\\Models\\User::class, 2)->create()->each(function ($user) {\n // $user->users()->saveMany(factory(App\\Models\\User::class, 25)->make());\n //});\n }", "public function run()\n\t{\n\t\t$this->call(ProductsTableSeeder::class);\n\t\t$this->call(CategoriesTableSeeder::class);\n\t\t$this->call(BrandsTableSeeder::class);\n\t\t$this->call(ColorsTableSeeder::class);\n\n\t\t$products = \\App\\Product::all();\n \t$categories = \\App\\Category::all();\n \t$brands = \\App\\Brand::all();\n \t$colors = \\App\\Color::all();\n\n\t\tforeach ($products as $product) {\n\t\t\t$product->colors()->sync($colors->random(3));\n\n\t\t\t$product->category()->associate($categories->random(1)->first());\n\t\t\t$product->brand()->associate($brands->random(1)->first());\n\n\t\t\t$product->save();\n\t\t}\n\n\t\t// for ($i = 0; $i < count($products); $i++) {\n\t\t// \t$cat = $categories[rand(0,5)];\n\t\t// \t$bra = $brands[rand(0,7)];\n\t\t// \t$cat->products()->save($products[$i]);\n\t\t// \t$bra->products()->save($products[$i]);\n\t\t// }\n\n\t\t// $products = factory(App\\Product::class)->times(20)->create();\n\t\t// $categories = factory(App\\Category::class)->times(6)->create();\n\t\t// $brands = factory(App\\Brand::class)->times(8)->create();\n\t\t// $colors = factory(App\\Color::class)->times(15)->create();\n\t}", "public function run()\n {\n /*$this->call(UsersTableSeeder::class);\n $this->call(GroupsTableSeeder::class);\n $this->call(TopicsTableSeeder::class);\n $this->call(CommentsTableSeeder::class);*/\n DB::table('users')->insert([\n 'name' => 'pkw',\n 'email' => '[email protected]',\n 'password' => bcrypt('secret'),\n 'type' => '1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $faker = Faker::create();\n foreach (range(1,200) as $index) {\n DB::table('users')->insert([\n 'name' => $faker->name,\n 'email' => $faker->email,\n 'phone' => $faker->randomDigitNotNull,\n 'address'=> $faker->streetAddress,\n 'password' => bcrypt('secret'),\n ]);\n }\n }", "public function run()\n {\n $this->call(UsersSeeder::class);\n User::factory(2)->create();\n Company::factory(2)->create();\n\n }", "public function run()\n {\n echo PHP_EOL , 'seeding roles...';\n\n Role::create(\n [\n 'name' => 'Admin',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Principal',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Teacher',\n 'deletable' => false,\n ]\n );\n\n Role::create(\n [\n 'name' => 'Student',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Parents',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Accountant',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Librarian',\n 'deletable' => false,\n ]\n );\n Role::create(\n [\n 'name' => 'Receptionist',\n 'deletable' => false,\n ]\n );\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // $this->call(QuestionTableSeed::class);\n\n $this->call([\n QuestionTableSeed::class,\n AlternativeTableSeed::class,\n ScheduleActionTableSeeder::class,\n UserTableSeeder::class,\n CompanyClassificationTableSeed::class,\n ]);\n // DB::table('clients')->insert([\n // 'name' => 'Empresa-02',\n // 'email' => '[email protected]',\n // 'password' => bcrypt('07.052.477/0001-60'),\n // ]);\n }", "public function run()\n {\n $faker = \\Faker\\Factory::create();\n\n // And now, let's create a few articles in our database:\n for ($i = 0; $i < 5; $i++) {\n Runner::create([\n 'external_id' => $faker->uuid,\n 'name' => $faker->name,\n 'race_id' =>rand(1,5),\n 'age' => rand(30, 45),\n 'sex' => $faker->randomElement(['male', 'female']),\n 'color' => $faker->randomElement(['#ecbcb4', '#d1a3a4']),\n ]);\n }\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n User::factory()->create([\n 'name' => 'Carlos',\n 'email' => '[email protected]',\n 'email_verified_at' => now(),\n 'password' => bcrypt('123456'), // password\n 'remember_token' => Str::random(10),\n ]);\n \n $this->call([PostsTableSeeder::class]);\n $this->call([TagTableSeeder::class]);\n\n }", "public function run()\n {\n $this->call(AlumnoSeeder::class);\n //Alumnos::factory()->count(30)->create();\n //DB::table('alumnos')->insert([\n // 'dni_al' => '13189079',\n // 'nom_al' => 'Jose',\n // 'ape_al' => 'Araujo',\n // 'rep_al' => 'Principal',\n // 'esp_al' => 'Tecnologia',\n // 'lnac_al' => 'Valencia'\n //]);\n }", "public function run()\n {\n Eloquent::unguard();\n\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n // $this->call([\n // CountriesTableSeeder::class,\n // ]);\n\n factory(App\\User::class, 100)->create();\n factory(App\\Type::class, 10)->create();\n factory(App\\Item::class, 100)->create();\n factory(App\\Order::class, 1000)->create();\n\n $items = App\\Item::all();\n\n App\\Order::all()->each(function($order) use ($items) {\n\n $n = rand(1, 10);\n\n $order->items()->attach(\n $items->random($n)->pluck('id')->toArray()\n , ['quantity' => $n]);\n\n $order->total = $order->items->sum(function($item) {\n return $item->price * $item->pivot->quantity;\n });\n\n $order->save();\n\n });\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'izzanni',\n \n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'aina',\n\n ]\n );\n factory(User::class)->create(\n [\n 'email'=>'[email protected]',\n 'name'=>'sab',\n\n ]\n );\n }", "public function run()\n {\n\n factory('App\\Models\\Pessoa', 60)->create();\n factory('App\\Models\\Profissional', 10)->create();\n factory('App\\Models\\Paciente', 50)->create();\n $this->call(UsersTableSeeder::class);\n $this->call(ProcedimentoTableSeeder::class);\n // $this->call(PessoaTableSeeder::class);\n // $this->call(ProfissionalTableSeeder::class);\n // $this->call(PacienteTableSeeder::class);\n // $this->call(AgendaProfissionalTableSeeder::class);\n }", "public function run()\n {\n //Acá se define lo que el seeder va a hacer.\n //insert() para insertar datos.\n //Array asociativo. La llave es el nombre de la columna.\n// DB::table('users')->insert([\n// //Para un solo usuario.\n// 'name' => 'Pedrito Perez',\n// 'email' => '[email protected]',\n// 'password' => bcrypt('123456')\n// ]);//Se indica el nombre de la tabla.\n\n //Crea 50 usuarios (sin probar)\n// factory(App\\User::class, 50)->create()->each(function($u) {\n// $u->posts()->save(factory(App\\Post::class)->make());\n// });\n\n factory(App\\User::class, 10)->create(); //Así se ejecuta el model factory creado en ModelFactory.php\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n //nhập liệu mẫu cho bảng users\n DB::table('users')->insert([\n \t['id'=>'1001', 'name'=>'Phan Thị Hiền', 'email'=>'[email protected]', 'password'=>'123456', 'isadmin'=>1],\n \t['id'=>'1002', 'name'=>'Phan Thị Hà', 'email'=>'[email protected]', 'password'=>'111111', 'isadmin'=>0]\n ]);\n\n\n //nhập liệu mẫu cho bảng suppliers\n DB::table('suppliers')->insert([\n \t['name'=>'FPT', 'address'=>'151 Hùng Vương, TP. Đà Nẵng', 'phonenum'=>'0971455395'],\n \t['name'=>'Điện Máy Xanh', 'address'=>'169 Phan Châu Trinh, TP. Đà Nẵng', 'phonenum'=>'0379456011']\n ]);\n\n\n //Bảng phiếu bảo hành\n }", "public function run()\n {\n \t// DB::table('categories')->truncate();\n // factory(App\\Models\\Category::class, 10)->create();\n Schema::disableForeignKeyConstraints();\n Category::truncate();\n $faker = Faker\\Factory::create();\n\n $categories = ['SAMSUNG','NOKIA','APPLE','BLACK BERRY'];\n foreach ($categories as $key => $value) {\n Category::create([\n 'name'=>$value,\n 'description'=> 'This is '.$value,\n 'markup'=> rand(10,100),\n 'category_id'=> null,\n 'UUID' => $faker->uuid,\n ]);\n }\n }" ]
[ "0.8013876", "0.79804534", "0.7976992", "0.79542726", "0.79511505", "0.7949612", "0.794459", "0.7942486", "0.7938189", "0.79368967", "0.79337025", "0.78924936", "0.78811055", "0.78790957", "0.78787595", "0.787547", "0.7871811", "0.78701615", "0.7851422", "0.7850352", "0.7841468", "0.7834583", "0.7827792", "0.7819104", "0.78088796", "0.7802872", "0.7802348", "0.78006834", "0.77989215", "0.7795819", "0.77903426", "0.77884805", "0.77862066", "0.7778816", "0.7777486", "0.7765202", "0.7762492", "0.77623445", "0.77621746", "0.7761383", "0.77606887", "0.77596676", "0.7757001", "0.7753607", "0.7749522", "0.7749292", "0.77466977", "0.7729947", "0.77289546", "0.772796", "0.77167094", "0.7714503", "0.77140456", "0.77132195", "0.771243", "0.77122366", "0.7711113", "0.77109736", "0.7710777", "0.7710086", "0.7705484", "0.770464", "0.7704354", "0.7704061", "0.77027386", "0.77020216", "0.77008796", "0.7698617", "0.76985973", "0.76973504", "0.7696405", "0.7694293", "0.7692694", "0.7691264", "0.7690576", "0.76882726", "0.7687433", "0.7686844", "0.7686498", "0.7685065", "0.7683827", "0.7679184", "0.7678287", "0.76776296", "0.76767945", "0.76726556", "0.76708084", "0.76690495", "0.766872", "0.76686716", "0.7666299", "0.76625943", "0.7662227", "0.76613766", "0.7659881", "0.7656644", "0.76539344", "0.76535016", "0.7652375", "0.7652313", "0.7652022" ]
0.0
-1
/ notify all observers about any change in SunSubject
function notify() { foreach ($this->observers as $obKey => $obValue) { $obValue->update($this); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function notify() {\n\t\tforeach($this->_observers as $key => $val) {\n\t\t\t$val->update($this);\n\t\t}\n\t}", "public function notify(){\n foreach ($this->observers as $observer){\n $observer->update();\n }\n }", "public function notifyObservers() {\n\t\tforeach ( $this->observers as $obs => $key )\n\t\t\t$key->update ( $this->actTemp, $this->maxTemp, $this->minTemp, $this->actPressure );\n\t}", "public function notify()\n {\n foreach ($this->observers as $value) {\n $value->update($this);\n }\n }", "function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update($this);\n }\n }", "public function notify()\n\t{\n\t\tforeach ($this->observers as $obs)\n\t\t{\n\t\t\t$obs->update($this);\n\t\t}\n\t}", "public function notify()\r\n {\r\n foreach( $this->observers as $observer )\r\n $observer->update( $this );\r\n\r\n }", "public function notify() {\n // Updates all classes subscribed to this object\n foreach ($this->observers as $obs) {\n $obs->update($this);\n }\n }", "public function notify()\n {\n foreach ($this->observers as $observer) {\n $observer->update();\n }\n }", "public function notifyObservers()\n {\n foreach ($this->observers as $obj) {\n $obj->update(\n $this->temperature,\n $this->humidity,\n $this->pressure\n );\n }\n }", "public function notify()\n {\n foreach ($this->_observers as $observer) {\n $observer->update($this);\n }\n }", "public function notify() {\n $this->observers->rewind();\n while($this->observers->valid()) {\n $object = $this->observers->current();\n // dump($object);die;\n $object->update($this);\n $this->observers->next();\n }\n }", "function update(AbstractSubject $subject)\n {\n write_in(\"Alert to observer\");\n write_in($subject->favorite);\n }", "public function notify()\n {\n foreach($this->_storage AS $observer) {\n $observer->update($this);\n }\n }", "public function notify()\n {\n $eventName = $this->getEventName();\n if (empty($this->observers[$eventName])) {\n $observerNames = Model::factory('Observer')->getByEventName($eventName);\n foreach ($observerNames as $observerName) {\n $this->observers[$eventName][] = new $observerName();\n }\n }\n if (!empty($this->observers[$eventName])) {\n foreach ($this->observers[$eventName] as $observer) {\n $observer->update($this);\n }\n }\n }", "public function observers();", "public function notify()\n {\n foreach ($this->storage as $obs){\n $obs->update($this);\n }\n }", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function update(\\SplSubject $SplSubject) {}", "public function notifyObserver()\n {\n if (!empty($this->observers)) {\n foreach ($this->observers as $observer) {\n $observer->update($this->getTemperature(), $this->getPressure(), $this->getHumidity());\n }\n }\n }", "protected function _syncSubject() {}", "public function update(\\SplSubject $subject) {}", "public function _update()\n\t {\n\t \t$this->notifyObservers(__FUNCTION__);\n\t }", "public function update(SubjectInterface $subject): void;", "public function update(SplSubject $subject)\n {\n // TODO: Implement update() method.\n print_r($subject);\n}", "public function update(\\SplSubject $subject)\n {\n $this->changedUsers[] = clone $subject;\n }", "public function update(SplSubject $publisher){\r\n \r\n }", "public function observe() {}", "public function testObserversAreUpdated()\n {\n // only mock the update() method.\n $observer = $this->getMockBuilder('Company\\Product\\Observer')\n ->setMethods(array('update'))\n ->getMock();\n\n // Set up the expectation for the update() method\n // to be called only once and with the string 'something'\n // as its parameter.\n $observer->expects($this->once())\n ->method('update')\n ->with($this->equalTo('something'));\n\n // Create a Subject object and attach the mocked\n // Observer object to it.\n $subject = new \\Company\\Product\\Subject('My subject');\n $subject->attach($observer);\n\n // Call the doSomething() method on the $subject object\n // which we expect to call the mocked Observer object's\n // update() method with the string 'something'.\n $subject->doSomething();\n }", "public function update(SplSubject $subject)\n {\n $this->changeUsers[] = clone $subject;\n }", "public abstract function subscribe(Subject $subject);", "public function visit(SubjectInterface $subject)\n {\n\n // load the observers from the configuration\n $availableObservers = $subject->getConfiguration()->getObservers();\n\n // prepare the observers\n foreach ($availableObservers as $observers) {\n $this->prepareObservers($subject, $observers);\n }\n }", "public function update (SplSubject $subject)\n {\n $this->_subject = $subject;\n $this->display();\n }", "public function measurementsChanged()\n {\n $this->notifyObservers();\n }", "public function measurementsChanged(): void\n {\n $this->notifyObservers();\n }", "public function update(\\SplSubject $subject)\n {\n foreach ($subject->getCreated() as $created) {\n if ($created->isDir()\n and !$this->_inotify->isWatching($created->getPathname())) {\n $this->_inotify->recursiveWatch($created->getPathname());\n }\n }\n }", "public function update(SplSubject $subject)\n {\n echo 1;\n }", "public function update(SubjectInterface $subject);", "public function updateObserver (Observable $subject) {\n /* @var $subject Repository\\AbstractRepository */\n $measureId = $subject->getMeasureId();\n $executor = $this->_commander->getExecutor(__CLASS__)->clean(); /* @var $executor Executor */\n\n $executor->add('getMeasure', $this->_measureService)\n ->getResult()\n ->setMeasureId($measureId)\n ->setType(Type::MYSQL);\n\n $measure = $executor->execute()->getData(); /* @var $measure Entity\\Measure */\n $testId = $measure->getTestId();\n\n $executor->clean()\n ->add('updateTestState', $this->_testService)\n ->getResult()\n ->setTestId($testId);\n $executor->execute();\n\n return true;\n }", "public function updated(Subject $subject)\n {\n if ($subject->isDirty(['code','name'])){\n $this->updateHasChange($subject,1);\n }\n }", "public function collectSubscribers();", "public function _postUpdate()\n\t{\n\t\t$this->notifyObservers(__FUNCTION__);\n\t}", "public function subscribes();", "public static function getObservers()\n\t{\n\t\t$observers = self::$_observers;\n\t\treturn $observers;\n\t}", "public function update(SplSubject $subject)\n {\n echo 2;\n }", "public function createObserver(SubjectInterface $subject);", "public function update(\\SplSubject $subject)\n {\n if($subject === $this->login){\n $this->doUpdate($subject);\n }\n }", "public function update($subject) {\n prinft(\"State Change, new subject: %s\", $subject);\n }", "public static function ReconfigureObservers()\r\n\t\t{\r\n\t\t\tif (!self::$observersSetuped)\r\n\t\t\t\tself::setupObservers();\r\n\t\t\t\r\n\t\t\tforeach (self::$EventObservers as &$observer)\r\n\t\t\t{\r\n\t\t\t\tif (method_exists($observer, \"__construct\"))\r\n\t\t\t\t\t$observer->__construct();\r\n\t\t\t}\r\n\t\t}", "public function getObservers()\n {\n return $this->observers;\n }", "public function getObservers()\n {\n return $this->observers;\n }", "protected function notifyMatched(Subject $subject, array $descriptors)\n {\n $this->getNotifier()->notifyMatched($subject, $descriptors);\n }", "protected function setSubject() {}", "protected function notifyAll()\n\t{\n\t\t$this->notifyBorrowers();\n\t\t$this->notifyLenders();\n\t}", "function notify($event) {\r\n\t\tif ( count($this->_listeners) > 0 ) {\r\n\t\t\tif ( false ) $listener = new ftpClientObserver();\r\n\t\t\tforeach ( $this->_listeners as $id => $listener ) {\r\n\t\t\t\t$listener->notify($event);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public function notify()\n {\n // @TODO: Needs to handle the various types of bounces: References, Recommendations, and general bounces that should be purged\n }", "public function subscribe();", "public function get_observers() : array\n\t{\n\t\treturn $this->_observers;\n\t}", "public function notifyObservers() {\n \n // Iterate through observer list\n foreach ($this->observers as $observer) {\n \n // Call notify on observer\n $observer->notify();\n \n }\n \n // Implement fluent interface\n return $this;\n }", "public function notify() {}", "public function notify() {}", "public function notify() {}", "public function forceSynchonization()\n {\n $observer = App::make(ObserverContract::class);\n\n $observer->forceSynchonization($this);\n }", "public function observers()\n {\n return $this->observers;\n }", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function attach(\\SplObserver $observer) {}", "public function setSubject($subject);", "public function setSubject($subject);", "public function setSubject($subject);", "public function notify($event, $subject = null, $params = array());", "public function run()\n {\n Subject::unguard();\n $this->data()->each(function($data) {\n Subject::create($data);\n });\n Subject::reguard();\n }", "public function notify( mixed $extras = null ) : IObservable\n {\n\n if ( 1 < \\count( $this->_cache ) )\n {\n $this->_cache[] = $extras;\n }\n else\n {\n $this->_cache = $extras;\n }\n\n foreach ( $this->_observers as $ob )\n {\n $ob->onUpdate( $this, $this->_cache );\n }\n\n $this->_cache = [];\n\n return $this;\n\n }", "public function onAfterPublish()\n {\n\t\t$context = [\n PublishingEngine::CONTEXT_ACTION => PublishingEngine::CONTEXT_ACTION_PUBLISH\n\t\t];\n\t\t$this->collectChanges($context);\n\t\t$this->flushChanges();\n\t}", "public function notify($type, \\Phalcon\\Mvc\\CollectionInterface $model){ }", "protected function emitPackagesMayHaveChangedSignal() {}", "protected function emitPackagesMayHaveChangedSignal() {}", "protected function emitPackagesMayHaveChangedSignal() {}", "public function updateSubjects() {\n\n\t\t\t$sql = new DB_Sql();\n\t\t\t$sql->connect();\n\n\t\t\t// update news and event subject topic code assignments\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'CONSTRBUI' WHERE text = 'BUILDSERV'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'CONSTRBUI' WHERE text = 'CNSTRCRAFT'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'ENGMATHICT' WHERE text = 'ENGMATH'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'HAIRBEAU' WHERE text = 'HAIRBEAUSP'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'FORGNLANG' WHERE text = 'MODERNLANG'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'APMEDFRSCI' WHERE text = 'SCIENCES'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'N/A' WHERE text = 'SOCSCIENCE'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'N/A' WHERE text = 'TU'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE webmatrix_extra_checkboxgroup SET text = 'N/A' WHERE text = 'YNGPEOPCOL'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// update tblunit courses to use their new sujbect topic codes\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'CONSTRBUI' WHERE Subject_ID = 'BUILDSERV'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'CONSTRBUI' WHERE Subject_ID = 'CNSTRCRAFT'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'ENGMATHICT' WHERE Subject_ID = 'ENGMATH'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'HAIRBEAU' WHERE Subject_ID = 'HAIRBEAUSP'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'FORGNLANG' WHERE Subject_ID = 'MODERNLANG'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'APMEDFRSCI' WHERE Subject_ID = 'SCIENCES'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'N/A' WHERE Subject_ID = 'SOCSCIENCE'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'N/A' WHERE Subject_ID = 'TU'\";\n\t\t\t$sql->query($query, $this->debug);\n\t\t\t$query = \"UPDATE tblunits SET Subject_ID = 'N/A' WHERE Subject_ID = 'YNGPEOPCOL'\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t// Delete invalid subjects - will not delete any courses or assignments as we've updated them to use correct topic codes in previous steps\n\t\t\t$query = \"DELETE FROM tblsubject WHERE ID IN ('BUILDSERV','CNSTRCRAFT','ENGMATH','HAIRBEAUSP','MODERNLANG','SCIENCES','SOCSCIENCE','YNGPEOPCOL','TU')\";\n\t\t\t$sql->query($query, $this->debug);\n\n\t\t\t$query = \"DESCRIBE tblfees\";\n\t\t\t$sql->query($query, $debug = FALSE);\n\t\t\tif ($sql->num_rows() > 0) {\n\t\t\t\t$this->deleteOldTables(); // if old tables found: delete them\n\t\t\t}\n\n\t\t\t// Now we've updated courses - search for existing webmatrix pages using subject codes not in valid list - if found de-activate them.\n\t\t\t//$this->deleteInvalidSubjectPages();\n\n\t\t}", "public function visit(SubjectInterface $subject);", "function setSubject($subject)\n {\n $this->_subject = $subject;\n }", "public function subscribe(): void;", "function notify();", "public function broadcastOn()\n {\n return ['RecordChanges'];\n }", "public static function observe( &$varname )\n\t\t{\n\t\t\t$this->observer_list[] =& $var;\n\t\t}", "protected function notifyObservers($event_type_key, $date_occurred, $event_amount, $track_key, $space_key)\n\t{\n\t\tforeach ($this->observers as $d)\n\t\t{\n\t\t\t$d->invoke($this, $event_type_key, $date_occurred, $event_amount, $track_key, $space_key);\n\t\t}\n\t}", "protected function notify_changes_saved() {\n $this->notify->good('gradessubmitted');\n }", "private function registerSubscribers()\n {\n $extensions = $this->dataGridFactory->getExtensions();\n\n foreach ($extensions as $extension) {\n $extension->registerSubscribers($this);\n }\n }", "public function notifyObservers($method, $msg = null)\n\t{\n\t\t$observers = self::$_observers;\n\n\t\t// loop through observers and notify each available observer method\n\t\tforeach ($observers as $obs) {\n\t\t\tif (is_callable(array($obs, $method))) {\n\t\t\t\t$obs->$method($this, $msg);\n\t\t\t}\n\t\t}\n\t}", "public function attachAllHitStatObservers()\n\t{\n\t\t$event_log = new Stats_OLP_Observe_Eventlog();\n\t\t$event_log->observeHitStat($this);\n\t}", "public function set_subject($subject);", "abstract public function subject($subject);", "public function testChangesSinkEvents()\r\n\t{\r\n\t\t$this->backend->ChangesSinkInitialize(\"calendar_root\");\r\n\r\n\t\t// Initialize and remove any stats and ignore existing messages\r\n\t\t$collection = $this->backend->getSyncCollection(\"calendar_root\");\r\n\t\t$collection->fastForwardToHead();\r\n\r\n\t\t// Get changes for calendar - should be 0 because we reset above\r\n\t\t$changedFolders = $this->backend->ChangesSink(10);\r\n\t\t$this->assertEquals(0, count($changedFolders));\r\n\r\n\t\t// Create a dummy email message which will add the to stats\r\n\t\t$obj = CAntObject::factory($this->dbh, \"calendar_event\", null, $this->user);\r\n\t\t$obj->setValue(\"name\", \"My Test Event\");\r\n\t\t$obj->setValue(\"ts_start\", date(\"m/d/Y\") . \" 12:00 PM\");\r\n\t\t$obj->setValue(\"ts_end\", date(\"m/d/Y\") . \" 01:00 PM\");\r\n\t\t$mid = $obj->save();\r\n\r\n\t\t// Get changes for Inbox - should be 1\r\n\t\t$changedFolders = $this->backend->ChangesSink(10);\r\n\t\t$this->assertEquals(1, count($changedFolders));\r\n\r\n\t\t// Cleanup\r\n\t\t$obj->removeHard();\r\n\t}" ]
[ "0.721787", "0.72162306", "0.7122913", "0.71227336", "0.70694596", "0.70157844", "0.6984043", "0.6982503", "0.6939297", "0.691533", "0.68791705", "0.68739194", "0.6785612", "0.6515169", "0.6510684", "0.6427568", "0.64262956", "0.6423259", "0.6423259", "0.6423259", "0.6423259", "0.64221597", "0.64221597", "0.6352937", "0.63463515", "0.6319114", "0.6317779", "0.61526823", "0.61013836", "0.6089001", "0.5919129", "0.5908265", "0.5845009", "0.581844", "0.57869726", "0.5761775", "0.5757502", "0.57547116", "0.5746167", "0.57453454", "0.56970775", "0.5690467", "0.5659821", "0.56548154", "0.56343395", "0.5609245", "0.5596302", "0.55423117", "0.5528734", "0.5510478", "0.5487105", "0.5442869", "0.54344016", "0.5426003", "0.5426003", "0.5420537", "0.54057604", "0.540527", "0.53343934", "0.5300239", "0.52427226", "0.5226152", "0.52202034", "0.521778", "0.521778", "0.521778", "0.5210057", "0.51556593", "0.51396894", "0.51396894", "0.51396894", "0.5139654", "0.5139654", "0.5139654", "0.51284426", "0.51284426", "0.51284426", "0.51044357", "0.50964594", "0.5054871", "0.5054689", "0.5049628", "0.50487834", "0.50487834", "0.50487834", "0.50445056", "0.5021595", "0.50115514", "0.5010755", "0.50050926", "0.50045896", "0.49819374", "0.49623767", "0.49547625", "0.49458417", "0.49442193", "0.49246067", "0.4920164", "0.49180576", "0.4899541" ]
0.7238421
0
Display a listing of the resource.
public function index() { $tracings = Tracing::latest()->paginate(10); return view('Tracing.index', compact('tracings')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { return view('Tracing.create'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { request()->validate([ 'type'=>'required', 'reason'=>'required', 'observation'=>'required', 'tutor_c_id'=>'required', ]); Tracing::create($request->all()); return redirect()->route('Tracing.index')->with('success','Registro creado correctamente.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { $tracings = Tracing::find($id); return view('Tracing.show', compact('tracings')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $tracings = Tracing::find($id); return view('Tracing.edit',compact('tracings')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { request()->validate([ 'type'=>'required', 'reason'=>'required', 'observation'=>'required', 'tutor_c_id'=>'required', ]); //Enterprise::find($id)->update($request->all()); Tracing::where('id', $id)->update($request->except('_token','_method')); return redirect()->route('Tracing.index')->with('success','Registro creado correctamente.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $tracing = Tracing::find($id); $tracing->deleted = true; $tracing->update(); return redirect()->route('Tracing.index')->with('success','Registro eliminado satisfactoriamente'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Display a listing of the resource.
public function index() { return view('Admin.addCenter'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { request()->validate([ 'center_name' => 'required|unique:training_centers', 'center_location' => 'required', 'center_image' => 'required|image|mimes:jpeg,png,jpg,gif,svg|max:2048', ]); $imageName = time().'.'.request()->center_image->getClientOriginalExtension(); request()->center_image->move(public_path('images'), $imageName); $var = new TrainingCenter(); $var->center_name = $request->input('center_name'); $var->center_location = $request->input('center_location'); $var->center_image = $imageName; $var->save(); return redirect('admin/viewCenter')->with('success', 'Training center added successfully.'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { $center = TrainingCenter::find($id); return view('Admin.editCenter', compact('center')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { $request->validate([ 'center_name' => 'required', 'center_location' => 'required', 'center_image' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048', ]); if (!empty(request()->center_image)){ $center = TrainingCenter::find($id); $imageName= $center-> center_image; File::delete(public_path('images/'.$imageName)); $imageName = time().'.'.request()->center_image->getClientOriginalExtension(); request()->center_image->move(public_path('images'), $imageName); } else { $center = TrainingCenter::find($id); $imageName= $center-> center_image; } $center = TrainingCenter::find($id); $center->center_name = $request->get('center_name'); $center->center_location = $request->get('center_location'); $center->center_image = $imageName; $center->save(); return redirect('admin/viewCenter')->with('success', 'Training center updated!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { $center = TrainingCenter::find($id); File::delete(public_path('images/'.$center->center_image)); $center->delete(); return back()->with('success', 'Training center deleted!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Create a new command instance.
public function __construct() { parent::__construct(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function newCommand() {\n return newinstance(Command::class, [], '{\n public static $wasRun= false;\n public function __construct() { self::$wasRun= false; }\n public function run() { self::$wasRun= true; }\n public function wasRun() { return self::$wasRun; }\n }');\n }", "public function createCommand()\r\n\t{\r\n\t\t$obj = new DbCommand($this,$this->dbms);\r\n\t\treturn $obj;\r\n\t}", "public function createCommand() {\n\t\treturn new UnboxedCommand( $this );\n\t}", "protected function createCommand($args) {\n $command = new Command();\n $command->id = ifseta($args, 'id');\n $command->name = ifseta($args, 'name');\n $command->url = ifseta($args, 'url');\n $command->description = ifseta($args, 'description');\n $command->uses = ifseta($args, 'uses');\n $command->creationDate = ifseta($args, 'creation_date');\n $command->lastUseDate = ifseta($args, 'last_use_date');\n $command->goldenEggDate = ifseta($args, 'golden_egg_date');\n return $command;\n }", "static public function create($cmd = null, $args = null)\n {\n return new self($cmd, $args);\n }", "public function createCommand($kernel, string $commandName = null, string $commandDescription = null): Command;", "public function makeCommand() \n {\n if($this->CrontabCommandObject === NULL)\n {\n $this->CrontabCommandObject = new \\root\\library\\Crontab\\CrontabCommand\\CrontabCommand();\n }\n \n return $this->CrontabCommandObject;\n }", "public function testInstantiation()\n {\n $command = new CreateRule('dummy name');\n }", "public function command(Command $command);", "public function __construct($command)\n {\n $this->command = $command;\n }", "public static function create(array $data)\n {\n $command = new static();\n $command->exchangeArray($data);\n return $command;\n }", "protected function getCreateCommand()\n {\n $command = new IndexCreateCommand();\n $command->setContainer($this->getContainer());\n\n return $command;\n }", "public function createCommand($string = '')\n {\n return $this->createStringable($string);\n }", "public function createCommand($type) {\r\n $command = $this->xml->createElement('command');\r\n $command->setAttribute('xsi:type', $type);\r\n $command->setAttribute('xmlns', '');\r\n $this->xmlSchema($command);\r\n return $command;\r\n }", "public function __construct()\n {\n // We will go ahead and set the name, description, and parameters on console\n // commands just to make things a little easier on the developer. This is\n // so they don't have to all be manually specified in the constructors.\n if (isset($this->signature)) {\n $this->configureUsingFluentDefinition();\n } else {\n parent::__construct($this->name);\n }\n\n // Once we have constructed the command, we'll set the description and other\n // related properties of the command. If a signature wasn't used to build\n // the command we'll set the arguments and the options on this command.\n $this->setDescription((string) $this->description);\n\n $this->setHelp((string) $this->help);\n\n $this->setHidden($this->isHidden());\n\n if (! isset($this->signature)) {\n $this->specifyParameters();\n }\n }", "public function make(string $name, PreprocessorInterface $preprocessor = null): CommandInterface;", "private function _getCommandByClassName($className)\n {\n return new $className;\n }", "public function newCommand($regex, $callable) {\n $cmd = new Command();\n $cmd->regex = $regex;\n $cmd->callable = $callable;\n return $this->addCommand($cmd);\n }", "public static function create($commandID, ...$args)\n {\n $arguments = func_get_args();\n\n return new static(array_shift($arguments), $arguments);\n }", "private function __construct($command = null)\n {\n $this->command = $command;\n }", "public static function factory(string $command, string $before = '', string $after = ''): self\n {\n return new self($command, $before, $after);\n }", "public function getCommand() {}", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\ESCAPE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('tag', null, null, false))\n ->addArgument(new Argument($this->tag, null, null, true));\n\n return $command;\n }", "public function testCanBeInstantiated()\n {\n $command = $this->createInstance();\n $this->assertInstanceOf('\\\\Dhii\\\\ShellInterop\\\\CommandInterface', $command, 'Command must be an interoperable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\ConfigurableCommandInterface', $command, 'Command must be a configurable command');\n $this->assertInstanceOf('\\\\Dhii\\\\ShellCommandInterop\\\\MutableCommandInterface', $command, 'Command must be a mutable command');\n }", "public function getCommand();", "protected function createCommand($name, array $parameters = [])\n {\n return new Fluent(\n array_merge(\n compact('name'),\n $parameters)\n );\n }", "public function testCanPassCommandStringToConstructor()\n {\n $command = new Command('/bin/ls -l');\n\n $this->assertEquals('/bin/ls -l', $command->getExecCommand());\n }", "public function makeCommandInstanceByType(...$args): CommandInterface\n {\n $commandType = array_shift($args);\n\n switch ($commandType) {\n case self::PROGRAM_READ_MODEL_FETCH_ONE_COMMAND:\n return $this->makeFetchOneCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_COMMAND:\n return $this->makeFindCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_FIND_LITE_COMMAND:\n return $this->makeFindLiteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_TASK_COMMAND:\n return $this->makeItemCreateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_CREATE_COMMAND:\n return $this->makeItemCreateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_TASK_COMMAND:\n return $this->makeItemUpdateTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_UPDATE_COMMAND:\n return $this->makeItemUpdateCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_TASK_COMMAND:\n return $this->makeItemDeleteTaskCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_DELETE_COMMAND:\n return $this->makeItemDeleteCommand(...$args);\n\n case self::PROGRAM_READ_MODEL_ADD_ID_COMMAND:\n return $this->makeItemAddIdCommand(...$args);\n\n default:\n throw new FactoryException(sprintf('Command bus for type `%s` not found!', (string) $commandType));\n }\n }", "public function __construct($cmd)\n {\n $this->cmd = $cmd;\n }", "public function getCommand()\n {\n }", "public function command($class)\n {\n $runnable = $this->resolveClass($class);\n\n if ( ! $runnable instanceof Command) {\n throw new InvalidArgumentException(get_class($runnable).' must be an instance of '.Command::class.'.');\n }\n\n $command = $runnable;\n\n if ($runnable instanceof Taggable) {\n $command = new Cached($command, $this);\n }\n\n if ($runnable instanceof Transactional) {\n $command = new Transaction($command, $this, $this->makeFromContainer(ConnectionInterface::class));\n }\n\n if ($runnable instanceof Eventable) {\n $command = new Evented($command, $this);\n }\n\n return $this->newBuilder($command);\n }", "protected function createCommandFactory(): CommandFactory\n {\n return new CommandFactory([\n 'CLOSE' => Command\\CLOSE::class,\n ]);\n }", "public static function register() {\n\n if ( !defined( 'WP_CLI' ) || !WP_CLI ) {\n return;\n }\n \n $instance = new static;\n if(empty( $instance->namespace )) {\n throw new \\Exception(\"Command namespace not defined\", 1);\n \n }\n\t\t\\WP_CLI::add_command( $instance->namespace, $instance, $instance->args ?? null );\n\t}", "public function addCommand($command);", "public function add(Command $command);", "abstract protected function getCommand();", "public function createCommand()\r\n\t{\r\n\t\t//start the string\r\n\t\t$command = '';\r\n\t\t\r\n\t\t//add the java command or the path to java\r\n\t\t$command .= $this->java_path;\r\n\t\t\r\n\t\t//add the class path\r\n\t\t$command .= ' -cp \"'. $this->stanford_path . $this->seperator . '*\" ';\r\n\t\t\r\n\t\t//add options\r\n\t\t$options = implode(' ', $this->java_options);\r\n\t\t$command .= '-'.$options;\r\n\t\t\r\n\t\t//add the call to the pipeline object\r\n\t\t$command .= ' edu.stanford.nlp.pipeline.StanfordCoreNLP ';\r\n\r\n\t\t//add the annotators\r\n\t\t$command .= '-annotators '. $this->listAnnotators();\r\n\t\t\r\n\t\t//add the input and output directors\r\n\t\t$command .= ' -file '. $this->tmp_file . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//this is for testing purposes\r\n\t\t//$command .= ' -file '. $this->tmp_path .'\\\\nlp3F25.tmp' . ' -outputDirectory '. $this->tmp_path;\r\n\t\t\r\n\t\t//if using regexner add this to the command string\r\n\t\tif($this->annotators['regexner'] === true)\r\n\t\t{\r\n\t\t\t$command .=' -regexner.mapping '. $this->regexner_path . $this->seperator . $this->regexner_file;\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn $command;\r\n\t}", "protected function createCommand(string $name, array $parameters = []): Fluent\n {\n return new Fluent(array_merge(compact('name'), $parameters));\n }", "public function __construct()\n {\n parent::__construct(static::NAME, static::VERSION);\n $this->add(new DefaultCommand());\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->command_name = config(\"custom-commands.command_name\");\n\n parent::__construct($this->signature = $this->command_name);\n\n $this->commands = (array) config(\"custom-commands.commands\");\n \n $this->table = config(\"custom-commands.table\");\n\n $this->row = config(\"custom-commands.row\");\n\n $this->changeEnv = (boolean) config(\"custom-commands.change_env\");\n\n }", "protected function createCommandFile()\n {\n $command_file_full_path = $this->command_dir_path . DIRECTORY_SEPARATOR . $this->arg->getCommandFileName();\n\n // Check if the command already exists\n if (file_exists($command_file_full_path)) {\n throw new Exception('Command already exists.');\n }\n\n // Create the file for the new command\n $command_file = fopen($command_file_full_path, 'w');\n\n // TODO: Create Script Generator to generate the PHP scripts for the new command.\n\n fclose($command_file);\n\n $this->console->getOutput()->println('File created at: ' . $command_file_full_path);\n $this->console->getOutput()->success('Command ' . $this->arg->getSignature() . ' created successfully.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "public static function create(InteropContainer $container)\n {\n $middleware = $container->get('cmd.middleware');\n return new CommandBusFactory($middleware);\n }", "private function createCli() {\n $this->cli = new Cli();\n $this->commands = $this->commandParser->getAllCommands();\n\n foreach ($this->commands as $command) {\n if ($command->isDefault()) {\n $this->cli->command(\"*\");\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n if ($command->getName() != \"\") {\n $this->cli->command($command->getName())->description($command->getDescription());\n foreach ($command->getOptions() as $option) {\n $this->cli->opt($option->getName(), $option->getDescription(), $option->isRequired(), $option->getType());\n }\n foreach ($command->getArguments() as $argument) {\n if (!$argument->isVariadic())\n $this->cli->arg($argument->getName(), $argument->getDescription(), $argument->isRequired());\n }\n }\n }\n\n\n }", "public function testInstantiation()\n {\n $this->assertInstanceOf('Contao\\ManagerBundle\\Command\\InstallWebDirCommand', $this->command);\n }", "public function command(string $command): self\n {\n $this->addCommands[] = $command;\n\n return $this;\n }", "public function create() {}", "protected function createProcess($cmd)\n {\n return new Process(explode(' ', $cmd));\n }", "public function create(){}", "protected function getCommandFactory(): Command\\Factory\n {\n return new Command\\RedisFactory();\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->commandData = new CommandData($this, CommandData::$COMMAND_TYPE_API);\n }", "public function testNewCommand() : void\n {\n $this->assertFalse($this->command->hasArguments());\n $this->assertEquals(\"\", $this->command->getArguments());\n }", "protected function createCommandBuilder()\n\t{\n\t\treturn new CSqliteCommandBuilder($this);\n\t}", "public function __construct($command, $config = [])\n {\n $this->command = $command;\n $this->_output = $this->getDefaultOutput();\n parent::__construct($config);\n }", "public function __construct(){\n\n global $argv;\n\n if(!isset($argv[1])){\n echo 'You must supply a command!' . PHP_EOL;\n exit;\n }//if\n\n $args = $argv;\n\n $scriptName = array_shift($args);\n $method = array_shift($args);\n\n $method = explode('-',$method);\n foreach($method as $k => $v){\n if($k != 0){\n $method[$k] = ucwords($v);\n }//if\n }//foreach\n\n $method = implode('',$method);\n\n $resolved = false;\n\n if(method_exists($this,$method)){\n call_user_func(Array($this,$method), $args);\n $resolved = true;\n }//if\n else {\n foreach(static::$extendedCommands as $commandClass){\n if(method_exists($commandClass,$method)){\n call_user_func(Array($commandClass,$method), $args);\n $resolved = true;\n break;\n }//if\n }//foreach\n }//el\n\n if(!$resolved){\n echo \"`{$method}` is not a valid CLI command!\";\n }//if\n\n echo PHP_EOL;\n exit;\n\n }", "public function forCommand($command)\n {\n $this->command = $command;\n $this->pipe = new NullPipe();\n $this->manager = new InteractiveProcessManager($this->userInteraction);\n\n return $this;\n }", "public function __construct()\n {\n parent::__construct('pwman', '0.1.0');\n\n $getCommand = new Get();\n $this->add($getCommand);\n\n $setCommand = new Set();\n $this->add($setCommand);\n }", "public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }", "public function createCommand(?string $sql = null, array $params = []): Command;", "public function __construct($command = NULL, $name = NULL)\n {\n $args = func_get_args();\n\n switch ($command) {\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n case self::CONSTR_CMD_POP_FROM_ARR:\n case self::CONSTR_CMD_POP_FROM_OBJ:\n case self::CONSTR_CMD_POP_FROM_DB:\n case self::CONSTR_CMD_NEW:\n $this->setup_name = $name;\n\n # shift off known args\n array_shift($args);\n array_shift($args);\n break;\n }\n\n switch ($command) {\n case self::CONSTR_CMD_POP_FROM_ARR:\n $this->applyArray($args[0]);\n break;\n case self::CONSTR_CMD_POP_FROM_OBJ:\n break;\n case self::CONSTR_CMD_POP_FROM_DB:\n break;\n case self::CONSTR_CMD_POPULATE_SYNCED_ARRAY:\n $this->applyArray($args[0]);\n $this->setAllLoaded();\n break;\n default:\n throw new OrmInputException('Guessing not supported, please explicitly specify construction type');\n self::constructGuess($args);\n }\n\n $this->ensureObjectInDb();\n }", "public function generateCommands();", "protected function newInstanceCommand($commandClass)\n {\n $class = new ReflectionClass($commandClass);\n\n return $class->newInstanceArgs($this->resolveCommandParameters($class));\n }", "protected function buildCommand()\n {\n return $this->command;\n }", "public function makeItemCreateCommand(string $processUuid, array $item): ItemCreateCommand\n {\n $processUuid = ProcessUuid::fromNative($processUuid);\n $uuid = Uuid::fromNative(null);\n $item = Item::fromNative($item);\n\n return new ItemCreateCommand($processUuid, $uuid, $item);\n }", "public function __construct($commandName, $args = [], $description = '') {\n if (!$this->setName($commandName)) {\n $this->setName('--new-command');\n }\n $this->addArgs($args);\n\n if (!$this->setDescription($description)) {\n $this->setDescription('<NO DESCRIPTION>');\n }\n }", "public function getCommand($name, array $args = array())\n {\n return parent::getCommand($name, $args)\n ->setRequestSerializer(RequestSerializer::getInstance());\n }", "protected function buildCommand()\n {\n $command = new Command(\\Tivie\\Command\\DONT_ADD_SPACE_BEFORE_VALUE);\n $command\n ->chdir(realpath($this->repoDir))\n ->setCommand($this->gitDir)\n ->addArgument(new Argument('rev-parse'))\n ->addArgument(new Argument('HEAD'));\n\n return $command;\n }", "protected function instantiateCommand(Request $request, $args)\n {\n $command = new DeletePackageCustomerCommand($args);\n\n $requestBody = $request->getParsedBody();\n\n $this->setCommandFields($command, $requestBody);\n\n return $command;\n }", "public function createCommand($sql = null, $params = [])\n {\n $command = new Command([\n 'db' => $this,\n 'sql' => $sql,\n ]);\n\n return $command->bindValues($params);\n }", "protected function setCommand($value) {\n\t\t$this->_command = trim($value);\n\t\treturn $this;\n\t}", "public function setCommand($command)\n {\n $this->command = $command;\n\n return $this;\n }", "public function buildCommand()\n {\n return parent::buildCommand();\n }", "private function registerMakeModuleCommand()\n {\n $this->app->singleton('command.make.module', function($app) {\n return $app['Caffeinated\\Modules\\Console\\Generators\\MakeModuleCommand'];\n });\n\n $this->commands('command.make.module');\n }", "public function __construct()\n {\n parent::__construct();\n\n $this->currentDirectory = getcwd();\n $this->baseIndentLevel = 0;\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\HelpCommand\", \"help\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\InitializePlanetCommand\", \"init\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackAndPushUniToolCommand\", \"packpushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PackLightPluginCommand\", \"packlightmap\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushCommand\", \"push\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\PushUniverseSnapshotCommand\", \"pushuni\");\n $this->registerCommand(\"Ling\\LingTalfi\\Kaos\\Command\\UpdateSubscriberDependenciesCommand\", \"updsd\");\n\n }", "public function getCommand(string $command);", "protected function registerCommand(){\n\t\t$this->app->singleton('fakeid.command.setup', function ($app){\n\t\t\treturn new SetupCommand();\n\t\t});\n\n\t\t$this->commands('fakeid.command.setup');\n\t}", "public function addCommand($command, $args = [], $data = [])\n {\n $item = new ScreenCommand();\n $item->screen_id = $this->id;\n $item->command = $command;\n $item->arguments = $args;\n $item->fill($data);\n $item->save();\n\n return $item;\n }", "public function test_creating_command_from_container()\n {\n $now = new \\DateTime();\n $this->container->add('DateTime', $now);\n $command = 'Spekkionu\\DomainDispatcher\\Test\\Commands\\CommandWithConstructor';\n $result = $this->dispatcher->dispatch($command);\n $this->assertSame($now, $result);\n }", "protected function createProcess(): Process\n {\n $command = [\n $this->settings['executable']\n ];\n\n $command[] = $this->from;\n $command[] = $this->to;\n\n // Set the margins if needed.\n if ($this->settings['marginsType'] !== self::MARGIN_TYPE_NO_MARGINS) {\n $command[] = '--marginsType=' . $this->settings['marginsType'];\n }\n\n // If we need to proxy with node we just need to prepend the $command with `node`.\n if ($this->settings['proxyWithNode']) {\n array_unshift($command, 'node');\n }\n\n // If there's no graphical environment we need to prepend the $command with `xvfb-run\n // --auto-servernum`.\n if (! $this->settings['graphicalEnvironment']) {\n array_unshift($command, '--auto-servernum');\n array_unshift($command, 'xvfb-run');\n }\n\n return new Process($command);\n }", "private function registerCommand()\n {\n $this->app->singleton('command.shenma.push', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\Push();\n });\n\n $this->app->singleton('command.shenma.push.retry', function () {\n return new \\Larva\\Shenma\\Push\\Commands\\PushRetry();\n });\n }", "public function __construct(string $command, string $before = '', string $after = '')\n {\n $this->command = $command;\n $this->before = $before;\n $this->after = $after;\n }", "public function generateCommand($singleCommandDefinition);", "public function create() {\n }", "public function create() {\n }", "public function create() {\r\n }", "public function create() {\n\n\t}", "private function getImportCommand()\n {\n return new IndexImportCommand(self::getContainer());\n }", "public function __construct($command)\n {\n $this->command = $command;\n\n $this->command->line('Installing Images: <info>✔</info>');\n }", "public function __construct()\n {\n self::$instance =& $this;\n\n $commanddir = Config::main('directory');\n $excludes = Config::main('exclude');\n\n if(is_null($commanddir))\n die('Could not find commands directory. It should be specified in the main config.');\n\n //The directory where commands reside should be relative\n //to the directory with the clip executable.\n $dir = realpath(__DIR__.\"/{$commanddir}\");\n\n $cmdfiles = scandir($dir);\n //Loop through each file in the commands directory\n foreach($cmdfiles as $file)\n {\n //Assume that each file uses the standard '.php' file extension.\n $command = substr($file, 0, -4);\n\n //Ignore the unnecessary directories as commands and anything that\n //has been marked for exclusion then attempt to include the valid ones.\n if($file !== '.' && $file !== '..' && array_search($command, $excludes) === false && include(\"{$dir}/{$file}\"))\n {\n if(class_exists($command, false))\n {\n $obj = new $command;\n //Only load commands that use the clip command interface\n if($obj instanceof Command)\n $this->commands[strtolower($command)] = $obj;\n }\n }\n }\n }", "public function __construct($action, $command = null) {\n parent::__construct($action, self::NAME);\n\n $fieldFactory = FieldFactory::getInstance();\n\n $commandField = $fieldFactory->createField(FieldFactory::TYPE_STRING, self::FIELD_COMMAND, $command);\n\n $this->addField($commandField);\n }", "public function createCommand($db = null, $action = 'get')\n {\n if ($db === null) {\n $db = Yii::$app->get(Connection::getDriverName());\n }\n $this->addAction($action);\n $commandConfig = $db->getQueryBuilder()->build($this);\n\n return $db->createCommand($commandConfig);\n }", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();", "public function create();" ]
[ "0.8010746", "0.7333379", "0.72606754", "0.7164165", "0.716004", "0.7137585", "0.6748632", "0.67234164", "0.67178184", "0.6697025", "0.6677973", "0.66454077", "0.65622073", "0.65437883", "0.64838654", "0.64696646", "0.64292693", "0.6382209", "0.6378306", "0.63773245", "0.6315901", "0.6248427", "0.6241929", "0.6194334", "0.6081284", "0.6075819", "0.6069913", "0.60685146", "0.6055616", "0.6027874", "0.60132784", "0.60118896", "0.6011778", "0.5969603", "0.59618074", "0.5954538", "0.59404427", "0.59388787", "0.5929363", "0.5910562", "0.590651", "0.589658", "0.589658", "0.589658", "0.58692765", "0.58665586", "0.5866528", "0.58663124", "0.5852474", "0.5852405", "0.58442044", "0.58391577", "0.58154446", "0.58055794", "0.5795853", "0.5780188", "0.57653266", "0.57640004", "0.57584697", "0.575748", "0.5742612", "0.5739361", "0.5732979", "0.572247", "0.5701043", "0.5686879", "0.5685233", "0.56819254", "0.5675983", "0.56670785", "0.56606543", "0.5659307", "0.56567776", "0.56534046", "0.56343585", "0.56290466", "0.5626615", "0.56255764", "0.5608852", "0.5608026", "0.56063116", "0.56026554", "0.5599553", "0.5599351", "0.55640906", "0.55640906", "0.5561977", "0.5559745", "0.5555084", "0.5551485", "0.5544597", "0.55397296", "0.5529626", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908", "0.552908" ]
0.0
-1
Execute the console command.
public function handle() { \Log::info('Starting General Product Update @'.\Carbon\Carbon::now()); // create new sitemap object $sitemap = App::make('sitemap'); // get all products from db (or wherever you store them) $products = \DB::table('products')->orderBy('created_at', 'desc')->get(); // counters $counter = 0; $sitemapCounter = 0; $productCounter = 0; // add every product to multiple sitemaps with one sitemap index foreach ($products as $product) { if ($counter == 50000) { // generate new sitemap file $sitemap->store('xml', 'sitemap-' . $sitemapCounter); // add the file to the sitemaps array $sitemap->addSitemap(secure_url('sitemap-' . $sitemapCounter . '.xml')); // reset items array (clear memory) $sitemap->model->resetItems(); // reset the counter $counter = 0; // count generated sitemap $sitemapCounter++; } // add product to items array $product_url = url('/').'/'.$product->slug.'-'.$product->id; $sitemap->add($product_url, $product->created_at, '1.0', 'daily'); // count number of elements $counter++; $productCounter++; } // you need to check for unused items if (!empty($sitemap->model->getItems())) { // generate sitemap with last items $sitemap->store('xml', 'sitemap-' . $sitemapCounter); // add sitemap to sitemaps array $sitemap->addSitemap(secure_url('sitemap-' . $sitemapCounter . '.xml')); // reset items array $sitemap->model->resetItems(); } $Totalsitemaps = $sitemapCounter+1; // generate new sitemapindex that will contain all generated sitemaps above $sitemap->store('sitemapindex', 'sitemap'); \Log::info('Ending General Product Update Now @'.\Carbon\Carbon::now()); $this->info('Successfully Ran Update @ '.\Carbon\Carbon::now()); $this->info("Added $productCounter Products"); $this->info("Successfully Created $Totalsitemaps Sitemap(s)"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function handle()\n {\n\t\t$this->info('league fetching ..');\n $object = new XmlFeed();\n\t\t$object->fetchLeague($this->argument('sports_id'));\n\t\t$this->info('league saved');\n }", "public function handle()\n {\n //get us the Converter class instance and call the convert() method on it.\n $this->info(\n \\Aregsar\\Converter\\ConverterFacade::convert($this->argument(\"currency\"))\n );\n }", "public function handle()\n {\n $this->locale = $this->argument('locale');\n\n $this->loadGroupLines();\n\n $this->loadNameSpacedLines();\n\n $this->info('Complete');\n }", "public function handle()\n {\n $this->importUser($this->argument('username'));\n $this->call('ldap:show-user', $this->arguments());\n }", "public function handle() {\n $user = User::where('id', $this->argument('userId'))->first();\n $this->info($user->email);\n }", "public function handle()\n {\n $translations = collect(json_decode(file_get_contents('https://raw.githubusercontent.com/getbible/Bibles/master/translations.json')))->flatten();\n switch($this->argument('action')) {\n case 'fetch':\n $this->fetchBibles($translations);\n break;\n case 'convert':\n $this->convertBibles($translations);\n break;\n }\n }", "public function handle()\n {\n try {\n $evalstr = $this->evaluater->evaluate($this->argument('evalString'));\n $this->info($evalstr);\n } catch (ForbiddenSymbolsException $exception) {\n $this->error($exception->getMessage());\n } catch (IncorrectSymbolsException $exception) {\n $this->error($exception->getMessage());\n }\n }", "public function handle()\n {\n\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\n }", "public function handle()\n {\n // env('CALENDARINDEX_TOKEN', '6f2bd927201ba4b22bb57df08db0c517e51732de')\n $this->getData($this->argument('country'), $this->argument('region'));\n }", "public function handle()\n {\n $email = $this->argument('email');\n $name = $this->argument('name');\n\n $this->info(\"starting to generate users details\");\n\n }", "public function handle()\n {\n\t\t$this->info('Importing translations...');\n\n\t\t$this->manager->importTranslations(true);\n }", "public function handle()\n {\n $user = null;\n\n if ($email = $this->option(\"email\", false)) {\n $user = $this->findByEmail($email);\n }\n\n if ($id = $this->option(\"id\", false)) {\n $user = $this->findById($id);\n }\n\n if (empty($user)) {\n $this->warn(\"User no found\");\n }\n else {\n $this->setRoleToUser($user);\n }\n }", "public function handle()\n {\n $name = ucwords($this->argument('name'));\n $this->call('repository:contract', [ 'name' => $name ]);\n $this->call('repository:class', [ 'name' => $name, '--driver' => $this->option('driver') ]);\n }", "public function handle()\n\t{\n\t\t// Superuser\n\t\tif( ! $this->option('no-superuser'))\n\t\t\t$this->call('setup:superuser');\n\n\t\t// Countries\n\t\tif( ! $this->option('no-countries'))\n\t\t\t$this->call('setup:countries', ['country' => array_filter(explode(',', $this->option('countries')))]);\n\n\t\t// Languages\n\t\tif( ! $this->option('no-languages'))\n\t\t\t$this->call('setup:languages', ['language' => array_filter(explode(',', $this->option('languages')))]);\n\n\t\t// Currencies\n\t\tif( ! $this->option('no-currencies'))\n\t\t\t$this->call('setup:currencies', ['currency' => array_filter(explode(',', $this->option('currencies')))]);\n\n\t\t// Clear cache\n\t\t$this->call('cache:clear');\n\t}", "public function handle()\n\t{\n\t\t$name = $this->argument('name');\n\t\t\n\t\t$this->info(\"Searching eve api for {$name}\");\n\t\t$result = Corporation::searchEVEAPI($name);\n\n\t\t$this->info(\"results\");\n\t\tforeach($result as $corp)\n\t\t{\n\t\t\tprint $corp->name . \" \" . $corp->id . \"\\r\\n\";\n\t\t}\n\t}", "public function handle()\n {\n $user = $this->argument('user');\n $this->info('Display this on the screen, user ' . $user);\n return 0;\n }", "public function handle()\n {\n $this->userVectors->test($this->option('force'));\n }", "public function handle()\n {\n $mapping = $this->formatMappingName((string)$this->argument('mapping'));\n \n $model = $this->option('model') ? $this->formatModelName($this->option('model')) : null;\n \n $this->filesystem->put(\n $this->buildMappingFilePath($mapping),\n $this->buildMapping(\n $this->getDefaultStub(),\n $mapping,\n $model\n )\n );\n \n $this->composer->dumpAutoloads();\n }", "public function handle()\n {\n switch ($this->argument('type')) {\n case 'dns':\n $this->dnscheck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n case 'whois':\n $this->whoischeck->run($this->option('dry-run') ? true : false, $this->argument('domain'));\n break;\n }\n }", "public function handle()\n {\n $option = $this->argument('option');\n\n if (! in_array($option, ['expired', 'all'])) {\n return $this->error('Invalid option supplied to command...');\n }\n\n $this->comment('Beginning pruning process...');\n\n $this->comment($this->pruneDatabase($option) . ' deleted from database...');\n\n $this->comment($this->pruneFiles($option) . ' deleted from files...');\n\n $this->info('Nonces pruned successfully!');\n }", "public function handle()\n {\n $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }", "public function handle()\n\t{\n\t\t\n\t\t$source_directory = $this->argument( 'source_directory' );\n\t\t$target_directory = $this->argument( 'target_directory' );\n\t\t$template = (string) $this->option( 'template' );\n\n\t\t$statik = new \\App\\Statik\\Statik;\n\n\t\t$statik->generateHTMLFiles( $this, $source_directory, $target_directory, $template ) && $this->info( \"\\e[1;32mDONE!\" );\n\n\t}", "public function handle()\n {\n if (!$this->argument('file')) {\n $this->info('Please specify file to call.');\n }\n\n $file = $this->argument('file');\n\n if (!$this->fileHandler->exists($file)) {\n $this->info('Wrong path or file not exist.');\n }\n\n $this->executeFile($file);\n }", "public function handle()\n {\n $user = $this->argument('user');\n $this->scanner->setUserName($user);\n $this->scanner->scanUser();\n }", "public function handle()\n {\n if ($this->argument('user')) {\n $userId = $this->argument('user');\n\n $this->info(\"Liquidate affiliate commission for user \" . $userId);\n\n $user = $this->userService->findById($userId);\n\n if ($user) {\n $this->walletService->liquidateUserBalance($user);\n } else {\n $this->error(\"User not found\");\n }\n\n $this->info(\"Done\");\n } else {\n $this->info(\"Liquidate all commissions\");\n\n $this->walletService->liquidateAllUsersBalance();\n\n $this->info(\"Done\");\n }\n }", "public function handle()\n {\n $action = $this->choice('what action do you have on mind', [\n 'add-relation', 'remove-columns', 'column-type', 'rename-column'\n ]);\n switch ($action) {\n case 'add-relation':\n $this->addRelation();\n break;\n\n case 'remove-columns':\n $this->removeColumns();\n break;\n case 'column-type':\n $this->columnType();\n break;\n case 'rename-column':\n $this->renameColumn();\n break;\n default:\n $this->error('Unsupported action requested...');\n }\n $this->info('Command executed successfully');\n }", "public function handle()\n {\n $arguments = $this->arguments();\n $storageDir = $arguments['storageDir'];\n $localStorageDir = $arguments['localStorageDir'];\n $url = $arguments['url'];\n $cmd = sprintf(\"./app/Console/Commands/ShellScripts/screen_shot.sh %s %s %s\", $storageDir, $localStorageDir, $url);\n\n while (true) {\n $result = shell_exec($cmd);\n print_r($result);\n sleep(3);\n }\n }", "public function handle()\n {\n $city = $this->argument('city');\n\n $weatherService = new CurrentWeatherService();\n try {\n $weather = $weatherService->getByCity($city);\n } catch (WeatherException $e) {\n $this->error($e->getMessage());\n return;\n }\n\n $this->info('Weather for city '.$city);\n dump($weather->toArray());\n }", "public function handle()\n {\n $this->getModels($this->argument('model'));\n $this->getLanguages($this->argument('locale'));\n $this->createMultiLanguageRecords();\n }", "public function handle()\n {\n $this->processOptions();\n\n echo json_encode( $this->dateTimeRange ) . \"\\n\";\n\n $this->dispatch( new ProcessNewActionsJob(\n $this->dateTimeRange ,\n str_random( 16 ),\n $this->option('runtime-threshold')\n ) );\n }", "public function handle()\n {\n $fightId = $this->argument('fight_id');\n $metricId = $this->argument('metric_id');\n //$strategyName = 'App\\\\'.$this->argument('metric_name');\n\n $metric = BossMetric::find($metricId);\n if ($metric === null) {\n $this->error(\"Error: no metric with id: $metricId found!\");\n return;\n }\n\n $fight = Fight::find($fightId);\n\n if ($fight === null) {\n $this->error(\"Error: no fight with id: $fightId found!\");\n return;\n }\n\n $strategy = $metric->getStrategy();\n $strategy->setFight($fight);\n $strategy->run();\n }", "public function handle()\n {\n\t\t$this->call('vendor:publish');\n\t\t$this->call('migrate');\n\t\t$this->call('db:seed');\n\t\t$this->call('factotum:storage');\n\t\t$this->call('factotum:storage');\n }", "public function handle()\n {\n $user_id = $this->argument('user') ?? null;\n\n if (is_null($user_id)) {\n $users = User::all();\n\n foreach ($users as $user) {\n $this->showUserBalance($user);\n }\n } else {\n $user = User::find($user_id);\n\n $this->showUserBalance($user);\n }\n }", "public function handle()\n {\n $this->capsuleService->getAll();\n $this->line('Command Worked');\n }", "public function handle()\n {\n $platform_wechat_id = $this->argument('id');\n $customer_id = $this->argument('customer_id');\n $this->info(\"Starting at \".date('Y-m-d H:i:s').\". Running initial for 【{$this->signature}】\");\n $this->getUserInfoList($platform_wechat_id,$customer_id);\n $this->info(\"End at \".date('Y-m-d H:i:s').\". over for 【{$this->signature}】\");\n }", "public function handle()\n {\n $this->publishAssets();\n $this->call('twill:flush-manifest');\n $this->call('view:clear');\n }", "public function handle()\n {\n \n $argument = $this->argument('data');\n \n $this->prepare( $argument );\n \n $this->make();\n \n $this->info( 'migration has been created : '. $this->fileName );\n \n }", "public function handle()\n {\n chdir(resource_path('assets/ts'));\n $path = $this->argument(\"path\");\n if(isset($path))\n {\n Logger::info('execute '.$path);\n Command::executeRaw('tsc', [\"-p\", $path]);\n }else\n Logger::info('execute tsc');\n Command::executeRaw('tsc');\n }", "public function handle()\n {\n $this->info('Starting date change command.');\n\n Word::where('language_id', 1)->update(array('created_at' => '1970-01-01 00:00:01'));\n Word::where('language_id', 2)->update(array('created_at' => '1970-01-01 00:00:01'));\n\n $this->info('Dates have been changed to 1970-01-01 00:00:01');\n }", "public function handle()\n {\n $this->info($this->slugger->encode($this->argument('id')));\n }", "public function handle()\n {\n $this->line(static::$logo);\n $this->line('Neat admin current version:' . Neat::version());\n\n $this->comment('');\n $this->comment('Available commands:');\n\n $this->listAvailableCommands();\n }", "public function handle()\n {\n $this->revisions->updateListFiles();\n }", "public function handle(): void\n {\n // Set argument\n $this->url = $this->argument(self::URL_ARGUMENT);\n\n // Handler takes care of computation\n (new CommandHandler($this))->compute();\n }", "public function handle()\n {\n try\n {\n $filename = $this->argument('filename');\n Excel::import(new ObjectsImport, $filename);\n\n $this->info('Data import is now completed');\n }\n catch(Exception $ex)\n {\n $this->error($ex->getMessage());\n }\n }", "public function handle() {\n $entity = $this->validateEntity($this->argument('entity'));\n $job = new DataProcessingJob($entity, str_random(16));\n $this->dispatch($job);\n }", "public function handle()\n {\n $isProductionMode = 'prod' == $this->argument('mode');\n\n if ($isProductionMode) {\n if (!$this->confirm('Are you sure to run in production mode? Running this command may cause critical issues?')) {\n exit(1);\n }\n }\n\n $this->_recalculate($isProductionMode);\n }", "public function handle()\n {\n if(!$this->verify()) {\n $rank = $this->createRankSuperAdmin();\n $user = $this->createUserSuperAdmin();\n $user->Ranks()->attach($rank);\n $this->line('Felicitaciones');\n } else {\n $this->error('No se puede ejecutar');\n }\n }", "public function handle()\n {\n // Get CLI Input\n $user_id = $this->option(\"uid\");\n\n // User Products\n ( new CommandManager() )->showUserProducts( $user_id );\n }", "public function handle()\n {\n $force = $this->option('force');\n\n if($this->option('without-bulk')){\n $this->withoutBulk = true;\n }\n\n if ($this->generateClass($force)){\n $this->info('Generating permissions for '.$this->modelBaseName.' finished');\n }\n }", "public function handle()\n {\n $tournaments = Tournament::all()->toArray();\n foreach ($tournaments as $tournament) {\n $slug = $this->tournamentRepoObj->generateSlug($tournament['name'].Carbon::createFromFormat('d/m/Y', $tournament['start_date'])->year,'');\n DB::table('tournaments')\n ->where('id', $tournament['id'])\n ->update([\n 'slug' => $slug\n ]);\n }\n $this->info('Script executed.');\n }", "public function handle()\n {\n $userId = $this->argument('user');\n\n /** @var User $user */\n $user = User::findOrFail($userId);\n\n // Get token.\n $info = (new Client())->auth();\n\n // Save to db.\n $user->access_token = $info['access_token'];\n $user->access_secret = $info['access_secret'];\n $user->save();\n\n $this->line(\"Saved access token and secret for user: {$user->email}\");\n }", "public function handle()\n {\n $m = new MemberFromText;\n $m->train();\n $id = $m->predict($this->argument('text'));\n dump(Miembro::find($id)->toArray());\n }", "public function handle()\n {\n $this->generator\n ->setConsole($this)\n ->run();\n }", "public function handle()\n {\n $this->createController();\n $this->createServiceDir();\n\n exit;\n $args = [\n '--provider' => TestProvider::class\n ];\n $className = $this->argument('className');\n if (!$className) {\n $className = 'MethodsList';\n }\n $className = ucwords($className);\n $this->call('vendor:publish', $args);\n $this->info('Display this on the screen ' . $className);\n }", "public function handle()\n {\n $this->createDirectories();\n\n $this->publishTests();\n\n $this->info('Authentication tests generated successfully.');\n }", "public function handle()\n {\n $this->setDbConnection(\n $this->input->getOption('database') ?: config('ghost-database.default_connection')\n );\n\n $native = $this->input->getOption('native-import') ?: config('ghost-database.use_native_importer');\n\n $snapshot = $this->import($native);\n\n $this->info(\"Snapshot `{$snapshot->name}` loaded!\");\n }", "public function handle()\n {\n $exec = $this->argument('exec');\n\n switch ($exec) {\n case 'download' :\n $this->download();\n break;\n\n case 'generate' :\n $this->generate();\n break;\n\n default :\n echo \"Choose 'download' or 'generate' for this command\";\n break;\n }\n }", "public function handle()\n {\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-admin.js', '--group' => 'admin']);\n $this->call('ziggy:generate', ['path' => './resources/js/ziggy-frontend.js', '--group' => 'frontend']);\n $this->call(TranslationsGenerateCommand::class);\n }", "public function handle()\n {\n $tenantName = $this->argument('tenant');\n\n $tenant = Tenant::where('name', $tenantName)->orWhere('subdomain', $tenantName)->first();\n\n if ($tenant) {\n $tenant->setActive();\n \\Artisan::call('tinker');\n } else {\n $this->error('Error: Tenant not found');\n }\n }", "public function handle()\n {\n try {\n if (!empty($userId = $this->argument('user'))) {\n $user = User::find($userId);\n } else {\n $user = User::inRandomOrder()->first();\n }\n\n if (empty($user)) {\n throw new \\Exception('User not found');\n }\n\n echo JWTAuth::fromUser($user);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n }", "public function handle()\n {\n $this->fetchAndSetToken();\n $imagesToDownload = $this->peekImages(WatchedApp::pluck('package_name'));\n $this->fetchImages($imagesToDownload);\n\n if ($this->option('dont-optimize')) {\n return;\n }\n\n $this->runOptimizeCommand();\n }", "public function handle()\n {\n $this->setCryptIVFromUrl($this->argument('url'));\n\n $participant = URLParser::parseByName('santa.index', $this->argument('url'))->participant;\n if($participant) {\n $draw = $participant->draw;\n } else {\n $draw = URLParser::parseByName('organizer.index', $this->argument('url'))->draw;\n }\n\n $this->table(\n ['ID', 'Name', 'Email'],\n $draw->participants()->get(['id', 'name', 'email'])->toArray()\n );\n }", "public function handle()\n {\n // if you are on the local environment\n if (!(app()->isLocal() || app()->runningUnitTests())) {\n $this->error('This command is only available on the local environment.');\n return;\n }\n\n $fqdn = $this->argument('fqdn');\n if ($tenant = Tenant::retrieveBy($fqdn)){\n $tenant->delete($fqdn);\n $this->info(\"Tenant {$fqdn} successfully deleted.\");\n }else {\n $this->error('This fqdn doesn\\'t exist.');\n }\n\n }", "public function handle()\n {\n $user_from = $this->option('from');\n $user_to = $this->option('to');\n $sum = $this->option('sum');\n\n CreateTransaction::dispatch($this->usersRepository->getByID($user_from), $this->usersRepository->getByID($user_to), $sum, true);\n $this->transactionsRepository->getAll()->each(function ($transaction){\n \tExecuteTransaction::dispatch($transaction);\n });\n }", "public function handle()\n {\n $this->warn('Starting Retrieve Data');\n\n PeopleService::retrieveData();\n\n $this->info('Retrieve Data Completed');\n }", "public function handle()\n {\n \n $period = $this->option('period');\n \n switch ($period) {\n\n case 'half_month':\n $this->info('Grabing Half Month Income...');\n $this->halfMonth();\n break;\n\n case 'monthly':\n $this->info('Grabing Monthly Income...');\n $this->monthly();\n break;\n \n default:\n $this->info('Grabing Daily Income...');\n $this->daily();\n break;\n\n }\n\n \n }", "public function handle()\n {\n $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\n }", "public function fire()\n {\n $entityName = $this->argument('entityName');\n $startEntityId = $this->argument('startEntityId');\n $endEntityId = $this->argument('endEntityId');\n $depth = $this->argument('depth');\n\n $this->fixturePath = $this->option('outputPath');\n\n $this->info(\"Generating fixtures for $entityName in {$this->fixturePath}...\");\n \n $this->generateFixtures($entityName, $startEntityId, $endEntityId, $depth);\n }", "public function handle()\n {\n $check = PublishTraitsService::publishTraits();\n\n if ($check)\n {\n $this->info('All files have been published');\n }\n\n $this->info('Failed to publish');\n }", "public function handle()\n {\n $user = User::where('username', $this->argument('user'))\n ->orWhere('email', $this->argument('user'))\n ->first();\n\n if ($user != null) {\n $user->assign('admin');\n $this->line(\"{$user->email} was successfully made an admin.\");\n } else {\n $this->line(\"No user found where username or email is '{$this->argument('user')}'\");\n }\n }", "public function handle()\n {\n event( 'laraview:compile' );\n $this->checkForSelectedViewGeneration();\n\n app( RegisterBlueprint::class )\n ->console( $this )\n ->generate();\n }", "public function handle()\n {\n $project = Project::with(['team.admins', 'team.members'])->findOrFail($this->option('project-id'));\n $user = User::findOrFail($this->option('user-id'));\n if ($this->option('admin')) {\n $project->team->admins()->syncWithoutDetaching($user);\n } else {\n $project->team->members()->syncWithoutDetaching($user);\n }\n return Command::SUCCESS;\n }", "public function handle() {\n try {\n $this->roomService->loadRoomOccupations();\n Log::notice('untis:occupations executed successfully.');\n $this->line('Loaded room occupations from WebUntis.');\n } catch (Exception $e) {\n Log::error('Error loading room occupations.', ['exception' => $e]);\n $this->error('Error loading room occupations: ' . $e->getMessage());\n }\n }", "public function handle()\n {\n $this->loadIxList();\n $this->loadIxMembersList();\n $this->updateIxInfo();\n $this->updateIxMembersInfo();\n }", "public function handle()\n {\n $this->call('vendor:publish', [\n '--provider' => \"Qoraiche\\MailEclipse\\MailEclipseServiceProvider\",\n ]);\n }", "public function handle()\n\t{\n\t\tif ($this->option('dev')) {\n\t\t\tsystem('php '.base_path('.deploy/deploy-dev.php'));\n\t\t} else {\n\t\t\tsystem('php '.base_path('.deploy/deploy.php'));\n\t\t}\n\t}", "public function handle(Command $command);", "public function handle(Command $command);", "public function handle()\n {\n $date_from = $this->argument('date_from');\n\t\t$date_to = $this->argument('date_to');\n\t\tif(!$date_from) {\n\t\t\t$date_from = Carbon::today()->subDays(5);\n\t\t}\n\t\tif(!$date_to) {\n\t\t\t$date_to = Carbon::yesterday();\n\t\t}\n\t\tStats::computeMembers($this->argument('venue_id'), $date_from, $date_to);\n }", "public function handle()\n {\n switch ($this->argument('type')){\n case 'fih':\n $scrapper = new Scrappers\\FederationScrapper();\n $scrapper->get($this->option('level'));\n print $scrapper->message();\n break;\n }\n }", "public function handle()\n {\n Log::info(\"seed:dash Command is working fine!\");\n $this->info('Dashboard Database seeding completed successfully.');\n }", "public function handle()\n {\n $originalId = $this->argument('original_id');\n\n $status = true;\n if ($this->option('status') === 'false') {\n $status = false;\n }\n\n if ($video = Video::where('original_id', $originalId)->first()) {\n $video->dmca_claim = $status;\n $video->save();\n\n $this->info('Video\\'s dmca_claim set to: ' . json_encode($status));\n return ;\n }\n\n $this->error('No video found with original_id of: ' . $originalId);\n return;\n }", "public function handle()\n {\n $this->call('config:clear');\n\n $this->call('config:update');\n\n $this->info('Configuration cached successfully!');\n }", "public function handle()\n {\n //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\n }", "public function handle()\n {\n $filePath = 'public/' . $this->argument('fileName');\n $count = $this->argument('count');\n \n $fileData = array_slice(file($filePath), 0, $count);\n $this->info(implode('', $fileData));\n }", "public function handle()\n {\n $email = $this->argument('email');\n\n Mail::to($email)->send(new SendMailable('Test Mail'));\n\n if (Mail::failures()) {\n $this->info('Email failed to send');\n } else {\n $this->info('Email successfully sent');\n }\n }", "public function handle()\n {\n $this->call('route:trans:clear');\n\n $this->cacheRoutesPerLocale();\n\n $this->info('Routes cached successfully for all locales!');\n }", "public function handle()\n {\n $this->info('Welcome to command for Bantenprov\\WilayahIndonesia package');\n }", "public function handle()\n {\n if($this->hasOption('no_dump') && $this->option('no_dump')){\n $this->composer_dump = false;\n }\n $this->readyDatas();\n $this->datas['startSymbol']='{{';\n $this->datas['endSymbol']='}}';\n $this->create();\n }", "public function handle()\n {\n $repository = new OglasiCrawlerRepository();\n $ads = $repository->getAds();\n $repository->saveAds($ads);\n\n echo 'Ads were successfully retrieved' . PHP_EOL;\n }", "public function handle()\n {\n $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\n }", "public function handle()\n {\n $movies = \\App\\Models\\Movie::whereNull('meta')->take(40)->orderBy('id')->get();\n $movies->each(function($movie){ sleep(1); $movie->getMeta(); });\n return Command::SUCCESS;\n }", "public function handle()\n {\n $this->packageGenerator->setConsole($this)\n ->setPackage($this->argument('package'))\n ->setType('shipping')\n ->setForce($this->option('force'))\n ->generate();\n }", "public function handle()\n {\n $test = $this->argument('test');\n\n $dir = config('speed-test.dir');\n\n $className = ucfirst(\\Str::camel($test));\n\n $namespace = config('speed-test.namespace');\n\n $class = class_entity($className)\n ->namespace($namespace);\n\n $class->method('speed1')\n ->line($this->option('line'))->doc(function ($doc) use ($className) {\n /** @var DocumentorEntity $doc */\n $doc->tagCustom('times', $this->option('times'));\n $doc->description($this->option('description') ?: \"{$className} Speed 1\");\n });\n\n if (! is_dir($dir)) {\n mkdir($dir, 0777, 1);\n }\n\n file_put_contents(\n $dir.'/'.$className.'.php',\n $class->wrap('php')\n );\n\n $this->info('Speed created!');\n\n return 0;\n }", "public function handle()\n {\n $message = $this->GenerateRandomUser($this->argument('count'));\n $this->info($message);\n }", "public function handle()\n {\n $host = Cache::get('executingHost', null);\n $this->info(\"Host: ${host}\");\n\n if ($host === null) {\n $this->info('実行するホストが選択されていません');\n return;\n }\n\n if (Schema::hasTable('companies') && Company::count() !== 0) {\n $this->info('マイグレーションが既に1回以上実行されています');\n return;\n }\n\n $should_execute = $host === $this->argument('executingHost');\n\n if ($should_execute) {\n Artisan::call('migrate:fresh', ['--seed' => true]);\n $this->info('マイグレーションが完了しました');\n\n Cache::forget('executingHost');\n } else {\n $this->info('別ホストにてマイグレーションが行われます');\n }\n }", "public function handle()\n {\n // Configuration...\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-config']);\n\n // Migrations\n $this->callSilent('vendor:publish', ['--tag' => 'model-login-migrations']);\n\n $this->info('Model Login resources published.');\n }", "public function handle()\n {\n if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\n }", "public function handle()\n {\n $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\n }", "public function handle()\n {\n $this->publishConfig();\n $this->publishClassStub();\n $this->generateAndStoreKey();\n\n $this->info('Use the details below for your \"Lead delivery options\" in Google Ads.');\n $this->info('Webhook URL: ' . route('GoogleAdsLeadExtensionController@index'));\n $this->info('Key: ' . $this->generated_key);\n }", "public function handle()\n {\n $opts = $this->options();\n $args = $this->arguments();\n #print_r($opts);\n #print_r($args);\n\n # Redundant as argument validation handled by Laravel\n #\n if (!isset($args['destination'])) {\n printf(\"Usage: php artisan %s\\n\", $this->signature);\n exit(1);\n }\n\n # Default to normal message type\n #\n if (!isset($opts['type'])) {\n $opts['type'] = 'normal';\n }\n\n $uac = new UserApiController();\n\n if ($opts['type'] == 'normal') {\n if (!isset($opts['message'])) {\n printf(\"Usage: php artisan %s\\n\\n\", $this->signature);\n printf(\"ERROR: Message must be specified for type 'normal'\\n\");\n exit(1);\n }\n $result = $uac->sendSms(\n $args['destination'],\n $opts['message'],\n $opts['route']\n );\n }\n else if ($opts['type'] == 'otp') {\n $result = $uac->sendVerificationSms(\n $args['destination'],\n '<code>',\n '<name>',\n $opts['route'],\n '<appName>'\n );\n }\n\n if ($result === true) {\n printf(\"INFO: SMS message to %s sent successfully (%s)\\n\",\n $args['destination'], $opts['type']);\n }\n else {\n printf(\"INFO: SMS message to %s failed to send (%s)\\n\", \n $args['destination'], $opts['type']);\n printf(\"ERROR: %s\\n\", $result);\n }\n\n return;\n }" ]
[ "0.6469962", "0.6463639", "0.64271367", "0.635053", "0.63190264", "0.62747604", "0.6261977", "0.6261908", "0.6235821", "0.62248456", "0.62217945", "0.6214421", "0.6193356", "0.61916095", "0.6183878", "0.6177804", "0.61763877", "0.6172579", "0.61497146", "0.6148907", "0.61484164", "0.6146793", "0.6139144", "0.61347336", "0.6131662", "0.61164206", "0.61144686", "0.61109483", "0.61082935", "0.6105106", "0.6103338", "0.6102162", "0.61020017", "0.60962653", "0.6095482", "0.6091584", "0.60885274", "0.6083864", "0.6082142", "0.6077832", "0.60766655", "0.607472", "0.60739267", "0.607275", "0.60699606", "0.6069931", "0.6068753", "0.6067665", "0.6061175", "0.60599935", "0.6059836", "0.605693", "0.60499364", "0.60418284", "0.6039709", "0.6031963", "0.6031549", "0.6027515", "0.60255647", "0.60208166", "0.6018581", "0.60179937", "0.6014668", "0.60145515", "0.60141796", "0.6011772", "0.6008498", "0.6007883", "0.60072047", "0.6006732", "0.60039204", "0.6001778", "0.6000803", "0.59996396", "0.5999325", "0.5992452", "0.5987503", "0.5987503", "0.5987477", "0.5986996", "0.59853584", "0.5983282", "0.59804505", "0.5976757", "0.5976542", "0.5973796", "0.5969228", "0.5968169", "0.59655035", "0.59642595", "0.59635514", "0.59619296", "0.5960217", "0.5955025", "0.5954439", "0.59528315", "0.59513766", "0.5947869", "0.59456027", "0.5945575", "0.5945031" ]
0.0
-1
Complete refresh of page, rebuild all content from scratch i.e. index.php
function index($address) { $main_view = new Template('index'); $main_view->set('title', config('title')) ->set('alert_messages', lang('alert_messages')) ->set('page_address', $address) ->set('tab_view', $this->tabs()) ->set('project_header', lang('project_header')) ->set('project_view', $this->projects()) ->set('filter_header', lang('filter_header')) ->set('filters', lang('filter_settings')) ->set('tag_header', lang('tag_header')) ->set('tag_view', $this->tags()) ->set('task_view', $this->all()) ->set('langs', config('lang_list')) ->set('cur_lang', ini('language')); return $main_view; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function refresh();", "public function refresh();", "public function reload() {\n $this->init();\n redirect('./');\n }", "public function refresh() {\n\t\t$this->redirect( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '/' );\n\t}", "public function reload();", "public function reload();", "public function reload();", "public function reload();", "public function refresh() {}", "function refresh();", "function reload();", "abstract public function refresh();", "public function refresh(): void;", "function Refresh();", "public function reload() {\r\n if ($this->pathname) {\r\n $this->contents = file_get_contents($this->pathname);\r\n }\r\n }", "public function clearPageCacheContent() {}", "public function Reload()\n\t{\n\t\t$this->load->view('reload');\n\t}", "function refresh() {\n $missing = array_keys($this->dl + $this->en);\n $this->dl = array();\n $this->en = array();\n $this->visited = array();\n $this->requireModules($missing, '(missing)');\n }", "private function warmUp()\r\n\t{\r\n\t\t$this->loadPage( 1 );\r\n }", "public function reload ()\r\n {\r\n $this->_load();\r\n }", "private function refreshCache()\n {\n\n\t\t// any valid date in the past\n\t\theader(\"Expires: Mon, 26 Jul 1997 05:00:00 GMT\");\n\t\t// always modified right now\n\t\theader(\"Last-Modified: \" . gmdate(\"D, d M Y H:i:s\") . \" GMT\");\n\t\t// HTTP/1.1\n\t\theader(\"Cache-Control: private, no-store, max-age=0, no-cache, must-revalidate, post-check=0, pre-check=0\");\n\t\t// HTTP/1.0\n\t\theader(\"Pragma: no-cache\");\n\t}", "public function index() {\n $this->html->displayHeaderAndFooter(true);\n $this->load_content();\n }", "public function reAnimate()\n {\n $this->addOrRemovePublishedAtTimeToFrontmatter();\n\n // get last modified unixtime from file\n $lastModified = filemtime($this->index_path);\n\n // check if file has been modified since last save\n if ($this->post->last_modified != $lastModified) {\n $data = $this->prepareContentData();\n $this->post = $this->content->update($this->post, $data);\n $this->addSlugToFrontmatter();\n $this->regenerateStatic($this->post->id, $this->path.'/index.md', $this->frontmatter, $this->discharger->getMarkdown());\n clearstatcache();\n $data['last_modified'] = filemtime($this->path.'/index.md');\n $this->post = $this->content->update($this->post, $data);\n }\n }", "public function rebuildAction() {\n $result = $this->_rebuild();\n echo json_encode($result);\n die();\n }", "public function refresh()\n {\n }", "function refresh() {\n\t\t$this->session->unset_userdata ( $this->module . \"_search_field\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_search_value\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_search_status\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_order_by_value\" );\n\t\t$this->session->unset_userdata ( $this->module . \"_order_by_field\" );\n\t\tredirect ( admin_url () . $this->module );\n\t}", "public function printRefreshScript()\n {\n if (isset($_GET['post']) && is_numeric($_GET['post']) && isset($_GET['action']) && $_GET['action'] == \"edit\") {\n\n //Store post id to var\n $post_id = $_GET['post'];\n\n //Check if is published && url is valid\n if (get_post_status($post_id) == 'publish') {\n $url = get_permalink($post_id);\n\n if (!filter_var($url, FILTER_VALIDATE_URL) === false) {\n if (function_exists('curl_init')) {\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);\n curl_setopt($ch, CURLOPT_TIMEOUT_MS, 10);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_exec($ch);\n curl_close($ch);\n echo '<!-- Cache redone for ' . $url . ' -->';\n }\n }\n }\n }\n }", "public function reload() {\n\t\t$this->invoke(\"reload\");\n\t}", "function rebuildAll(){\n\t\t\t$this -> rebuild($_SERVER['DOCUMENT_ROOT'].\"/\".$this -> rootFolder);\t\n\t\t}", "public function index()\n\t{\n\t\t$this->cache = Cache::instance();\n\t\t$this->cache->delete_all();\n\t}", "function ClearCache()\n\t{\n\t\tglobal $gCms;\n\t\t$smarty =& $gCms->GetSmarty();\n\n\t\t$smarty->clear_all_cache();\n\t\t$smarty->clear_compiled_tpl();\n\n\t\tif (is_file(TMP_CACHE_LOCATION . '/contentcache.php'))\n\t\t{\n\t\t\tunlink(TMP_CACHE_LOCATION . '/contentcache.php');\n\t\t}\n\n\t\t@touch(cms_join_path(TMP_CACHE_LOCATION,'index.html'));\n\t\t@touch(cms_join_path(TMP_TEMPLATES_C_LOCATION,'index.html'));\n\t}", "public function Refresh ()\n\t{\n\t\t\n\t\t// Refresh session\n\t\t\n\t\tsession_unset ();\n\t\tsession_regenerate_id ();\n\t\t\n\t}", "public static function clear() \n\t\t{\n\t\t\tSite_CacheManager::flush('page');\n\t\t}", "public function index()\n\t{\n\t\tredirect('dashboard','refresh');\n\t}", "public function index() {\n\t\t$this->response->header('Pragma', 'public');\n\t\t$this->response->cache('-1 minute', '+ 10 years');\n\t\t$this->response->expires('+ 10 years');\n\t\t$this->layout = false;\n\t\t$this->set('locale', 'en_US');\n\t}", "public function homePage() {\n #$this->view->loadTemplate( 'elements_example');\n $this->view->loadTemplate( LNG . '/centercontent');\n $this->commitReplace($this->view->render(), '#two', true);\n }", "public function reloadCaches() {}", "function app_auto_refresh(int $delay)\n{\n header('Refresh: ' . $delay . '; ' . $_SERVER['REQUEST_URI']);\n}", "public function index()\n\t{\n\t\t$cachePath = $this->templateCacheFilePath();\n\t\tif ( (!file_exists($cachePath)) || (filemtime($cachePath) < strtotime('-1 hour')) )\n\t\t{\n\t\t\t$this->generateTemplateCache();\n\t\t}\n\t\treturn $this->redirect($this->WordPressAbsoluteURL());\n\t}", "public function run() {\n\t\t$start = microtime(true);\n\t\t$parser = ZC_PARSER;\n\t\t\n\t\t// init session\n\t\tsession_start();\n\t\t\n\t\t// are we admin ?\n\t\t$this->is_admin = $this->isAdmin();\n\t\t\n\t\t// get path\n\t\t$path = isset( $_REQUEST[ 'path' ] ) ? $_REQUEST[ 'path' ] : null;\n\t\tif ( @empty( $path ) )\n\t\t\t$path = 'index';\n\t\telse\n\t\t\t$path = preg_replace( '#(?:\\.tx|/+)$#', '', $path );\n\t\t$this->current_path = $path;\n\t\tzc_log( \"PATH '$path'\" );\n\t\t\n\t\t// admin can edit and save\n\t\tif ( $this->is_admin ) {\n\t\t\t\n\t\t\t// save ?\n\t\t\tif ( ! @empty( $_POST[ 'content' ] ) ) {\n\t\t\t\ttry {\n\t\t\t\t\t$this->_pluginRunHook( 'PreSave', array( $path ) );\n\t\t\t\t\t$this->_savePost( $_POST[ 'content' ], $path );\n\t\t\t\t\t$this->_pluginRunHook( 'PostSave', array( $path ) );\n\t\t\t\t}\n\t\t\t\tcatch( Exception $e ) {}\n\t\t\t\theader( 'Location: /'. $path );\n\t\t\t}\n\t\t\t\n\t\t\t// edit ?\n\t\t\telseif ( isset( $_REQUEST[ 'edit' ] ) ) {\n\t\t\t\tprint $this->_editForm( $path );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// clear cache ?\n\t\t\telseif ( isset( $_REQUEST[ 'clear-cache' ] ) ) {\n\t\t\t\t$this->_cacheClear();\n\t\t\t\t$this->_pluginRunHook( 'PostClearCache', array( $path ) );\n\t\t\t\theader( 'Location: /'. $path );\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// dont give a ** about non-utf8\n\t\t#header( 'Content-type: text/html; charset='+ ZC_CHARSET_OUT );\n\t\theader( 'Content-type: text/html' );\n\t\t\n\t\t// get site contents\n\t\t$this->render_marker = array();\n\t\t$this->render_seen = array();\n\t\t\n\t\t$content = null;\n\t\ttry {\n\t\t\t$this->_pluginRunHook( 'PreContentRender', array( $path ) );\n\t\t\t$content = $this->_renderPage( $path );\n\t\t\t$this->_pluginRunHook( 'PostContentRender', array( $path, $content ) );\n\t\t}\n\t\tcatch( ZeroCmsHookException $e ) {\n\t\t\tif ( $e->hasArg( 'content' ) ) {\n\t\t\t\t$content = $e->getArg( 'content' );\n\t\t\t\tif ( ! $e->hasArg( 'noLayout' ) || $e->getArg( 'noLayout' ) !== true )\n\t\t\t\t\t$content = $this->_renderLayout( $content );\n\t\t\t}\n\t\t\telseif ( $e->hasArg( 'fallback' ) && $e->getArg( 'fallback' ) === true )\n\t\t\t\t$content = $this->_renderPage( $path );\n\t\t\terror_log( \"** EXCEPTION: '$e' **\" );\n\t\t}\n\t\t\n\t\t// no content received -> 404\n\t\tif ( is_null( $content ) ) {\n\t\t\t$content = '<div class=\"error\">Page not found 404</div>';\n\t\t\t$this->current_error = '404';\n\t\t\t$content = $this->_renderLayout( $content );\n\t\t}\n\t\telse\n\t\t\t$this->current_error = null;\n\t\t\n\t\t// render out\n\t\tif ( ZC_PRINT_RENDER_TIME === true )\n\t\t\t$content .= '<!-- Render '. ( microtime(true) - $start ). ' seconds -->';\n\t\t\n\t\t// print, done\n\t\tprint $content;\n\t}", "public function displayContent(){\n\t\t\tinclude('/includes/homepage.inc.php');\t\n\t\t}", "private function reload() {\r\n\r\n \t\t$timestamp = (int) (microtime(true) * 1000);\r\n\r\n \t\t// if the value is empty\r\n \t\tif ($this->NEXT_REQUEST_TIMESTAMP > $timestamp) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\t$this->load();\r\n \t}", "protected final function reload() {\n\t\treturn $this->redirect(Router::getPath());\n\t}", "public function indexAction() {\n\t\t$db = Mage::getSingleton('core/resource')->getConnection('core_write');\n\t\t$db->query(\"DELETE FROM core_resource WHERE code = 'ajax_setup';\");\n\t\t$db->query(\"DELETE FROM core_config_data WHERE path LIKE '%et_ajax_configs/%';\");\n\t\tob_start();\n\t\techo '<b>Default Config Section: et_ajax_configs</b>';\n\t\techo '<pre>';\n\t\t$helper = Mage::helper('ajax');\n\t\techo '<a href=\"'.$this->_getRefererUrl().'\">Go back</a>';\n\t\t$content = ob_get_clean();\n\t\t$this->getResponse()->setBody($content);\n\t}", "public function reindexAll()\n {\n $this->_getIndexer()->rebuildIndex();\n }", "static function main() {\n\t\t$container = isset($_SESSION[SESSIONID]) ? $_SESSION[SESSIONID] : null;\n\t\tif(!$container instanceof NewFTPMirror || isset($_REQUEST['reload'])) {\n\t\t\t$container = new NewFTPMirror();\n\t\t\t$_SESSION[SESSIONID] = $container;\n\t\t}\n\n\t\t// Set up a page for tracking the response for this request\n\t\t$page = new Page(STYLESHEET);\n\t\t\n\t\t// Service the request, tracking results and output on the given DOM\n\t\t$container->service($page->result);\n\t\t\n\t\t// Send the page for post-processing and output\n\t\t$page->send();\n\t\t\n\t\t// Save anything changed in the session\n\t\t$_SESSION[SESSIONID] = $container;\n\t}", "public function _cache_refresh_all()\n {\n }", "private function loadPage()\n\t{\n\t $data = $this->getData();\n \t \n\t $this->load->view('index', $data);\n\t}", "public function refresh_menu()\n\t{\n\t\tFsb::$menu->refresh_menu();\n\t\tDisplay::message('adm_well_refresh', 'index.' . PHPEXT, 'index_adm');\n\t}", "public function actionIndex()\n\t{\n\t\t// do stuff that's not the main content?\n\t}", "function index(){\n\t\tredirect('');\n\t}", "public function refresh()\n {\n session_regenerate_id(true);\n }", "public function refresh()\n {\n $sess = $this->_di->get('Input')->getAll('session');\n $id = session_regenerate_id(true);\n session_destroy();\n session_start();\n $_SESSION = $sess;\n }", "public function index()\n {\n $this->load->model('extension/module/siteMapGenerate');\n $this->includedFiles = [];\n $this->deleteSiteMap();\n $this->generateSiteMapCategories();\n $this->generateSiteMapProducts();\n $this->generateSiteMapMain();\n }", "public function reset()\n {\n\t Cache::forget('welcome-page');\n\t \n\t $defautl = \\File::get(public_path('template/backup.tpl'));\n\t \\File::put(public_path('template/default.tpl'), $defautl);\n\n\t Cache::forever('welcome-page', $defautl);\n\n\t return redirect()->route('admin.ladi.index')->with('status', 'Khôi phục template thành công!');\n }", "private function markCurrentPage() {\n $this->pageReloadMarker = $this->randomMachineName();\n $this->getSession()->executeScript('document.body.appendChild(document.createTextNode(\"' . $this->pageReloadMarker . '\"));');\n }", "public function action_index()\n {\n $this->request->response = $this->render_layout($this->widget_sites());\n }", "public static function handleReload()\n {\n \\Controller::reload();\n }", "public function refresh(): void\n {\n $this->query('SELECT 1')->execute();\n }", "private function indexAction()\n {\n $page = isset($_GET['page']) ? substr($_GET['page'],0,-1) : \"home\" ;\n $this->reg->pages->getPageContent(strtolower($page));\n }", "public function finished() {\n\t\t// Reset the CSS.\n\t\tupdate_option( 'fusion_dynamic_css_posts', [] );\n\t}", "public function index() {\n\t\t\t$this->render();\n\t\t}", "public function index() {\n $this->template->attach($this->resours);\n $this->template->draw('index/index', true);\n }", "function reload_all() {\n\tsend_event(\"service reload all\");\n}", "abstract protected function needRefresh();", "function refreshPage($tiempo,$url)\n{\n print \"<META HTTP-EQUIV=\\\"Refresh\\\" CONTENT=\\\"$tiempo; URL=$url\\\">\";\n if($tiempo==0)\n exit();\n}", "public function refresh ($blnReload = false) {\n $this->mctHut->refresh($blnReload);\n\t}", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function reindexAll()\n {\n }", "public function indexAction() {\n\t\t// loads index view\n\t\t// handle errors\n\t\tif (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == \"XMLHttpRequest\") {\n\t\t $this->view->setTemplate('ajax');\n\t\t}\n\t\tif(!empty($_SESSION['error'])) {\n\t\t $this->view->error = $_SESSION['error'];\n unset($_SESSION['error']);\n }\n\t}", "protected function refreshIndex()\n {\n return $this->index->refresh();\n }", "public function index( ) {\n $this->carregarDepencias();\n $this->addClasseBody('page-header-fixed page-quick-sidebar-over-content');\n\n\t\t$this->tpl = $this->CarregarTemplate( 'index.tpl.php' );\n\n\t\t$this->tpl->Renderizar();\n\n\t}", "public function actionIndex() {\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->layout = '//layouts/admin_iframe_main';\n\t\t$this->render('index');\n\t\t//$this->_actionManageBasicSiteInfo ();\n\t}", "function refresh($params) {\n $this->data['question'] = $this->helper->question = $this->CI->model('SocialQuestion')->get(intval($params['questionID']))->result;\n $this->data['bestAnswers'] = $this->getBestAnswers($this->CI->model('SocialQuestion')->getBestAnswers($this->data['question'])->result);\n $this->helper->bestAnswerTypes = $this->bestAnswerTypes;\n $content = ($this->data['bestAnswers']) ? $this->render('BestAnswers', array('bestAnswers' => $this->data['bestAnswers'])) : '';\n\n header('Content-Length: ' . strlen($content));\n header('Content-type: text/html');\n echo $content;\n }", "public function indexAction()\n\t\t{\n//\t\t\techo 'first leg';\n\t\t\t//$this->view->layout =''\n\t\t}", "public function ee_breakouts_page_load() {}", "public function renew(){\n\t\tinclude 'gui/template/UserTemplate.php';\n\t}", "public function reload()\n {\n $data['webpages'] = WebPage::orderBy('id', 'desc')->paginate(10);\n\n return view('webpage.table', $data);\n }", "public function indexAction()\n\t{\n\t\t// Render\n\t\t/*$this->_helper->content\n\t\t\t//->setNoRender()\n\t\t\t->setEnabled()\n\t\t\t;*/\n\t}", "private function buildPage() {\n ob_clean();\n ob_start();\n\n //session_start();\n require_once $this->_template;\n\n $this->_page = ob_get_clean();\n }", "public function clear() {\n header( \"Location:\" . $this->url() );\n }", "public function index()\n\t{\n\t\t$this->layout->render();\n\t}", "public function reset()\n\t{\n\t\t$this->hasScripts = false;\n\t\t$this->cssFiles = array();\n\t\t$this->css = array();\n\t\t$this->scriptFiles = array();\n\t\t$this->scripts = array();\n\t\t$this->metaTags = array();\n\n\t\t$this->recordCachingAction('clientScript', 'reset', array());\n\t}", "public function indexAction()\n {\n $this->page = Brightfame_Builder::loadPage(null, 'initialize.xml');\n \n // load the data\n Brightfame_Builder::loadPage(null, 'load_data.xml', $this->page);\n\n // load the view\n Brightfame_Builder::loadPage(null, 'load_view.xml', $this->page, $this->view);\n \n // render the page\n $this->view->page = $this->page;\n $this->view->layout()->page = $this->page->getParam('xhtml');\n }", "public function refresh_all_sites()\n\t{\n\t\t$sites = get_sites( array( 'number' => 99999));\n\t\t\n\t\tforeach( $sites as &$site )\n\t\t{\n\t\t\t$this->refresh_site( $site->blog_id );\n\t\t}\n\t\t$this->model->update_option( 'sites-refresh-time', date('Y-m-d H:i:s') );\n\t}", "public function index() {\n redirect(site_url('admin/dashboard'), 'refresh');\n }", "function reload () {\n\t\t\t$cmd = \"sh \".NEXUS.\"/core/bin/scripts/exec.sh /bin/bash /etc/squid3/squid.reload\";\n\t\t\t$ret = shell_exec(html_entity_decode($cmd)).\"\\n\";\n\t\t}", "public function index()\n\t{\n\n\t\treturn \\Cache::remember('homepage', 30, function() {\n\n\t\t\t$response = file_get_contents(app()->basePath('index.html'));\n\n\t\t\t$response = str_replace('{{url}}', env('APP_URL'), $response);\n\n\t\t\treturn $response;\n\n\t\t});\n\n\t}", "public function index(){\r\n\r\n\t\t$this->masterpage->setMasterPage(get_option('template') );\r\n\r\n\t\t$data = array('logs'=> $this->logs_m->get_last_logs(100) );\r\n\r\n\t\t$this->masterpage->addContentPage('logs', 'contentmain', $data);\r\n\r\n\t\t$this->masterpage->show( );\r\n\t}", "public function reindex();", "function recache()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&amp;un=1\" : \"\";\n\t\t\n\t\t//-----------------------------------------\n\t\t// Components\n\t\t//-----------------------------------------\n\t\t\n\t\t$components = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/components.php', 'ad_components' );\n\t\t$components->components_rebuildcache();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Forum Cache\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->update_forum_cache();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Group Cache\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->cache['group_cache'] = array();\n\t\t\n\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'groups'\n\t\t\t\t\t\t\t\t\t\t) );\n\t\t$this->ipsclass->DB->exec_query();\n\t\t\n\t\twhile ( $i = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->cache['group_cache'][ $i['g_id'] ] = $i;\n\t\t}\n\t\t\n\t\t$this->ipsclass->update_cache( array( 'name' => 'group_cache', 'array' => 1, 'deletefirst' => 1 ) );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Settings\n\t\t//-----------------------------------------\n\t\t\n\t\t$settings = $this->ipsclass->load_class( ROOT_PATH.'sources/action_admin/settings.php', 'ad_settings' );\n\t\t$settings->setting_rebuildcache();\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&amp;code=work&amp;mod={$this->ipsclass->input['mod']}&amp;step={$this->ipsclass->input['step']}{$uninstall}&amp;st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />IPB caches updated....\" );\n\t}", "public static function refresh()\n {\n //self::delete(name_of_session);\n }", "function clear_cache() {\n $this->output->set_header(\"cache-control: no-store, no-cache, must-revalidate, no-transform, max-age=0, post-check=0, pre-check=0\");\n $this->output->set_header(\"Pragma:no-cache\");\n }", "public function indexAction() {\n\t\t$this->_initAction()\n\t\t\t->renderLayout();\n\t}", "function template_dir_refresh()\n\t\t\t{\n\t\t\t\t$d = dir($this->templates_dir);\n\t\t\t\twhile(false !== ($e = $d->read()))\n\t\t\t\t{\n\t\t\t\t\tif(substr($e,-4)=='.php')\n\t\t\t\t\t{\n\t\t\t\t\t\t$tpl[md5($e)] = $e;\n\t\t\t\t\t}\n\t\t\t\t\telseif(substr($e,-4)=='.tpl')\n\t\t\t\t\t{\n\t\t\t\t\t\t$tpl[md5($e)] = $e;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$h = CONF::get('template_dir_refresh');\n\t\t\t\t$hash = md5(serialize($tpl));\n\t\t\t\tif($h==$hash)\n\t\t\t\t{\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t// remove old\n\t\t\t\t$update = \"UPDATE \".$this->tbl_tpl.\" SET sys_trashcan = 1 WHERE tpl_name NOT IN ('\".implode(\"','\",$tpl).\"')\";\n\t\t\t\t$r = $this->DB->query($update);\t\t\t\t\n\t\t\t\t// add new \n\t\t\t\t$select = \"SELECT * FROM \".$this->tbl_tpl.\" WHERE !sys_trashcan\";\n\t\t\t\t$r = $this->DB->query($select);\n\t\t\t\twhile($r->next())\n\t\t\t\t{\n\t\t\t\t\tunset($tpl[md5($r->f('tpl_name'))]);\n\t\t\t\t}\n\t\t\t\tforeach($tpl as $t)\n\t\t\t\t{\n\t\t\t\t\t$insert[] = \"('\".$t.\"','\".preg_replace(\"/_/\",\" \",strtoupper(substr($t,0,-4))).\"')\";\n\t\t\t\t}\n\t\t\t\tif($insert)\n\t\t\t\t{\n\t\t\t\t\t$insert = \"INSERT INTO \".$this->tbl_tpl.\" ( tpl_name, label ) VALUES \".implode(\",\",$insert);\n\t\t\t\t\t$this->DB->query($insert);\n\t\t\t\t}\n\t\t\t\tCONF::set('template_dir_refresh',$hash);\n\t\t\t}", "function homepage()\n {\n $posts = array_reverse($this->postManager->getPosts());\n require('view/frontend/homepageView.php');\n }", "protected function displayContent() {\r\n\t\t$this -> model -> processLogout();\r\n\t\theader('Location: index.php?page=home');\r\n\t}", "public function index() \n\t{\n\t\t$this->_render_hod_view('home');\n\t}", "public function indexAction() {\r\n\r\n $this->loadLayout();\r\n $this->renderLayout();\r\n }", "public function realPageCacheContent() {}", "public function indexAction()\n\t{\n\t\t$this->loadLayout();\n\t\t$this->renderLayout();\n\t\t\n\t}" ]
[ "0.7084916", "0.7084916", "0.69342417", "0.6917513", "0.6766367", "0.6766367", "0.6766367", "0.6766367", "0.6688505", "0.66383743", "0.66333896", "0.6499072", "0.6473127", "0.629219", "0.6266816", "0.6224105", "0.6194355", "0.6162706", "0.6100035", "0.6099567", "0.6061168", "0.60471827", "0.60424846", "0.5977778", "0.5958431", "0.58934903", "0.5891269", "0.58760256", "0.5862393", "0.5846225", "0.58387023", "0.583638", "0.5808982", "0.5785671", "0.5768046", "0.57452905", "0.5719464", "0.571186", "0.56882346", "0.5684201", "0.56642115", "0.5658742", "0.56534165", "0.56525624", "0.5644207", "0.56440663", "0.56360584", "0.5635727", "0.5633791", "0.56291944", "0.56105053", "0.560465", "0.56012756", "0.55994725", "0.55918276", "0.5586598", "0.55830383", "0.55760396", "0.55602664", "0.5556691", "0.5540215", "0.5539273", "0.5533894", "0.5529234", "0.5523931", "0.55093944", "0.55085766", "0.54977137", "0.54972315", "0.54914147", "0.54851437", "0.5480871", "0.5476873", "0.5473641", "0.5468166", "0.54679126", "0.54612726", "0.5439169", "0.5438583", "0.54376084", "0.5432277", "0.5430092", "0.5428631", "0.54270554", "0.5425596", "0.5411315", "0.54096174", "0.5405681", "0.54035383", "0.54000455", "0.5394305", "0.53892225", "0.5376147", "0.53683674", "0.53637713", "0.53550047", "0.5343387", "0.5342886", "0.53401697", "0.53394663", "0.53359205" ]
0.0
-1
Returns true if file is ready to be moved to its destination.
public function IsValid() { return $this->Error === UPLOAD_ERR_OK; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function waitingForFile(){\n return !empty($this->check_for_file);\n }", "protected function isStreamFinished()\n {\n return gzeof($this->file);\n }", "public function checkConvertionComplete()\r\n\t{\r\n\t\treturn (!file_exists($this->referenceFile) || @filesize($this->referenceFile) == 0);\r\n\t}", "public function move(string $destination): bool\n {\n return move_uploaded_file($this->tmpName, $destination);\n }", "public function isDone(): bool\n {\n $criteria = Criteria::create()\n ->where(\n new Comparison(\n 'status',\n Comparison::IN,\n array(\n File::FILE_NEW,\n File::FILE_IN_QUEUE\n )\n )\n );\n\n return count($this->files->matching($criteria)) === 0;\n }", "public function isThere() {\n\n if($this->options['overwrite'] === true) return false;\n\n // if the thumb already exists and the source hasn't been updated\n // we don't need to generate a new thumbnail\n if(file_exists($this->destination->root) && f::modified($this->destination->root) >= $this->source->modified()) return true;\n\n return false;\n\n }", "public function hasReadyFiles() {\n\n $projectJobFile = $this->hasFile();\n\n if(!$projectJobFile instanceof ProjectJobFile || !$projectJobFile->isSuccessful())\n return false;\n\n return true;\n\n }", "public function isWritable()\n {\n // Create temp file\n $path = tempnam(sys_get_temp_dir(), 'test');\n\n // Get temp file name\n $fileName = basename($path);\n\n // Copy temp file to remote\n if (ftp_put($this->handle, $fileName, $path, FTP_ASCII)) {\n // Remove temp file\n ftp_delete($this->handle, $fileName);\n return true;\n }\n\n return false;\n }", "public function hasFinishWrite(){\n return $this->_has(3);\n }", "public function valid() {\r\n\t\tif (feof($this->handle)) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\treturn true;\r\n\t\t}\r\n }", "protected function needsBuild() {\n list($start, $end) = $this->timeframe->getTimestamps();\n if (!$this->isFile()) {\n return TRUE;\n }\n $mtime = $this->getMTime();\n if ($mtime < $end) {\n // The interval was still ongoing the last time the file was generated.\n // We regenerate the file if the refresh interval has passed since then.\n $t = new \\DateTime();\n $t->sub($this->refreshInterval);\n return $t->getTimestamp() > $mtime;\n }\n return FALSE;\n }", "public function moveTo($destination)\n {\n if ($this->exists()) {\n $result = move_uploaded_file($this->current_filepath, $destination);\n\n if ($result) {\n $this->current_filepath = $destination;\n }\n\n return $result;\n }\n return false;\n }", "public function isWriteCompleted(): bool {\n return $this->_builder->isWriteCompleted();\n }", "private function wasFileSent() : bool\n {\n return isset($_FILES[$this->fieldName]['name']) && !empty($_FILES[$this->fieldName]['name']);\n }", "public function moveLoadedTo($path) {\n\n ///////verificando si en efecto se subio\n\n if (!is_uploaded_file($this->fileTempName)) {\n\n $this->javaviso(\"Error al subir el archivo, Verifique los permisos de escritura en el directorio ' $destino ' ó intente subir otro archivo \");\n return false;\n }\n\n /**\n * revisar permisos de escritura sobre el directorio\n */\n if (!move_uploaded_file($this->fileTempName, $path)) {\n\n $this->javaviso(\"Error al subir el archivo, quizas este corrupto\");\n return false;\n }\n\n return true;\n }", "public function upgrade() {\n if (file_exists($this->fullpath)) {\n // Save the new file and report it\n return $this->handleSave();\n }\n\n return false;\n }", "protected static function need_compile($source, $destination)\n {\n clearstatcache();\n\n if( ! file_exists($source) )\n return FALSE;\n\n if ( ! file_exists($destination) )\n return TRUE;\n\n if ((filemtime($source) > filemtime($destination))\n || (fileatime($source) > fileatime($destination)))\n return TRUE;\n return FALSE;\n }", "public function isSeekable()\n {\n return true;\n }", "public function move(\\Drone\\Filesystem\\File $file)\n\t{\n\t\tif(!$this->__isFile())\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn rename($this->_path, $file->getPath());\n\t}", "public function isSeekable() {}", "public function taskIsDone()\n {\n // If file exists, the related task is still busy.\n return ! file_exists($this->taskFilePath);\n }", "public function isSeekable()\n {\n }", "public function isSeekable()\n {\n return $this->metadata && $this->metadata['seekable'];\n }", "private function beforeMove(): bool\n {\n $event = new MoveEvent();\n $this->trigger(self::EVENT_BEFORE_MOVING, $event);\n\n return $event->canMove;\n }", "public function hasChangingFilename() : bool\n {\n return $this->filenameIsChanging;\n }", "private function shouldHookBeMoved(): bool\n {\n return !empty($this->moveExistingTo);\n }", "public function isFile()\n {\n $this->is_file = false;\n\n try {\n\n if (@ftp_get($this->getConnection(), $this->temp, $this->path, Ftp_ASCII, 0)) {\n $this->is_file = true;\n }\n\n } catch (\\Exception $e) {\n }\n\n return;\n }", "public function qualifyAsFinished(): bool;", "public function isQueued(): bool\n {\n $criteria = Criteria::create()\n ->where(\n new Comparison(\n 'status',\n Comparison::IN,\n array(\n File::FILE_IN_QUEUE\n )\n )\n );\n\n return count($this->files->matching($criteria)) > 0;\n }", "private function checkDestinationWritable()\n {\n $destination = $this->getDestination();\n $dirName = dirname($destination);\n\n if (@is_writable($dirName) && @is_executable($dirName)) {\n // all is well\n return;\n }\n\n // The above might fail on Windows, even though dir is writable\n // So, to be absolute sure that we cannot write, we make an actual write test (writing a dummy file)\n // No harm in doing that for non-Windows systems either.\n if (file_put_contents($destination, 'dummy') !== false) {\n // all is well, after all\n unlink($destination);\n return;\n }\n\n throw new CreateDestinationFileException(\n 'Cannot create file: ' . basename($destination) . ' in dir:' . dirname($destination)\n );\n }", "function final_move($bean_id)\n\t{\n\t\tglobal $log, $root_directory, $upload_dir;\n\t\t$log->debug(\"Entering final_move(\".$bean_id.\") method ...\");\n\n\t\t$file_name = $bean_id.$this->stored_file_name;\n\t\t$destination = $root_directory.'/'.$upload_dir.$file_name;\n\n\t\tif (!move_uploaded_file($_FILES[$this->field_name]['tmp_name'], $destination)) {\n\t\t\tdie (\"ERROR: can't move_uploaded_file to destination\");\n\t\t}\n\t\t$log->debug(\"Exiting final_move method ...\");\n\t\treturn true;\n\t}", "public function isSeekable();", "public function isComplete()\n {\n return !$this->isOpen();\n }", "public function isSeekable()\n {\n return false;\n }", "public function isReadable()\n {\n $this->is_readable = null;\n\n if ($this->exists === true) {\n } else {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n $r = substr($this->temp_files[$this->path]->permissions, 1, 1);\n\n if ($r == 'r') {\n $this->is_readable = true;\n } else {\n $this->is_readable = false;\n }\n\n return;\n }", "private function _determine_write_this()\n\t{\n\t\t// Not a directory and doesn't exist already...\n\t\tif (substr($this->_current['filename'], -1) !== '/' && !file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t{\n\t\t\t$this->_write_this = true;\n\t\t}\n\t\t// File exists... check if it is newer.\n\t\telseif (substr($this->_current['filename'], -1) !== '/')\n\t\t{\n\t\t\t$this->_write_this = $this->overwrite || filemtime($this->destination . '/' . $this->_current['filename']) < $this->_current['mtime'];\n\t\t}\n\t\t// Folder... create.\n\t\telseif ($this->destination !== null && !$this->single_file)\n\t\t{\n\t\t\t// Protect from accidental parent directory writing...\n\t\t\t$this->_current['filename'] = strtr($this->_current['filename'], array('../' => '', '/..' => ''));\n\n\t\t\tif (!file_exists($this->destination . '/' . $this->_current['filename']))\n\t\t\t{\n\t\t\t\tmktree($this->destination . '/' . $this->_current['filename']);\n\t\t\t}\n\t\t\t$this->_write_this = false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->_write_this = false;\n\t\t}\n\t}", "public function fileNeedsProcessing() {}", "public function isSeekable()\n {\n // if resource is seekable\n if ($this->traitIsSeekable())\n {\n // seeking write streams is only possible if\n // the internal buffer is flushed and empty\n return ($this->writable && $this->data === '');\n }\n return false;\n }", "public function isCompleted(): bool\n {\n return ($this->progress_error + $this->progress_ok) >= \\count($this->state->getSourceStates());\n }", "public function isSeekable()\n {\n return $this->seekable;\n }", "public function valid()\n {\n $this->fileIterator->seek($this->position);\n return $this->fileIterator->valid();\n }", "public function isFinished(): bool;", "public function upload() {\n $out = false;\n\n if ( $this->isValidFile() ) {\n $newImage = $this->destination . \"/\" . $this->filename;\n if ( move_uploaded_file( $this->file, $newImage ) ) {\n $out = true;\n }\n } else {\n $this->typeErrorDetected = true;\n }\n return $out;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return false;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->url = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n return true;\n }", "function isSeekable()\n {\n return false;\n }", "public function isStatusValidToStart()\n {\n if ($this->pubDirectory->isExist($this->getRelativeFilePath(self::IMPORT_STATUS_READY))) {\n return true;\n }\n return false;\n }", "public function hasChanged() {\n\t\treturn trim( $this->fileSize ) != trim( $this->currentSize );\n\t}", "public function isAlreadyDownloaded(): bool\n {\n return file_exists($this->getFilePath());\n }", "function isReady()\n\t{\n\t\treturn ($this->getCompleteResult() !== false);\n\t}", "public function isValidMove()\n {\n if ($this->getXCor() != $this->getEndXCor()\n && $this->getYCor() != $this->getEndYCor()\n ) {\n return false;\n }\n\n return true;\n }", "public function valid()\n {\n if (!file_exists($this->_filePath)) {\n return false;\n }\n if (!$this->_getFileHandle()) {\n return false;\n }\n return $this->_valid;\n }", "public function moveFileTo($copyLocation) {\r\n\t\tif ($this->copyFileTo ( $copyLocation )) {\r\n\t\t\treturn $this->deleteFile ();\r\n\t\t\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function accept(): bool\n {\n $accept = false;\n if (parent::accept()) {\n if ($this->isDir()) {\n $accept = true;\n } else if ($this->current()->getImgId() === null) {\n // do not sync a file, which is not in database\n $accept = false;\n } else {\n $accept = $this->checkSyncDate();\n }\n }\n return $accept;\n }", "public function isReadable(): bool\n {\n return is_readable($this->directory->getPath().'/'.$this->filename);\n }", "public function is_files_scanned() {\r\n\t\t$this->refresh_status();\r\n\t\treturn $this->is_scanned;\r\n\t}", "public function exists() {\n\n\t\tif ($this->fileInfo->isFile() && $this->fileInfo->isReadable()) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "public function checkSize()\r\n\t{\r\n\t\treturn ((abs(@filesize($this->targetFile) - @filesize($this->referenceFile))) < $this->sizeTol);\r\n\t}", "public function writable()\n\t{\n\t\tif($this->exists()) // file exists check if writable\n\t\t{\n\t\t\treturn parent::writable();\n\t\t}\n\n\t\t// new file, check if directory writable\n\t\treturn $this->__getDir()->writable();\n\t}", "public function isReadableFile(): bool {\n return is_readable($this) && is_file($this);\n }", "public function MoveFile($fileTmpName)\r\n\t{\r\n\t\tif(move_uploaded_file($fileTmpName, UPLOADS_PATH.$this->fileId))\r\n\t\t{\r\n\t\t\t$secretKey = $this->generateCode();\r\n\t\t\t$queryUpdateFileMove = \"UPDATE files SET status=\\\"COMPLETED\\\", secret_key=\\\"\".$secretKey.\"\\\" WHERE file_id=\".$this->fileId;\r\n\t\t\t$this->sqlDataBase->nonSelectQuery($queryUpdateFileMove);\r\n\t\t\t$this->status=\"COMPLETED\";\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$queryDeleteFile = \"DELETE FROM files WHERE file_id=\".$this->fileId;\r\n\t\t\t$this->sqlDataBase->nonSelectQuery($queryDeleteFile);\r\n\t\t\t\t\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function check_file_data() {\n\n\t\t// If the constant isn't set, return false right away.\n\t\tif ( ! $this->has_debug_constant() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set my path file.\n\t\t$pfile = WP_CONTENT_DIR . '/debug.log';\n\n\t\t// If no file exists at all, create an empty one.\n\t\tif ( false === file_exists( $pfile ) ) {\n\t\t\tfile_put_contents( $pfile, '' );\n\t\t}\n\n\t\t// If the file is empty, return that.\n\t\treturn 0 === filesize( $pfile ) ? false : true;\n\t}", "public function canMoveUp () {\n\t\treturn $this->canMoveUp;\n\t}", "public function isUploaded() {\n return ($this->getErrorCode() == UPLOAD_ERR_OK);\n }", "public function finished()\n {\n return ! is_null($this->finishedAt);\n }", "protected function _move($source, $targetDir, $name) {\r\n\t\treturn false;\r\n\t}", "public static function sync() {\n\t\t\ttry {\n\t\t\t\tself::download(__DIR__ . self::LOCAL, FTP_PATH . self::REMOTE);\n\t\t\t} catch (Exception $e) {\n\t\t\t\tMage::log($e->getMessage());\n\t\t\t\tmail(ADMIN_EMAIL, 'CLASSIC FTP ERROR [SHIPMENTS DOWNLOAD]', \"ERROR: \\n\" . json_encode($e->getMessage()));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// parse file\n\t\t\t$parser = new Parser(self::LOCAL);\n\t\t\t$data = $parser->read();\n\n\t\t\t// run through file data and update\n\t\t\tself::iterate($data);\n\n\t\t\t// remove local file\n\t\t\tunlink(__DIR__ . self::LOCAL);\n\n\t\t\tfwrite(STDOUT, \" ++ SHIPMENTS SYNC COMPLETE \\n\");\n\n\t\t\treturn true;\n\n\t\t}", "public function hasJustUploaded() {\n return $this->_has(8);\n }", "public function isValid(): bool\n {\n return ($this->error === UPLOAD_ERR_OK) && is_uploaded_file($this->getPathname());\n }", "function writable() {\n\t\treturn is_file($this->path) && is_writable($this->path);\n\t}", "public function is_complete() {\n return $this->remaining_length() == 0;\n }", "public function hasUpgradesDir()\n {\n return is_readable($this->getUpgradesPath());\n }", "public function isOpen()\n {\n return (null !== $this->fileDescriptor && is_resource($this->fileDescriptor));\n }", "public function validateFile()\n {\n $totalChunks = $this->getTotalChunks();\n $totalChunksSize = 0;\n\n for ($i = $totalChunks; $i >= 1; $i--) {\n $file = $this->getChunkPath($i);\n if (!file_exists($file)) {\n return false;\n }\n $totalChunksSize += filesize($file);\n }\n\n return $this->getTotalSize() == $totalChunksSize;\n }", "public function exists()\n\t{\n\t\tif(empty($this->_parent->{$this->_name.'_file_name'}))\n\t\t\treturn false;\n\n\t\treturn $this->_file_info(true)->isReadable();\n\t}", "protected function hasCompleted()\r\n {\r\n return !(bool)$this->getExpectedStep();\r\n }", "function copy($newpath) {\n\n\t\t$f2 = new File($newpath, true);\n\t\treturn $f2->exists() && $f2->write($this->read()) && $f2->close();\n\t}", "public function hasWritePending();", "public function isArchived() {\n return $this->status->value == ScheduledUpdateInterface::STATUS_SUCCESSFUL\n || $this->status->value === ScheduledUpdateInterface::STATUS_UNSUCESSFUL;\n }", "public function valid() {\n return isset ( $this->_iterableFiles [$this->_position] );\n }", "public function isSetup()\n\t{\n\t\treturn $this->fileExists($this->rocketeer->getFolder('current'));\n\t}", "public function isFinished();", "public function hasReceivedMoved()\n {\n return (\n $this->_movedSignal instanceof Streamwide_Engine_Signal\n && $this->_movedSignal->getName() === Streamwide_Engine_Signal::MOVED\n );\n }", "public function hasCommittedSize(){\n return $this->_has(1);\n }", "public function hasCommittedSize(){\n return $this->_has(1);\n }", "public function validUpload() {\t\n\t\tif($this->file['error'] == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function finished() {\n\t\treturn $this->tries && ( ( $this->ready() && ! $this->hasSteps() ) || ! $this->needed() );\n\t}", "public function isReady()\n {\n if( $this->_status === FALSE )\n {\n return FALSE;\n }\n else\n {\n return TRUE;\n }\n }", "public function verify_file_access() {\n\t\tif (function_exists('clearstatcache')) {\n\t\t\tclearstatcache();\n\t\t}\n\n\t\t// First check wp-config.php.\n\t\tif (!is_writable(ABSPATH . 'wp-config.php') && !is_writable(ABSPATH . '../wp-config.php')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Now check wp-content. We need to be able to create files of the same user as this file.\n\t\tif (!$this->_is_dir_writable(untrailingslashit(WP_CONTENT_DIR))) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// If the cache and config directories exist, make sure they're writeable\n\t\tif (file_exists(untrailingslashit(WP_CONTENT_DIR) . '/wpo-cache')) {\n\t\t\t\n\t\t\tif (file_exists(WPO_CACHE_DIR)) {\n\t\t\t\tif (!$this->_is_dir_writable(WPO_CACHE_DIR)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (file_exists(WPO_CACHE_CONFIG_DIR)) {\n\t\t\t\tif (!$this->_is_dir_writable(WPO_CACHE_CONFIG_DIR)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function isSeekable() {\n\t\treturn (bool)$this->getMeta('seekable');\n\t}", "public function notFakeFile() {\n\t $check = filesize($this->value[\"tmp_name\"]);\n\t if($check !== false) {\n\t return true;\n\t } else {\n\t \treturn false;\n\t }\n\t}", "public function isSeekable()\n {\n return $this->getMetadata('seekable');\n }", "public function isConverted()\n {\n if ($this->getModel()->converted_file && $this->checkConvertedFile()) {\n return true;\n }\n return false;\n }", "protected function preflightWriteUnzip()\n {\n if (!is_writable($this->context[\"extract_dir\"])) {\n return $this->error(\"{$this->context[\"extract_dir\"]} is not writable\", true);\n }\n return true;\n }", "public function move($path) {\n\n if (!$this->exists())\n throw new Exception\\FileException(\"File not found\", 1);\n\n if (!rename($this->path, $path))\n throw new Exception\\FileException(\"Unknown error\", 0);\n\n return true;\n }", "public function hasFile()\n {\n return (count($this->getUploadedFiles()) > 0);\n }", "public function exists()\n {\n if (file_exists($this->getDestination()))\n {\n try\n {\n // Do a redirect to the file on filesystem - don't load contents in - that costs memory\n $url = str_replace(sfImagePoolPluginConfiguration::getBaseDir(), sfImagePoolPluginConfiguration::getBaseUrl(), $this->getDestination());\n \n sfContext::getInstance()->getController()->redirect($url, 0, 301);\n \n return $url;\n }\n catch (Exception $e)\n {\n return false;\n }\n }\n else\n {\n return false;\n }\n }", "function movefirst() {\n\t\tif(mysql_data_seek($this->rstemp,0)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function valid(): bool\n {\n return file_exists($this->file);\n }", "public function isValid() : bool\n {\n return $this->status === UPLOAD_ERR_OK;\n }", "public function isOngoing() {\n return ($this->hasStarted() && !$this->isFinished());\n }" ]
[ "0.6652188", "0.645909", "0.629462", "0.6162757", "0.61210495", "0.609253", "0.604874", "0.6019008", "0.60096973", "0.5861673", "0.58372337", "0.5811249", "0.58068085", "0.5803838", "0.5789078", "0.57687795", "0.575028", "0.5744553", "0.57295096", "0.57157075", "0.5711332", "0.5703257", "0.5684026", "0.5678133", "0.5658584", "0.5657563", "0.56540936", "0.56475776", "0.5639193", "0.5637736", "0.5618193", "0.5612217", "0.55988085", "0.55970454", "0.55856085", "0.5577061", "0.5563266", "0.5558583", "0.554775", "0.55465055", "0.55408585", "0.55327034", "0.5503918", "0.5494855", "0.5481576", "0.54678166", "0.5462436", "0.54554075", "0.54437864", "0.5443731", "0.5437639", "0.54230064", "0.5421083", "0.5416949", "0.5409813", "0.5402287", "0.5398085", "0.53886163", "0.5384738", "0.53798485", "0.53785986", "0.53593606", "0.5355687", "0.5354694", "0.5338944", "0.53241557", "0.53241044", "0.53217053", "0.53200907", "0.5308398", "0.53076607", "0.53024685", "0.5299848", "0.529625", "0.5289241", "0.5288208", "0.5287891", "0.528609", "0.52827686", "0.5281634", "0.52714044", "0.525977", "0.5259438", "0.5259438", "0.5258722", "0.52582", "0.5249932", "0.524337", "0.5237256", "0.5234452", "0.5229513", "0.5229416", "0.52284765", "0.5226517", "0.52225983", "0.5221687", "0.5211192", "0.52031845", "0.52023333", "0.5198123" ]
0.53437054
64
Returns true if there is some error in transfer. Missing file is not an error.
public function HasError() { return !in_array($this->Error, array(UPLOAD_ERR_OK, UPLOAD_ERR_NO_FILE)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validUpload() {\t\n\t\tif($this->file['error'] == 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function hasError()\n {\n if ( curl_errno($this->handler) ) {\n return true;\n }\n return false;\n }", "private function wasFileSent() : bool\n {\n return isset($_FILES[$this->fieldName]['name']) && !empty($_FILES[$this->fieldName]['name']);\n }", "function check_file_error($file_error) {\nif ($file_error === 0) {\nreturn true;\n}else {\necho \"There is an error uploading the file\";\n}\n}", "public function isOk(): bool\n {\n return $this->getError() === UPLOAD_ERR_OK;\n }", "public function hasError()\n {\n return $this->info['http_code'] != '200';\n }", "public static function isFileError($error = 0)\n {\n\n if ($error !== 0)\n return false;\n return true;\n\n }", "public function isUploaded() {\n return ($this->getErrorCode() == UPLOAD_ERR_OK);\n }", "public function hasError() {\n return ($this->getStatus() != 1);\n }", "public function isValid() : bool\n {\n return $this->status === UPLOAD_ERR_OK;\n }", "public function isValid(): bool\n {\n return ($this->error === UPLOAD_ERR_OK) && is_uploaded_file($this->getPathname());\n }", "public function is_exist_file() {\r\n\t\treturn file_exists( $this->get_path( 'file' ) );\r\n\t}", "public function notFakeFile() {\n\t $check = filesize($this->value[\"tmp_name\"]);\n\t if($check !== false) {\n\t return true;\n\t } else {\n\t \treturn false;\n\t }\n\t}", "public function IsValid() {\n\n return $this->Error === UPLOAD_ERR_OK;\n }", "public function file($file): bool\n\t{\n if (is_array($file['error'])) {\n $error = (int)$file['error'][0];\n } else {\n $error = (int)$file['error'];\n }\n\n return $error !== 4;\n }", "public function hasError();", "public function hasError();", "public function hasError();", "public function hasError();", "public function isFile()\n {\n $this->is_file = false;\n\n try {\n\n if (@ftp_get($this->getConnection(), $this->temp, $this->path, Ftp_ASCII, 0)) {\n $this->is_file = true;\n }\n\n } catch (\\Exception $e) {\n }\n\n return;\n }", "public function isError(): bool\n {\n return !$this->isOk();\n }", "private function is_file_ok($file) {\n\t\tif (!file_exists($file)) {\n\t\t\tthrow new \\Exception('Video worker: File not exist! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_file($file)) {\n\t\t\tthrow new \\Exception('Video worker: This is not a file! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\tif (!is_readable($file)) {\n\t\t\tthrow new \\Exception('Video worker: This file is not readable! ('.$file.')', 0);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function check() {\n\t\treturn file_exists($this->getFilePath());\n\t}", "private static function check_file($file) {\n if(file_exists(\"../\" . $file)) {\n throw new Exception(\"Error Processing Request: the given file does not exists\");\n }\n if(is_readable(\"../\" . $file)) {\n throw new Exception(\"Error Processing Request: the given file is not readable\");\n }\n return true;\n }", "protected function _checkConfirmUploadFile()\n\t{\n\t\tswitch ($this->_uploadedFile->getError()) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new Exception('Empty File Upload ERROR!');\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_FORM_SIZE;\n\t\t\tcase UPLOAD_ERR_INI_SIZE;\n\t\t\t\tthrow new Exception('Too Large File Size ERROR!');\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthrow new Exception('Something ERROR!');\n\t\t\t\tbreak;\n\t\t}\n\t}", "public function hasError(): bool;", "public function hasError(): bool;", "public function checkError($file)\n {\n if(isset($file['error']) AND $file['error'] !== UPLOAD_ERR_OK) {\n $this->alert->set('error', 'normal', 'main', \"Une erreur est survenue.\");\n }\n return (isset($file['error']) AND $file['error'] !== UPLOAD_ERR_OK)? false : true;\n }", "function getFileExists() {\n\t\treturn file_exists($this->getFilename());\n\t}", "public function testUploadErrors() {\n\t\t$this->data['tmp_name'] = null;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\n\t\t$this->data['tmp_name'] = $this->tempFile;\n\t\t$this->data['error'] = 3;\n\n\t\ttry {\n\t\t\t$transit = new Transit($this->data);\n\t\t\t$transit->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\t}", "public function hasError()\n {\n return $this->errors === 0;\n }", "public function hasFile()\n {\n return (count($this->getUploadedFiles()) > 0);\n }", "public function localFileExists()\n {\n return file_exists($this->GetRealPath());\n }", "public function hasError(): bool\n {\n return ($this->getError() !== 0);\n }", "public function checkConvertionComplete()\r\n\t{\r\n\t\treturn (!file_exists($this->referenceFile) || @filesize($this->referenceFile) == 0);\r\n\t}", "public function isError()\n {\n return $this->getStatus() !== $this->config()->get('status_ok');\n }", "public function isError()\n {\n return ($this->error_count > 0);\n }", "public function hasError() {\n\t\treturn $this->lastError !== null;\n\t}", "public static function fileDoesNotExist()\n {\n return self::logicalNot(self::fileExists());\n }", "public function isError(): bool\n {\n return $this->error === true;\n }", "public function hasFile()\n {\n \treturn empty($_FILES) ? false : true;\n }", "private function does_file_exist( string $url ): bool {\n\t\t$ch = curl_init( $url );\n\t\tcurl_setopt( $ch, CURLOPT_NOBODY, true );\n\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT_MS, 50 );\n\t\tcurl_exec( $ch );\n\t\t$http_code = curl_getinfo( $ch, CURLINFO_HTTP_CODE );\n\t\tcurl_close( $ch );\n\t\treturn $http_code === 200;\n\t}", "public function validateFile()\n {\n $totalChunks = $this->getTotalChunks();\n $totalChunksSize = 0;\n\n for ($i = $totalChunks; $i >= 1; $i--) {\n $file = $this->getChunkPath($i);\n if (!file_exists($file)) {\n return false;\n }\n $totalChunksSize += filesize($file);\n }\n\n return $this->getTotalSize() == $totalChunksSize;\n }", "function IsFileExist()\n{\t\n\t$sFileUrl = '';\n\t\n\tif(isset($_REQUEST['file-path']) === false)\n\t{\n\t\techo '<fail>no file path</fail>';\n\t\treturn;\n\t}\n\t\n\t$sFileUrl = $_REQUEST['file-path']; \n\t\n\tif(file_exists($sFileUrl) === true)\n\t{\n\t\techo '<correct>file exist</correct>';\n\t} else\n\t{\n\t\techo '<correct>file not exist</correct>';\n\t}\n\t\n\treturn;\n}", "public function checkUpload() {}", "private function fileExists()\n {\n return $this->files->exists($this->path) ? new Exception(\"The class exists!\") : false;\n }", "public function request_succeeded()\n {\n return curl_errno($this->ch) === 0;\n }", "private function __isFile()\n\t{\n\t\tif(!$this->exists())\n\t\t{\n\t\t\t$this->error = 'File \\'' . $this->_path . '\\' does not exist';\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function getFileExists()\n {\n return Yii::$app->storage->fileSystemExists($this->filter_id . '_' . $this->file->name_new_compound);\n }", "public function hasError()\n {\n return $this->_detectFailureBoundaryInOutput(true);\n }", "public function hasError ()\n {\n return (bool)$this->stderr;\n }", "public function hasFailure()\r\n {\r\n return count($this->strError) > 0;\r\n }", "function userfile_check()\n\t\t{\n\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->form_validation->set_message('userfile_check', 'The {field} file is required');\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}", "public function getStatus() {\n if (!isset($_FILES[$this->_file])) {\n return false;\n }\n \n return $_FILES[$this->_file]['error'];\n }", "public function hasError()\n\t{\n\t\treturn $this->error || $this->error_code;\n\t}", "public function check_file_data() {\n\n\t\t// If the constant isn't set, return false right away.\n\t\tif ( ! $this->has_debug_constant() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Set my path file.\n\t\t$pfile = WP_CONTENT_DIR . '/debug.log';\n\n\t\t// If no file exists at all, create an empty one.\n\t\tif ( false === file_exists( $pfile ) ) {\n\t\t\tfile_put_contents( $pfile, '' );\n\t\t}\n\n\t\t// If the file is empty, return that.\n\t\treturn 0 === filesize( $pfile ) ? false : true;\n\t}", "public function IsError() {\n\t return ($this->error_count > 0);\n\t}", "public function isUploaded() {\n\t\t$this->msg = '';\n\t\t\t//\tcheck if the name of the file uploaded is not available\n\t\tif (!$_FILES[$this->fileName]['name'])\t{\n\t\t\t$this->msg .= 'File name not available';\n\t\t\treturn false;\n\t\t}\n\n\t\t\n\t\t\t// tests for an error in uploading\n\t\tif ($_FILES[$this->fileName]['error']) {\t\n\t\t\tswitch($_FILES[$this->fileName]['error']) {\n\t\t\t\tcase 1: $this->msg .= 'Your image is too big!'; // exceeds PHP\\'s maximun upload size\n\t\t\t\t\treturn false;\n\t\t\t\tcase 2: $this->msg .= 'Your image is too large!'; // File exceeds maximum upload file size set in the form\n\t\t\t\t\treturn false;\n\t\t\t\tcase 3: $this->msg .= 'That only partially worked!'; // File partially uploaded\n\t\t\t\t\treturn false;\n\t\t\t\tcase 4: $this->msg .= 'Your file wasn\\'t uploaded!'; // No file upload\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t// check if file type is invalid\n\t\t$type = $_FILES[$this->fileName]['type'];\t//\tget the type of the uploaded file\n\t\tif (!in_array($type, $this->fileTypes)) {\n\t\t\t$this->msg .= 'Wrong file type';\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t\t// check if file did not reach the server\n\t\tif (!is_uploaded_file($_FILES[$this->fileName]['tmp_name'])) {\n\t\t\t$this->msg .= 'File did not reach the temporary location on the server';\n\t\t\treturn false;\n\t\t}\n\t\t$fleName = $_FILES[$this->fileName]['name'];\n\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$fleName : $fleName;\n\t\t\n\t\t\t// test if a file with the same name exists and rename it using a random generated (uniqid) if it does\n\t\tif (file_exists($flePath)) {\n\t\t\t$newName = uniqid('art').$fleName;\n\t\t\t$flePath = $this->folderPath ? $this->folderPath.'/'.$newName : $newName;\n\t\t}\n\n\t\t\t//move file from temporary location to the path specified and test if it's not successful\n\t\tif (!move_uploaded_file($_FILES[$this->fileName]['tmp_name'], $flePath)) {\t\n\t\t\t$this->msg .= 'Error in moving file to the specified location';\n\t\t\treturn false;\n\t\t}\n\t\t\t// check if new file does not exists in the destination folder\n\t\tif (!file_exists($flePath)) {\n\t\t\t$this->msg .= 'File did not reach the destination folder';\n\t\t\treturn false;\n\t\t}\n\t\t\t\t// all worked fine and returns the filepath\n\t\t\t$this->msg .= 'File '.$_FILES[$this->fileName]['name'].' uploaded successfully ';\n\t\t\treturn $flePath;\n\t\t}", "public function valid(): bool\n {\n return file_exists($this->file);\n }", "public function is_error()\n {\n }", "public function has_gateway_error() {\n\n\t\treturn 1 === $this->transaction_error;\n\t}", "private function CheckFile($file){\n\t\tif (!is_file($file)) {\n\t\t\techo '<p>Debug: ', $_FILES['fileToUpload']['tmp_name'], ' file not found', \"<p/><br>\";\n\t\t\t$message = '<p>There was an error while trying to upload your file';\n\t\t\t\n\t\t\tswitch( $_FILES['fileToUpload']['error'] ) {\n\t\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\t\treturn true;\n\t\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\t\t$message .= ' - file too large (limit of '.ini_get('upload_max_filesize').' bytes). </p>';\n\t\t\t\t\treturn false;\n\t\t\t\tcase UPLOAD_ERR_PARTIAL:\n\t\t\t\t\t$message .= ' - file upload was not completed. </p>';\n\t\t\t\t\treturn false;\n\t\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\t\t$message .= ' - zero-length file uploaded. </p>';\n\t\t\t\t\treturn false;\n\t\t\t\tdefault:\n\t\t\t\t\t$message .= ' - internal error #'.$_FILES['fileToUpload']['error'].'. Please try again later</p>';\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t\tprint $message;\n\t\t}\n\t\treturn true;\n\t}", "function check_file_uploaded($filename) {\n\t\t// If this request falls under any of them, treat it invalid.\n\t\tif (\n\t\t\t!isset($_FILES[$filename]['error']) ||\n\t\t\tis_array($_FILES[$filename]['error'])\n\t\t) {\n\t\t\tthrow new RuntimeException('Invalid parameters.');\n\t\t}\n\n\t\t// Check $_FILES[$filename]['error'] value.\n\t\tswitch ($_FILES[$filename]['error']) {\n\t\t\tcase UPLOAD_ERR_OK:\n\t\t\t\tbreak;\n\t\t\tcase UPLOAD_ERR_NO_FILE:\n\t\t\t\tthrow new RuntimeException('No file sent.');\n\t\t\tcase UPLOAD_ERR_INI_SIZE:\n\t\t\tcase UPLOAD_ERR_FORM_SIZE:\n\t\t\t\tthrow new RuntimeException('Exceeded filesize limit.');\n\t\t\tdefault:\n\t\t\t\tthrow new RuntimeException('Unknown errors.');\n\t\t}\n\t}", "protected function checkHttpPost()\n {\n\n if (!is_uploaded_file($this->fileInfo['tmp_name'])) {\n\n $this->error = 'The file is not upload for HTTP POST method.';\n\n return false;\n\n }\n\n return true;\n\n }", "public function fileExists() {\r\n return file_exists($this->pathname);\r\n }", "public function waitingForFile(){\n return !empty($this->check_for_file);\n }", "public function isFileExistsRemotely();", "private function action_checkFilesExist()\n\t{\n\t\tglobal $incontext, $txt;\n\n\t\t$incontext['page_title'] = $txt['install_welcome'];\n\t\t$incontext['sub_template'] = 'welcome_message';\n\n\t\t$exist_files = array(\n\t\t\t'db_last_error.sample.txt' => 'db_last_error.txt',\n\t\t\t'Settings.sample.php' => 'Settings.php',\n\t\t\t'Settings_bak.sample.php' => 'Settings_bak.php'\n\t\t);\n\t\t$missing_files = array();\n\n\t\tforeach ($exist_files as $orig => $file)\n\t\t{\n\t\t\t// First thing (for convenience' sake) if they are not there yet,\n\t\t\t// try to rename Settings and Settings_bak and db_last_error\n\t\t\tif (!file_exists(TMP_BOARDDIR . '/' . $file))\n\t\t\t{\n\t\t\t\t// Silenced because the source file may or may not exist\n\t\t\t\t@rename(TMP_BOARDDIR . '/' . $orig, TMP_BOARDDIR . '/' . $file);\n\n\t\t\t\t// If it still doesn't exist, add it to the missing list\n\t\t\t\tif (!file_exists(TMP_BOARDDIR . '/' . $file))\n\t\t\t\t{\n\t\t\t\t\t$missing_files[$orig] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (empty($missing_files))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\t$rename_array = array();\n\t\tforeach ($missing_files as $orig => $file)\n\t\t{\n\t\t\t$rename_array[] = '<li>' . $orig . ' => ' . $file . '</li>';\n\t\t}\n\n\t\t$incontext['error'] = sprintf($txt['error_settings_do_not_exist'], implode(', ', $missing_files), implode('', $rename_array));\n\n\t\t$incontext['retry'] = 1;\n\n\t\treturn false;\n\t}", "public function hasError()\n {\n return isset($this->error);\n }", "public function isError() {}", "public function is_error() {\n\t\treturn $this->upgrader_skin->error;\n\t}", "private static function remoteFileExists($url) {\n\t\t$f = @fopen($url, 'r');\n\t\tif($f) {\n\t\t\tfclose($f);\n\t\t\treturn TRUE;\n\t\t}\n\t\treturn FALSE;\n\t}", "public function hasError()\n {\n return $this->has_error;\n }", "public function isError();", "function verifyUpload( $file ){\n $passed = false; //\tVariável de controle\n if( is_uploaded_file( $file[ \"tmp_name\" ] ) ){\n $ext = $this->getExt( $file[ \"name\" ] );\n if( ( count( $this->allowedExtensions ) == 0 ) || ( in_array( $ext, $this->allowedExtensions ) ) ){\n $passed = true;\n }\n }\n return $passed;\n }", "public function checkRemoteFile($url){\n\n\t $ch = curl_init();\n\n\t curl_setopt($ch, CURLOPT_URL,$url);\n\n\t // don't download content\n\t curl_setopt($ch, CURLOPT_NOBODY, 1);\n\t curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t if (curl_exec($ch) !== FALSE) {\n\t return true;\n\t \t}\n\t else {\n\t return false;\n\t \t}\n\n\t\t}", "public function checkRemoteFile($url){\n\n\t $ch = curl_init();\n\n\t curl_setopt($ch, CURLOPT_URL,$url);\n\n\t // don't download content\n\t curl_setopt($ch, CURLOPT_NOBODY, 1);\n\t curl_setopt($ch, CURLOPT_FAILONERROR, 1);\n\t curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t if (curl_exec($ch) !== FALSE) {\n\t return true;\n\t \t}\n\t else {\n\t return false;\n\t \t}\n\t\t}", "public function upload(){\n\n\t\tif(move_uploaded_file($this->tmp_name,$this->uploadFile)){\n\n\t\t\treturn true;\n\n\t\t}\n\n\t\t// throw exception according to error number\n\n\t\tswitch($this->error){\n\n\t\t\tcase 1:\n\n\t\t\tthrow new Exception('Target file exceeds maximum allowed size.');\n\n\t\t\tbreak;\n\n\t\t\tcase 2:\n\n\t\t\tthrow new Exception('Target file exceeds the MAX_FILE_SIZE value specified on the upload form.');\n\n\t\t\tbreak;\n\n\t\t\tcase 3:\n\n\t\t\tthrow new Exception('Target file was not uploaded completely.');\n\n\t\t\tbreak;\n\n\t\t\tcase 4:\n\n\t\t\tthrow new Exception('No target file was uploaded.');\n\n\t\t\tbreak;\n\n\t\t\tcase 6:\n\n\t\t\tthrow new Exception('Missing a temporary folder.');\n\n\t\t\tbreak;\n\n\t\t\tcase 7:\n\n\t\t\tthrow new Exception('Failed to write target file to disk.');\n\n\t\t\tbreak;\n\n\t\t\tcase 8:\n\n\t\t\tthrow new Exception('File upload stopped by extension.');\n\n\t\t\tbreak;\n\n\t\t}\n\n\t}", "public function hasError()\n\t{\n\t\treturn isset($this->error);\n\t}", "public function checkConnection() : bool\n {\n if (is_null($this->FTPHandle)) throw new \\Exception(\"No FTP connection\");\n return true;\n }", "public function hadError() :bool {\n\t\treturn (($this->errNum < -1) or $this->shouldThrow);\n\t}", "public static function upload(): bool\n {\n return true;\n }", "public function exists(){\n\t\t$fichName = $this->getPath();\n\t\treturn file_exists($fichName);\n\t}", "private function isFileValid(): bool\n {\n return FileHelper::isExpectedExtensions($this->getPath(), $this->getFileExtensions());\n }", "public function isError(): bool\n {\n return $this->get('json', 'error') === true;\n }", "function HasFailedTrans() {}", "public function isError(): bool\n {\n return $this->error;\n }", "public function hasError() {\r\n\t\treturn ($this->errorNumber ? true : false);\r\n\t}", "function is_error() {\n\t\treturn $this->error;\n\t}", "public function isError () {\n return $this->c2mysql->isError();\n }", "public function isFailed()\r\n {\r\n return $this->status < 0;\r\n }", "public static function hasError() {\n return !empty(self::$error);\n }", "public function hasUploadFile($key): bool {\n $file = $this->get($key);\n return is_uploaded_file($file['tmp_name']);\n }", "public function has_error()\n\t{\n\t\treturn count($this->arr_error) == 0 ? false : true;\n\t}", "function _bellcom_check_if_file_in_url_exists($file_url) {\n $file_headers = @get_headers($file_url);\n\n if ($file_headers[0] == 'HTTP/1.1 404 Not Found') {\n return FALSE;\n }\n else {\n return TRUE;\n }\n}", "public function caused_error() : bool {\n return !empty($this->error);\n }", "public function hasError() {\n return !empty($this->error);\n }", "public function file_is_uploaded($name)\n\t{\n\t\tif (!array_key_exists($name, $this->_uploaded_files)) return false;\n\t\treturn ($this->_uploaded_files[$name] == UPLOAD_ERR_OK);\n\t}", "public function hasError()\n {\n return !empty($this->error);\n }", "public function isAlreadyDownloaded(): bool\n {\n return file_exists($this->getFilePath());\n }" ]
[ "0.7150491", "0.67486334", "0.67280847", "0.66065997", "0.6597482", "0.6593579", "0.6536562", "0.64926267", "0.6476616", "0.64389634", "0.6431632", "0.6398148", "0.6387687", "0.63710886", "0.6360043", "0.63526165", "0.63526165", "0.63526165", "0.63526165", "0.6322414", "0.6294696", "0.625732", "0.62558395", "0.6249624", "0.62488186", "0.6226087", "0.6226087", "0.6221966", "0.6209058", "0.6174097", "0.61557686", "0.61261165", "0.611485", "0.6112776", "0.60978204", "0.60907835", "0.6090217", "0.6086207", "0.60823166", "0.6072572", "0.6055305", "0.6051214", "0.60503954", "0.6046", "0.6041119", "0.60307103", "0.60268927", "0.6026292", "0.60222006", "0.6014735", "0.60134065", "0.6012462", "0.6006476", "0.5999189", "0.59990263", "0.59917873", "0.59891963", "0.5987124", "0.59864545", "0.5982748", "0.597146", "0.5967298", "0.59604114", "0.59574914", "0.5938549", "0.59357405", "0.59265506", "0.59221685", "0.5912459", "0.59062505", "0.59057504", "0.5901825", "0.58971053", "0.5892347", "0.5890917", "0.58857495", "0.5883681", "0.5873121", "0.58671314", "0.5864923", "0.5864234", "0.5859457", "0.58591545", "0.5853168", "0.5849902", "0.58392453", "0.5835774", "0.58335763", "0.58264804", "0.58213747", "0.5809978", "0.5808258", "0.5807446", "0.5800601", "0.5786062", "0.5785535", "0.5776634", "0.577371", "0.57714254", "0.57708895" ]
0.67948246
1
Check is uploaded file image. By default it will use file extension for detection but with $CheckMimeType parameter it will check real mimetype too.
public function IsImage($CheckMimeType=false) { $ImageExtensions= array('jpg', 'jpe', 'jpeg', 'gif', 'png'); if (!in_array(strtolower($this->GetExtension()), $ImageExtensions)) { return false; } if ($CheckMimeType) { $MimeTypes= array('image/jpeg', 'image/gif', 'image/png'); if (!in_array($this->GetMimeType(), $MimeTypes)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function checkImageType()\n {\n if (empty($this->checkImageType)) {\n return true;\n }\n\n if (('image' == substr($this->mediaType, 0, strpos($this->mediaType, '/')))\n || (!empty($this->mediaRealType)\n && 'image' == substr($this->mediaRealType, 0, strpos($this->mediaRealType, '/')))\n ) {\n if (!@getimagesize($this->mediaTmpName)) {\n $this->setErrors(\\XoopsLocale::E_INVALID_IMAGE_FILE);\n return false;\n }\n }\n return true;\n }", "public function isImage(){\n if($this->imageFileType != \"jpg\" && $this->imageFileType != \"png\" && $this->imageFileType != \"jpeg\"\n && $this->imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }", "public function isImage(){\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".<br>\";\n $this->uploadOk = 1;\n } else {\n echo \"File is not an image.<br>\";\n $this->uploadOk = 0;\n }\n }\n return $this->uploadOk;\n }", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "function checkimage($img)\r\n{\r\n $imageMimeTypes = array(\r\n 'image/png',\r\n 'image/gif',\r\n 'image/jpeg');\r\n\r\n $img = mime_content_type($img);\r\n $imgcheck = false;\r\n if (in_array ($img, $imageMimeTypes))\r\n {\r\n $imgcheck = true;\r\n }\r\n return $imgcheck;\r\n}", "public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }", "private function checkMimeType()\n {\n $allowedTypes = $this->getSetting('allowed_upload_types', true);\n if (is_string($allowedTypes) && strlen($allowedTypes)) {\n $allowedTypes = str_replace(' ', '', $allowedTypes);\n $allowedTypes = explode(',', $allowedTypes);\n }\n if (is_array($allowedTypes)) {\n if (!in_array($this->file->getMimeType(), $allowedTypes)) {\n throw new FileException('File type is not allowed');\n }\n }\n }", "function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}", "public static function check($file){\n if(\\File::exists($file)){\n $mime = mime_content_type($file);\n if(substr($mime, 0, 5) == 'image') {\n // this is an image\n return true;\n }else{\n return false;\n }\n }else{\n return false;\n }\n }", "function testCompatible(){\n\t\tif($this->$imageAsset[\"type\"] == \"image/jpeg\" || $_FILES[\"image_upload_box\"][\"type\"] == \"image/pjpeg\"){\t\n\t\t\t$this->imgType = 'jpg';\n\t\t}\t\t\n\t\t// if uploaded image was GIF\n\t\tif($this->$imageAsset[\"type\"] == \"image/gif\"){\t\n\t\t\t$this->imgType = 'gif';\n\t\t}\t\n\t\t// if uploaded image was PNG\n\t\tif($this->$imageAsset[\"type\"] == \"image/x-png\"){\n\t\t\t$this->imgType = 'png';\n\t\t}\n\t\telse {\n\t\t\t$this->imgType = 'invalid';\n\t\t}\n\t\t\n\t}", "function check_image_type($ftype)\n{\n$ext = strtolower(end(explode('.',$ftype)));\n$img_array = array('jpeg','jpg','gif','png');\n\n//\tif($ftype == \"image/jpeg\" || $ftype == \"image/jpg\" || $ftype == \"image/gif\" || $ftype == \"image/png\" )\n\tif(in_array($ext,$img_array))\n\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n}", "public function testIgnoreCheckMimeType() {\n // the check can be disabled\n $up2 = new upload();\n $up2->setIgnoreMimeCheck(true);\n $this->assertTrue($up2->checkMimeType());\n }", "public function checkMimeType()\n {\n if (empty($this->mediaRealType) && empty($this->allowUnknownTypes)) {\n $this->setErrors(\\XoopsLocale::E_FILE_TYPE_REJECTED);\n return false;\n }\n\n if ((!empty($this->allowedMimeTypes)\n && !in_array($this->mediaRealType, $this->allowedMimeTypes))\n || (!empty($this->deniedMimeTypes)\n && in_array($this->mediaRealType, $this->deniedMimeTypes))\n ) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_MIME_TYPE_NOT_ALLOWED, $this->mediaType));\n return false;\n }\n return true;\n }", "public function fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\n }", "public function edit_fileupload_check()\n { \n \n // we retrieve the number of files that were uploaded\n $number_of_files = sizeof($_FILES['img']['tmp_name']);\n \n // considering that do_upload() accepts single files, we will have to do a small hack so that we can upload multiple files. For this we will have to keep the data of uploaded files in a variable, and redo the $_FILE.\n $files = $_FILES['img'];\n \n // first make sure that there is no error in uploading the files\n for($i=0; $i<$number_of_files; $i++)\n {\n if($_FILES['img']['error'][$i] != 0)\n {\n // save the error message and return false, the validation of uploaded files failed\n $this->form_validation->set_message('fileupload_check', 'Please add at least one Image');\n return FALSE;\n }\n return TRUE;\n }\n }", "function validateMimeType($file_name){\r\n // array of acceptable MIME types\r\n $mime_types = [\r\n 'image/png',\r\n 'image/jpeg'\r\n ];\r\n \r\n // determines MIME type\r\n $type = mime_content_type($file_name);\r\n \r\n // check if MIME type is in array of acceptable types\r\n return in_array($type, $mime_types, true);\r\n}", "function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "public function checkFormatAllowed() {\n\t\t$imageFileType = pathinfo(basename($this->value[\"name\"]),PATHINFO_EXTENSION);\n\t\tif((($this->extension == \"\") && ($imageFileType == \"jpg\" || $imageFileType == \"png\" || $imageFileType == \"jpeg\"\n\t\t|| $imageFileType == \"gif\")) || ($this->extension == \"pdf\" && $imageFileType == \"pdf\" )) {\n\t\t return true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function isImage()\n {\n return strtolower(substr($this->getMimeType(), 0, 5)) == 'image';\n }", "public function isImage()\n {\n return str_contains($this->mimetype, 'image/');\n }", "protected function _validateMimeType()\n\t{\n\t\t$this->_fileType = \\MimeType\\MimeType::getType($this->getFilePath());\n\n\t\tif (!in_array($this->_fileType, $this->_allowedMimeType)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function mimeTypeValid()\n\t{\n\t\tif (!in_array($this->files['type'], $this->mime_types)) {\n\t\t\tthrow new Exception(\"Invalid file Extension\",6);\n\t\t}\n\t}", "public function isImage()\n {\n $mime_type = $this->getMimeType() ?: $this->detectMimeType();\n\n return (strpos($mime_type, 'image') === 0);\n }", "public function test_supports_mime_type() {\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( null );\n\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/jpeg' ), 'Does not support image/jpeg' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/png' ), 'Does not support image/png' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/gif' ), 'Does not support image/gif' );\n\t}", "public function test_supports_mime_type() {\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( null );\n\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/jpeg' ), 'Does not support image/jpeg' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/png' ), 'Does not support image/png' );\n\t\t$this->assertTrue( $imagick_image_editor->supports_mime_type( 'image/gif' ), 'Does not support image/gif' );\n\t}", "public static function validateImageFile()\n {\n if (!isset($_FILES['logo_file'])) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_IMAGE_UPLOAD_FAILED'));\n return false;\n }\n if ($_FILES['logo_file']['size'] > 5000000) {\n // if input file too big (>5MB)\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_BIG'));\n return false;\n }\n // get the image width, height and mime type\n $image_proportions = getimagesize($_FILES['logo_file']['tmp_name']);\n // if input file too small\n if ($image_proportions[0] < Config::get('AVATAR_SIZE') || $image_proportions[1] < Config::get('AVATAR_SIZE')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_SMALL'));\n return false;\n }\n if (!($image_proportions['mime'] == 'image/jpeg')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_WRONG_TYPE'));\n return false;\n }\n return true;\n }", "public function isImage()\n\t{\n\t\treturn in_array($this->getMimetype(), $this->imagesMimeTypes);\n\t}", "public function file_check($str)\n {\n\n\n\n echo \"sadasd : \";\n print_r($str);\n print_r($_FILES);\n\n die();\n\n $allowed_mime_type_arr = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png', 'image/x-png', 'svg');\n $mime = get_mime_by_extension($_FILES['file']['name']);\n if (isset($_FILES['file']['name']) && $_FILES['file']['name'] != \"\") {\n if (in_array($mime, $allowed_mime_type_arr)) {\n return true;\n } else {\n $this->form_validation->set_message('file_check', 'por favor selecciona solamente gif/jpg/png file.');\n return false;\n }\n } else {\n $this->form_validation->set_message('file_check', 'Selecciona un archivo.');\n return false;\n }\n }", "function checkType($type){\n\n $allowed = array('jpg', 'jpeg', 'png');\n $fileExt = explode('/', $type);\n $fileExt = strtolower(end($fileExt));\n return in_array($fileExt, $allowed) ? true : false ;\n\n }", "function check_upload_mimes($mimes)\n {\n }", "function validateFileMime(&$model, $fieldData, $fieldName, $allowedMimes = array()) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n $availableMimes = assetMimes();\n \n foreach (!empty($allowedMimes) ? $allowedMimes : array() as $type) {\n if ($type == '*') return true;\n \n # check fileinfo first\n $fileinfo = assetMimeType($fieldData[$fieldName]['tmp_name']);\n if ((!$fileinfo) && (in_array($fileinfo, $availableMimes[$type]))) return true; \n \n # check browser provided mime-type second\n if (in_array($fieldData[$fieldName]['type'], $availableMimes[$type])) return true;\n }\n \n return false;\n }", "private function checkSourceMimeType()\n {\n $fileMimeType = $this->getMimeTypeOfSource();\n if (is_null($fileMimeType)) {\n throw new InvalidImageTypeException('Image type could not be detected');\n } elseif ($fileMimeType === false) {\n throw new InvalidImageTypeException('File seems not to be an image.');\n } elseif (!in_array($fileMimeType, self::$allowedMimeTypes)) {\n throw new InvalidImageTypeException('Unsupported mime type: ' . $fileMimeType);\n }\n }", "public function ajax_check_banner_image_size() {\n \n $path = $_FILES['banner_image']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION); \n \n $allowTypes = array('jpg','jpeg','gif','png');\n if(in_array(strtolower($ext),$allowTypes)){\n list($w, $h) = getimagesize($_FILES[\"banner_image\"][\"tmp_name\"]);\n if ($w == 1346 && $h == 660) echo 'Success'; else echo 'Error';\n } else {\n echo 'File_Ext_Err';\n }\n }", "protected function validatePhoto(){\n\n $extension = $this->type;\n\n if( !empty($extension)){\n if($extension != 'image/jpeg' && $extension != 'image/png' && $extension != 'image/jpg'){\n $this->errors_on_upload[] = \"Your file should be .jpeg, .jpg or .png\";\n }\n }\n\n if($this->size > Config::MAX_FILE_SIZE){\n $this->errors_on_upload[] = \"Your picture shouldn't be more than 10 Mb\";\n }\n\n if($this->error != 0 && $this->error != 4) { //0 means no error, so if otherwise, display a respective message, 4 no files to upload, we allow that\n $this->errors_on_upload[] = $this->upload_errors_array[$this->error];\n }\n\n }", "protected function checkTrueImg()\n {\n\n if($this->imgFlag){\n\n if(!getimagesize($this->fileInfo['tmp_name'])){\n\n $this->error = 'The file is not image.';\n\n return false;\n\n }\n\n }\n\n return true;\n\n }", "public function isAllowedMIMEType()\n {\n if (!empty($this->allowed_upload_mime_type)) {\n if (!is_array($this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(MIME_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['type'], $this->allowed_upload_mime_type)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_MIME_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "public function isTransformableImage() {\n // with support for only some file types, so it might be able to handle\n // PNG but not JPEG. Try to generate thumbnails for whatever we can. Setup\n // warns you if you don't have complete support.\n\n $matches = null;\n $ok = preg_match(\n '@^image/(gif|png|jpe?g)@',\n $this->getViewableMimeType(),\n $matches);\n if (!$ok) {\n return false;\n }\n\n switch ($matches[1]) {\n case 'jpg';\n case 'jpeg':\n return function_exists('imagejpeg');\n break;\n case 'png':\n return function_exists('imagepng');\n break;\n case 'gif':\n return function_exists('imagegif');\n break;\n default:\n throw new Exception(pht('Unknown type matched as image MIME type.'));\n }\n }", "private function checkImage(){\r\n \r\n $images = $this->image;\r\n @$imageName = $images['name'];\r\n @$imageTmp = $images['tmp_name'];\r\n @$imageSize = $images['size'];\r\n @$imageError = $images['error'];\r\n $imageExe = explode('.', $imageName);\r\n $imageExe = strtolower(end($imageExe));\r\n $newName = uniqid('post' , FALSE) . '.' . $imageExe;\r\n \r\n $allowed = [\"jpg\",\"jpeg\" ,\"bmp\" , \"gif\",\"png\"];\r\n// if(in_array($imageExe, $allowed) != 1) {\r\n// Messages::setMsg(\"خطأ\", \"يجب اختيار صورة حقيقية\", \"danger\") ;\r\n// echo Messages::getMsg();\r\n if(0) {\r\n \r\n }else if($imageSize > 1024 * 1024) {\r\n echo \"حجم الصورة جدا كبير\";\r\n }else if($imageError != 0) {\r\n echo \"يرجى ادخال صورة صحيحة\";\r\n }\r\n else{\r\n $dir = __DIR__ . \"/../libs/photos/\" ;\r\n if(!file_exists($dir)){\r\n mkdir($dir,TRUE);\r\n }\r\n $filedire = $dir.$newName;\r\n if(move_uploaded_file($imageTmp, $filedire)) {\r\n $this->uploadImage = $newName;\r\n }\r\n return TRUE;\r\n } // end else\r\n \r\n return false;\r\n }", "function file_is_image($filename) {\n return in_array(get_file_extension($filename), get_image_file_types());\n }", "public function imageCheck($extension)\n {\n $allowedTypes = $this->imageTypes;\n return in_array($extension, $allowedTypes);\n }", "function validateTypeOfFile($type){\n\t$arrFile = ['image/png', 'image/jpg', 'image/jpeg', 'image/gif'];\n\tif(in_array($type, $arrFile)){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "function checkimagetype($imagetype){\n\n\t\t$filetype = array(\n\t\t 'image/bmp', \n\t\t 'image/gif', \n\t\t 'image/icon', \n\t\t 'image/jpeg',\n\t\t 'image/jpg', \n\t\t 'image/png', \n\t\t 'image/tiff', \n\t\t );\n if( in_array($imagetype,$filetype))\n\t\t\treturn true;\n\t\telse \n\t\t\treturn 0;\n\n}", "public function isSupportedImage()\n\t{\n\t\t$mime = $this->getMimeType();\n\t\tif (in_array($mime, array('image/jpeg', 'image/gif', 'image/png')))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function isUploadedFile() {}", "function fileChecker($nome_file){\n \n // controllo che sia stato inviato un file altrimenti restituisco false\n if(empty($_FILES['file'])){\n return false;\n }\n \n // memorizzo l'estensione\n $ext = trim(strtolower(end($nome_file)));\n \n // verifico che sia stato inviato un file contente un foto i formati disponibili sono jpg png jpeg\n if(!preg_match(VALID_FILE_FORMAT, $ext)){\n return false;\n }\n \n return true;\n}", "public function is_image($mime)\n\t{\n\t\tee()->load->library('mime_type');\n\t\treturn ee()->mime_type->isImage($mime);\n\t}", "protected function checkFileUploadEnabled() {}", "private function checkUploadFileMIME($file)\n {\n $flag = 0;\n $file_array = explode(\".\", $file [\"name\"]);\n $file_extension = strtolower(array_pop($file_array));\n\n // 2.through the binary content to detect the file\n switch ($file_extension) {\n case \"xls\" :\n // 2003 excel\n $fh = fopen($file [\"tmp_name\"], \"rb\");\n $bin = fread($fh, 8);\n fclose($fh);\n $strinfo = @unpack(\"C8chars\", $bin);\n $typecode = \"\";\n foreach ($strinfo as $num) {\n $typecode .= dechex($num);\n }\n if ($typecode == \"d0cf11e0a1b11ae1\") {\n $flag = 1;\n }\n break;\n case \"xlsx\" :\n // 2007 excel\n $fh = fopen($file [\"tmp_name\"], \"rb\");\n $bin = fread($fh, 4);\n fclose($fh);\n $strinfo = @unpack(\"C4chars\", $bin);\n $typecode = \"\";\n foreach ($strinfo as $num) {\n $typecode .= dechex($num);\n }\n echo $typecode . 'test';\n if ($typecode == \"504b34\") {\n $flag = 1;\n }\n break;\n }\n // 3.return the flag\n return $flag;\n }", "public function checkUpload() {}", "public function isFileImage ($image) \n {\n if (!in_array(mime_content_type($image), ALLOWED_IMAGE_TYPES) ) {\n return false;\n }\n return true;\n }", "function checkFileType($imageFileType)\n{\n\n if ($imageFileType == \"c\"||$imageFileType==\"C\"){\n echo \"C file detected!\";\n return 1;\n }\n if ($imageFileType ==\"py\"||$imageFileType==\"PY\"){\n echo \"Python file detected!\";\n return 2;\n\n }\n else{\n echo \"File is not allowed\";\n return 0;\n\n }\n}", "public function checkFileType($fileType){\n \t\tif ($fileType == \"application/octet-stream\"){\n \t\t\treturn true;\n \t\t}else{\n \t\t\treturn false;\n \t\t}\n \t}", "function is_image($file)\n{\n $type = get_image_type($file);\n $mime = get_image_mime_type($type);\n\n return substr($mime, 0, 5) == 'image';\n}", "public function isImage() {\n\t\treturn MimeType::isImage($this);\n\t}", "public function testIsImageFile()\n {\n $this->assertTrue(Tinebase_ImageHelper::isImageFile($this->_testImagePath));\n $this->assertFalse(Tinebase_ImageHelper::isImageFile(__FILE__));\n }", "function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}", "function __checkImgParams() {\n\t\t/* check file type */\n\t\t$this->__checkType($this->request->data['Upload']['file']['type']);\n\t\t\n\t\n\t\t\n\t\t/* check file size */\n\t\t$this->__checkSize($this->request->data['Upload']['file']['size']);\n\t\t\n\t\t\n\t\t\n\t\t/* check image dimensions */\n\t\t$this->__checkDimensions($this->request->data['Upload']['file']['tmp_name']);\n\t\t\n\t\t\t\n\t}", "public static function post_image_validation($type,$size){\n\t\t\t$check_type = Posts_image::get_image_type($type);\n\t\t\t$check_size = $size;\n\t\t\t$check_ext = Posts_image::get_image_ext($type);\n\t\t\t\n\t\t\tif($check_type !== \"image\"){\n\t\t\t\tself::$_errors['imagetype'] = \"Your file must be image.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($check_ext !== \".jpg\" && $check_ext !== \".png\" && $check_ext !== \".gif\"){\n\t\t\t\tself::$_errors['imageext'] = \"Only <b>JPG, PNG and GIF</b> format are allowed.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif($check_size > 4000000){\n\t\t\t\tself::$_errors['imagesize'] = \"Image can't be larger then 4MB.\";\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tif(empty(self::$_errors)){return true;}else{return false;}\n\t\t\t\n\t\t}", "public function hasImage(): bool\n {\n return $this->hasImageType(\n $this->getMimeType()\n );\n }", "function check_file_type($source)\n{\n $file_info = check_mime_type($source);\n\n switch ($file_info) {\n case 'application/pdf':\n return true;\n break;\n\n case 'application/msword':\n return true;\n break;\n\n case 'application/rtf':\n return true;\n break;\n case 'application/vnd.ms-excel':\n return true;\n break;\n\n case 'application/vnd.ms-powerpoint':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.text':\n return true;\n break;\n\n case 'application/vnd.oasis.opendocument.spreadsheet':\n return true;\n break;\n \n case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':\n return true;\n break;\n\n case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':\n return true;\n break;\n \n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "function check_image_type(&$type, &$error, &$error_msg)\n{\n\tglobal $lang;\n\n\tswitch( $type )\n\t{\n\t\tcase 'jpeg':\n\t\tcase 'pjpeg':\n\t\tcase 'jpg':\n\t\t\treturn '.jpg';\n\t\t\tbreak;\n\t\tcase 'gif':\n\t\t\treturn '.gif';\n\t\t\tbreak;\n\t\tcase 'png':\n\t\t\treturn '.png';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$error = true;\n\t\t\t$error_msg = (!empty($error_msg)) ? $error_msg . '<br />' . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];\n\t\t\tbreak;\n\t}\n\n\treturn false;\n}", "function isValidFile($fileArray)\n{\n\t# Creating image type array\n\t$imgTypeArr = array('jpg','gif','png','jpeg');\n\t\n\t# image size variable\n\t$fileSize\t= $fileArray['file']['size']; \n\t\n\t# image type variable\n\t$fileType\t= $fileArray['file']['name']; \n\t\n\t# Creating Image extension variable and converting to lowercase\n\t\t$imageExt\t= strtolower(substr($fileType, strrpos($fileType, '.') + 1));\n\t\n\t# Checking weather file type is image and size is less then OR equal to 2 MB\n\tif(in_array($imageExt,$imgTypeArr) && $fileSize <= '2090000'){\n\t\treturn TRUE;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "function fn_check_uploaded_data($uploaded_data, $filter_by_ext)\n{\n $result = true;\n $processed = false;\n\n /**\n * Actions before check uploaded data\n *\n * @param array $uploaded_data Uploaded data\n * @param array $filter_by_ext Allowed file extensions\n * @param bool $result Result status\n * @param bool $processed Processed flag\n */\n fn_set_hook('check_uploaded_data_pre', $uploaded_data, $filter_by_ext, $result, $processed);\n\n if ($processed) {\n return $result;\n }\n\n if (!empty($uploaded_data) && is_array($uploaded_data) && !empty($uploaded_data['name'])) {\n $ext = fn_get_file_ext($uploaded_data['name']);\n\n if (empty($ext)) {\n $types = fn_get_ext_mime_types('mime');\n $mime = fn_get_mime_content_type($uploaded_data['path']);\n\n $ext = isset($types[$mime]) ? $types[$mime] : '';\n }\n\n if (!$processed && !empty($filter_by_ext) && !in_array(fn_strtolower($ext), $filter_by_ext)) {\n fn_set_notification('E', __('error'), __('text_not_allowed_to_upload_file_extension', array(\n '[ext]' => $ext\n )));\n\n $result = false;\n $processed = true;\n }\n\n if (!$processed && in_array(fn_strtolower($ext), Registry::get('config.forbidden_file_extensions'))) {\n fn_set_notification('E', __('error'), __('text_forbidden_file_extension', array(\n '[ext]' => $ext\n )));\n\n $result = false;\n $processed = true;\n }\n\n $mime_type = fn_get_mime_content_type($uploaded_data['path'], true, 'text/plain');\n if (\n !$processed\n && !empty($uploaded_data['path'])\n && in_array($mime_type, Registry::get('config.forbidden_mime_types'))\n ) {\n fn_set_notification('E', __('error'), __('text_forbidden_file_mime', array(\n '[mime]' => $mime_type\n )));\n\n $result = false;\n $processed = true;\n }\n }\n\n /**\n * Actions after check uploaded data\n *\n * @param array $uploaded_data Uploaded data\n * @param array $filter_by_ext Allowed file extensions\n * @param bool $result Result status\n * @param bool $processed Processed flag\n */\n fn_set_hook('check_uploaded_data_post', $uploaded_data, $filter_by_ext, $result, $processed);\n\n return $result;\n}", "function is_image($path)\n{\n\t$controle_type_mime_autorises = ['image/gif', 'image/jpeg', 'image/pjpeg', 'image/png'];\n\t$fichier_mime_type = mime_content_type($path);\n\t//echo $fichier_mime_type;\n\n\tif(in_array($fichier_mime_type, $controle_type_mime_autorises)){\n\t return TRUE;\n\t}else{\n\t return FALSE;\n\t}\n}", "function isImageType($tempFileName)\n{\n\t$isImage = true;\n\t\n\t// Check if image file is actual image type\n $check = exif_imagetype($tempFileName);\n\t\n if ($check === false) \n\t{\n $isImage = false;\n\t}\n\t\n\treturn $isImage;\n}", "public function imageCheck($extension)\n {\n $allowedTypes = [\n 'image/gif',\n 'image/jpg',\n 'image/png',\n 'image/bmp',\n 'image/jpeg',\n 'image/x-icon'\n ];\n\n return in_array($extension, $allowedTypes);\n }", "public function isImage($ext=null){\n global $VALID_IMAGES;\n if (!$ext)\n $ext = $this->ext; \n return (in_Array( $ext, $VALID_IMAGES )); \n }", "function __checkType($type = null) {\n\t\t$valid = false;\n \tforeach($this->allowedTypes as $allowedType) {\n \t\tif(strtolower($type) == strtolower($allowedType)){\n \t\t$valid = true;\n \t\t}\n \t}\n\t\tif(!$valid) {\n\t\t\t$this->Session->setFlash('You tried to upload an invalid type! Please upload your pictures in jpeg, gif, or png format!');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t}", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n return 'abort';\n } \n if (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n return 'abort';\n }\n }", "public static function checkImage($image)\n {\n jimport('joomla.filesystem.file');\n jimport('joomla.filesystem.folder');\n $mimes = array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/png');\n //get mime type\n $mime = getimagesize($image);\n $mime = $mime ['mime'];\n\n $extensions = array('jpg','jpeg','png','gif');\n $extension = strtolower(pathinfo($image, PATHINFO_EXTENSION));\n\n if (in_array($extension, $extensions) and in_array($mime, $mimes))\n return TRUE;\n else\n JFile::delete($image);\n return 'application/octet-stream';\n }", "function security_check($file_path, $prefs)\n\t{\n\n\t\tee()->load->helper(array('file', 'xss'));\n\t\tee()->load->library('mime_type');\n\n\t\t$is_image = FALSE;\n\t\t$allowed = $prefs['allowed_types'];\n\t\t$mime = ee()->mime_type->ofFile($file_path);\n\n\t\tif ($allowed == 'all' OR $allowed == '*')\n\t\t{\n\t\t\tif (ee()->mime_type->isSafeForUpload($mime))\n\t\t\t{\n\t\t\t\treturn $mime;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\t\t}\n\n\t\tif ($allowed == 'img')\n\t\t{\n\t\t\tif ( ! ee()->mime_type->isImage($mime))\n\t\t\t{\n\t\t\t\treturn FALSE;\n\t\t\t}\n\n\t\t\t$is_image = TRUE;\n\t\t}\n\n\t\t// We need to be able to turn this off!\n\n\t\t//Apply XSS Filtering to uploaded files?\n\t\tif ($this->_xss_on AND\n\t\t\txss_check() AND\n\t\t\t! ee('Security/XSS')->clean($file_path, $is_image))\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\treturn $mime;\n\t}", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( KISSIT_MAIN_PRODUCT_WATERMARK_SIZE == 0 ) {\n \tif ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n \t\treturn 'abort';\n \t} \n \tif (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n \t\treturn 'abort';\n \t}\n }\n }", "public function testValidate() {\n\t\t$validator = new ImageValidator();\n\t\t$validator->addRule('ext', 'Invalid extension', array('png'));\n\n\t\t$this->object->setValidator($validator);\n\n\t\ttry {\n\t\t\t$this->object->upload();\n\n\t\t\t$this->assertTrue(false);\n\n\t\t} catch (Exception $e) {\n\t\t\t$this->assertTrue(true);\n\t\t}\n\t}", "function checkImg(){\n global $postpath;\n return getimagesize($postpath) !== false;\n }", "function testFileTypes()\n {\n $bulletproof = $this->bulletproof->uploadDir('/tmp');\n $image = array('name' => $this->testingImage,\n 'type' => 'image/jpeg',\n 'size' => 542,\n 'tmp_name' => $this->testingImage,\n 'error' => 0\n );\n\n /* should not accept gif*/\n $bulletproof->fileTypes(array('gif'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( gif ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n\n /* should not accept png*/\n $bulletproof->fileTypes(array('png'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( png ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* shouldn't accept this file */\n $bulletproof->fileTypes(array('exe'));\n $this->setExpectedException('ImageUploader\\ImageUploaderException',' This is not allowed file type!\n Please only upload ( exe ) file types');\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n\n /* example file is actually jpeg, not jpg */\n $bulletproof->fileTypes(array('png', 'jpeg'));\n $upload = $bulletproof->upload($image,'bulletproof_test_image');\n $this->assertEquals('uploads/bulletproof_test_image.jpeg',$upload);\n }", "private function checkSupportedFile($file_type) {\n return true;\n\n\n }", "function check_file_extension($ext, $allowed) {\nif (in_array($ext, $allowed)) {\nreturn true;\n}else {\necho \"Only .txt file allow to be uploaded\";\n}\n}", "function canUpload($file, &$err, &$params)\r\n\t{\r\n\t\tif (empty($file['name'])) {\r\n\t\t\t$err = 'Please input a file for upload';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tif (!is_uploaded_file($file['tmp_name'])) {\r\n\t //handle potential malicous attack\r\n\t $err = JText::_('File has not been uploaded');\r\n\t\t\treturn false;;\r\n\t\t}\r\n\r\n\t\tjimport('joomla.filesystem.file');\r\n\t\t$format = strtolower(JFile::getExt($file['name']));\r\n\r\n\t\t$allowable = explode(',', strtolower($params->get('ul_file_types')));\r\n\r\n\t\t$format = FabrikString::ltrimword($format, '.');\r\n\t\t$format2 = \".$format\";\r\n\t\tif (!in_array($format, $allowable) && !in_array($format2, $allowable))\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETYPE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$maxSize = (int)$params->get('upload_maxsize', 0);\r\n\t\tif ($maxSize > 0 && (int)$file['size'] > $maxSize)\r\n\t\t{\r\n\t\t\t$err = 'WARNFILETOOLARGE';\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t$ignored = array();\r\n\t\t$user = JFactory::getUser();\r\n\t\t$imginfo = null;\r\n\t\tif ($params->get('restrict_uploads',1)) {\r\n\t\t\t$images = explode(',', $params->get('image_extensions'));\r\n\t\t\tif (in_array($format, $images)) { // if its an image run it through getimagesize\r\n\t\t\t\tif (($imginfo = getimagesize($file['tmp_name'])) === FALSE) {\r\n\t\t\t\t\t$err = 'WARNINVALIDIMG';\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t} else if (!in_array($format, $ignored)) {\r\n\t\t\t\t// if its not an image...and we're not ignoring it\r\n\t\t\t\t/*$allowed_mime = explode(',', $upload_mime);\r\n\t\t\t\t$illegal_mime = explode(',', $upload_mime_illegal);\r\n\t\t\t\tif (function_exists('finfo_open') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// We have fileinfo\r\n\t\t\t\t\t$finfo = finfo_open(FILEINFO_MIME);\r\n\t\t\t\t\t$type = finfo_file($finfo, $file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfinfo_close($finfo);\r\n\t\t\t\t} else if (function_exists('mime_content_type') && $params->get('check_mime',1)) {\r\n\t\t\t\t\t// we have mime magic\r\n\t\t\t\t\t$type = mime_content_type($file['tmp_name']);\r\n\t\t\t\t\tif (strlen($type) && !in_array($type, $allowed_mime) && in_array($type, $illegal_mime)) {\r\n\t\t\t\t\t\t$err = 'WARNINVALIDMIME';\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}*/\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$xss_check = JFile::read($file['tmp_name'], false, 256);\r\n\t\t$html_tags = array('abbr','acronym','address','applet','area','audioscope','base','basefont','bdo','bgsound','big','blackface','blink','blockquote','body','bq','br','button','caption','center','cite','code','col','colgroup','comment','custom','dd','del','dfn','dir','div','dl','dt','em','embed','fieldset','fn','font','form','frame','frameset','h1','h2','h3','h4','h5','h6','head','hr','html','iframe','ilayer','img','input','ins','isindex','keygen','kbd','label','layer','legend','li','limittext','link','listing','map','marquee','menu','meta','multicol','nobr','noembed','noframes','noscript','nosmartquotes','object','ol','optgroup','option','param','plaintext','pre','rt','ruby','s','samp','script','select','server','shadow','sidebar','small','spacer','span','strike','strong','style','sub','sup','table','tbody','td','textarea','tfoot','th','thead','title','tr','tt','ul','var','wbr','xml','xmp','!DOCTYPE', '!--');\r\n\t\tforeach ($html_tags as $tag) {\r\n\t\t\t// A tag is '<tagname ', so we need to add < and a space or '<tagname>'\r\n\t\t\tif (JString::stristr($xss_check, '<'.$tag.' ') || JString::stristr($xss_check, '<'.$tag.'>')) {\r\n\t\t\t\t$err = 'WARNIEXSS';\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "function checkImage($imageField, $num) {\r\n\r\n\t\t\tif ($HTTP_POST_FILES['$imageField']['size'] > $maxsize) {\r\n\r\n\t\t\t\t$errmsg .= \"Image file $num must be less than $maxsizekb MB in size.<br>\";\r\n\r\n\t\t\t\t$errflag = true;\r\n\r\n\t\t\t\tunlink($HTTP_POST_FILES['$imageField']['tmp_name']);\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// image should be of the right type i.e. gif,pjpeg or jpeg\r\n\r\n\t\t\tif($HTTP_POST_FILES['$imageField']['type'] != \"image/gif\" AND\r\n\r\n\t\t\t$HTTP_POST_FILES['$imageField']['type'] != \"image/pjpeg\" AND\r\n\r\n\t\t\t$HTTP_POST_FILES['$imageField']['type'] != \"image/png\" AND\r\n\r\n\t\t\t$HTTP_POST_FILES['$imageField']['type'] !=\"image/jpeg\" ) {\r\n\r\n\t\t\t\t$errmsg .= \"Image $num may only be .gif. .png or .jpeg files.</font><br>\";\r\n\r\n\t\t\t\t$errflag = true;\r\n\r\n\t\t\t\tunlink($HTTP_POST_FILES['$imageField']['tmp_name']);\r\n\r\n\t\t\t}\r\n\r\n}", "function check_mime_type($source)\n{\n $mime_types = array(\n // images\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n // adobe\n 'pdf' => 'application/pdf',\n // ms office\n 'doc' => 'application/msword',\n 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n 'ppt' => 'application/vnd.ms-powerpoint',\n // open office\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n $arrext = explode('.', $source['name']);\n $jml = count($arrext) - 1;\n $ext = $arrext[$jml];\n $ext = strtolower($ext);\n //$ext = strtolower(array_pop(explode(\".\", $source['name'])));\n if (array_key_exists($ext, $mime_types)) {\n return $mime_types[$ext];\n } elseif (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimetype = finfo_file($finfo, $source['tmp_name']);\n finfo_close($finfo);\n return $mimetype;\n } else {\n return false;\n }\n}", "private function is_image( $extension = null, $mime_type = null )\n\t{\n\t\tif ( ! is_null($extension) ) {\n\t\t\t$image_extensions = array(\n\t\t\t\t'jpg',\n\t\t\t\t'jpeg',\n\t\t\t\t'gif',\n\t\t\t\t'png',\n\t\t\t\t'bmp',\n\t\t\t);\n\n\t\t\treturn in_array(strtolower($extension), $image_extensions) ? 'true' : 'false';\n\t\t} else if ( ! is_null($mime_type) ) {\n\t\t\t$mime_type_parts = explode('/', $body['ContentType']);\n\t\t\treturn ( strtolower(reset($mime_type_parts)) === 'image' ) ? 'true' : 'false';\n\t\t}\n\n\t\treturn false;\n\t}", "function validate_picture_file($path) {\n $acceptableTypes = array(IMAGETYPE_JPEG, IMAGETYPE_PNG, IMAGETYPE_GIF);\n $detectedType = exif_imagetype($path); // WARNING: This will only work if the\n // EXIF extension is enabled.\n return in_array($detectedType, $acceptableTypes);\n}", "protected function checkRequiremets () {\n\t\t// Check if `finfo_file()` function exists. File info extension is \n\t\t// presented from PHP 5.3+ by default, so this error probably never happened.\n\t\tif (!function_exists('finfo_file')) \n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_NO_FILEINFO\n\t\t\t);\n\t\t\n\t\t// Check if mimetypes and extensions validator class\n\t\t$extToolsMimesExtsClass = static::MVCCORE_EXT_TOOLS_MIMES_EXTS_CLASS;\n\t\tif (!class_exists($extToolsMimesExtsClass)) \n\t\t\treturn $this->handleUploadError(\n\t\t\t\tstatic::UPLOAD_ERR_NO_MIMES_EXT\n\t\t\t);\n\n\t\t// Complete uploaded files temporary directory:\n\t\t$this->GetUploadsTmpDir();\n\t\t\n\t\treturn TRUE;\n\t}", "public function checkMineType(array $file_data) {\n if (null != $this->_filterType) { //defined filter by Type\n $ext = explode(',', $this->_filterType);\n $mime = array();\n $mime = array();\n for ($i = 0; $i < sizeof($ext); ++$i) {\n $ext[$i] = strtolower(ltrim(trim($ext[$i]), '.'));\n $mime[$ext[$i]] = $this->_allowedMimeType[$ext[$i]];\n }\n } else {\n $mime = $this->_allowedMimeType;\n }\n $ext = $this->getExtension($file_data['name'], false);\n $expectMimeType = $this->getMimeTypeByExtension($ext, $mime);\n\n $fileMimeType = $this->_getUploadedFileMimeType($file_data);\n\n if (is_array($expectMimeType)) {\n if (!in_array($fileMimeType, $expectMimeType)) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (is_string($expectMimeType)) {\n if ($expectMimeType != $fileMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n } elseif (false == $expectMimeType) {\n $this->_error[] = 'Mime (' .$ext .'-' .$fileMimeType .') type does not allow';\n return false;\n }\n\n return true;\n }", "public function isAllowedExtension()\n {\n if (!empty($this->allowed_upload_file_ext)) {\n if (!is_array($this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(FILE_TYPE_LIST_ERROR);\n return false;\n }\n else {\n if (!in_array($this->_file_info['ext'], $this->allowed_upload_file_ext)) {\n NUCLEUS_Exceptions::catcher(UPLOAD_FILE_TYPE_DENIED);\n return false;\n }\n }\n }\n\n return true;\n }", "function checkMimeType($params = array(), $options = array()) {\n\t\tif ($this->isUploadedFile($params)) {\n\t\t\t// Only validate mime type if a file was uploaded at all\n\t\t\t$val = array_shift($params);\n\t\t\tforeach ($options['allowed_mime_types'] as $extensions) {\n\t\t\t\tif ((!is_array($extensions) && $extensions == '*') ||\n\t\t\t\t\t(is_array($extensions) && in_array($val['type'], $extensions))) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function is_file_an_image($filepath)\n{\n\t$a = getimagesize($filepath);\n\t$image_type = $a[2];\n\t \n\tif(in_array($image_type , array(IMAGETYPE_GIF , IMAGETYPE_JPEG ,IMAGETYPE_PNG , IMAGETYPE_BMP)))\n\t{\n\t return true;\n\t}\n\treturn false;\n}", "public function is_image()\n\t\t{\n\t\t\treturn !is_null($f = $this->format()) && $f;\n\t\t}", "function testFileTypes()\r\n {\r\n $nautilus = $this->nautilus->uploadDir('/tmp');\r\n $image = array('name' => $this->testingImage,\r\n 'type' => 'image/jpeg',\r\n 'size' => 542,\r\n 'tmp_name' => $this->testingImage,\r\n 'error' => 0\r\n );\r\n\r\n /* should not accept gif*/\r\n $nautilus->fileTypes(array('gif'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( gif ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n\r\n /* should not accept png*/\r\n $nautilus->fileTypes(array('png'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( png ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* shouldn't accept this file */\r\n $nautilus->fileTypes(array('exe'));\r\n $this->setExpectedException('Image\\ImageException',' This is not allowed file type!\r\n Please only upload ( exe ) file types');\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n\r\n /* example file is actually jpeg, not jpg */\r\n $nautilus->fileTypes(array('png', 'jpeg'));\r\n $upload = $nautilus->upload($image,'nautilus_test_image');\r\n $this->assertEquals('uploads/nautilus_test_image.jpeg',$upload);\r\n }", "public function file_check($str){\n \t$allowed_mime_type_arr = array('application/pdf');\n \tif(isset($_FILES['file']['name']) && $_FILES['file']['name']!=\"\"){\n \t\t$mime = get_mime_by_extension($_FILES['file']['name']);\n \t\tif(in_array($mime, $allowed_mime_type_arr)){\n \t\t\treturn true;\n \t\t}else{\n \t\t\t$this->form_validation->set_message('file_check', 'Extension File Hanya Boleh PDF');\n \t\t\treturn false;\n \t\t}\n \t}else{\n \t\t// $this->form_validation->set_message('file_check', 'Silahkan Pilih File PDF nya.');\n \t\t// return false;\n \t\treturn true;\n \t}\n }", "public function hasFileUpload()\n\t{\n\t\treturn stripos($this->server->get('CONTENT_TYPE'),'multipart/form-data')!==false;\n\t}", "function isImage( $filepath, $arr_types=array( \".gif\", \".jpeg\", \".png\", \".bmp\" ) )\n\t{\n\t\tif(file_exists($filepath)) {\n\t\t\t$info = getimagesize($filepath);\n\t\t\t$ext = image_type_to_extension($info['2']);\n\t\t\treturn in_array($ext,$arr_types);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function validateExtensionplan(){\n $allowed = array('jpeg', 'jpg', 'png');\n $filename = $this->getplanFloor('name');\n $ext = pathinfo($filename, PATHINFO_EXTENSION);\n if(!in_array($ext,$allowed)) {\n return false;\n } else {\n return true;\n }\n }", "function ignore_upload_ext( $checked, $file, $filename, $mimes ) {\n\t\tif(!$checked['type']){\n\t\t\t//rebuild the type info\n\t\t\t$wp_filetype = wp_check_filetype( $filename, $mimes );\n\t\t\t$ext = $wp_filetype['ext'];\n\t\t\t$type = $wp_filetype['type'];\n\t\t\t$proper_filename = $filename;\n\n\t\t\t//preserve failure for non-svg images\n\t\t\tif($type && 0 === strpos($type, 'image/') && $ext !== 'svg'){\n\t\t\t\t$ext = $type = false;\n\t\t\t}\n\n\t\t\t//everything else gets an OK, so e.g. we've disabled the error-prone finfo-related checks WP just went through. whether or not the upload will be allowed depends on the <code>upload_mimes</code>, etc.\n\n\t\t\t$checked = compact('ext','type','proper_filename');\n\t\t}\n\n\t\treturn $checked;\n\n\t}", "function checkFilePhoto(string $name)\n{\n if (!($_FILES[$name]['type'] == 'image/png') && !($_FILES[$name]['type'] == 'image/jpeg') && !($_FILES[$name]['type'] == 'image/gif')) {\n return 'Некорректный формат фото';\n }\n}", "public function validate() {\n \n if (in_array($this->ext, $this->allow) !==false){\n \n if ($this->size < 10000000 ) {\n if ($this->error === 0) {\n $enc = uniqid('',true).\".\".$this->ext;\n $dest = $_SERVER['DOCUMENT_ROOT'].'/'.'tempSTR/'.$enc;\n\n move_uploaded_file($this->filetmp, $dest);\n \n } else {\n echo \"something wrong with this image\";\n }\n } else {\n echo \"Your file is to big\";\n }\n\n } else {\n echo \"You can't upload image with this exstension\";\n }\n }", "public function checkImageTrue($file)\n {\n $fileInfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimeType = finfo_file($fileInfo, $file['tmp_name']);\n finfo_close($fileInfo);\n if(strpos($mimeType, 'image/') !== 0) {\n $this->alert->set('error', 'normal', 'main', \"Le fichier n'est pas une image.\");\n }\n return (strpos($mimeType, 'image/') !== 0)? false : true;\n }", "public function checkFile($filename){\n $ext = substr($filename, strrpos($filename, '.') + 1);\n if($ext==\"jpg\"||$ext==\"png\"||$ext==\"svg\"||$ext==\"jpeg\"){\n return true;\n }else{\n return false;\n }\n }", "function isUpload()\n {\n return ($this->type->getTypeName() == 'file');\n }", "public abstract function isMime();" ]
[ "0.77192074", "0.73598015", "0.721893", "0.7062584", "0.703361", "0.6990562", "0.6962246", "0.6919374", "0.6883376", "0.68633825", "0.681623", "0.68129003", "0.6800077", "0.67959714", "0.67446524", "0.6720619", "0.6717326", "0.66452265", "0.6624768", "0.66176295", "0.66157204", "0.6584513", "0.6562802", "0.6544032", "0.6543193", "0.65430105", "0.65405077", "0.652009", "0.65192103", "0.651348", "0.6497885", "0.6496703", "0.64834476", "0.6480256", "0.6474986", "0.64684004", "0.64543605", "0.6433262", "0.6428153", "0.6425033", "0.64216554", "0.6410497", "0.6387327", "0.6386107", "0.63850725", "0.6378513", "0.63676184", "0.63581073", "0.6348078", "0.634585", "0.63451225", "0.63387376", "0.6291564", "0.628728", "0.62769127", "0.6246479", "0.62299705", "0.622352", "0.62222517", "0.6219732", "0.6219483", "0.62111115", "0.6208356", "0.62060964", "0.6203833", "0.6197446", "0.61923766", "0.61839384", "0.61824495", "0.6177189", "0.61711353", "0.6154962", "0.61523366", "0.6147118", "0.6131802", "0.61287844", "0.6119263", "0.6113373", "0.61133724", "0.61071396", "0.6101633", "0.60850024", "0.6082762", "0.60684216", "0.6067606", "0.6052298", "0.6036703", "0.60235715", "0.60194767", "0.600584", "0.5989756", "0.5988353", "0.5978893", "0.59745324", "0.5967261", "0.5966749", "0.5951805", "0.59474236", "0.5945746", "0.5945128" ]
0.69422
7
Returns array with width and height of uploaded image or false on missing or nonimage file.
public function GetImageSize() { return $this->IsValid() ? @getimagesize($this->TmpName) // @ - prevent warning on reading non-images : false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_image_dimensions($file_path)\n\t{\n\n\t\tif( ! file_exists($file_path)) {\n\n\t\t\treturn FALSE;\n\n\t\t}\n\n\t\t// PHP7.4 does not come with GD JPEG processing by default\n\t\t// So, we need to run this check.\n\t\tif (function_exists('getimagesize'))\n\t\t{\n\t\t\t$imageSize = @getimagesize($file_path);\n\n\t\t\tif($imageSize && is_array($imageSize)) {\n\n\t\t\t\t$imageSizeParsed = [\n\t\t\t\t\t'height'\t=> $imageSize['1'],\n\t\t\t\t\t'width'\t=> $imageSize['0']\n\t\t\t\t];\n\n\t\t\t\treturn $imageSizeParsed;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// The file is either not an image, or there was an error.\n\t\treturn FALSE;\n\t}", "public function validDimensions() {\n\t\tlist($width, $height) = getimagesize($this->file['tmp_name']);\n\t\n\t\tif($height <= $this->max_height && $width <= $this->max_width) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\t\t\t\t\t\n\t}", "function checkImg(){\n global $postpath;\n return getimagesize($postpath) !== false;\n }", "public function is_valid_image() {\n\n if ( get_post_type( $this->slide->ID ) === 'attachment' ) {\n $image_id = $this->slide->ID;\n } else {\n $image_id = get_post_thumbnail_id( $this->slide->ID );\n }\n\n $meta = wp_get_attachment_metadata( $image_id );\n\n $is_valid = isset( $meta['width'], $meta['height'] );\n\n return apply_filters( 'metaslider_is_valid_image', $is_valid, $this->slide );\n }", "public function isValidImage() {\n return $this->_is_validimage;\n }", "public function dimensions() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$dims = null;\n\n\t\t\tif (!$file->isImage()) {\n\t\t\t\treturn $dims;\n\t\t\t}\n\n\t\t\t$data = @getimagesize($file->path());\n\n\t\t\tif ($data && is_array($data)) {\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => $data[0],\n\t\t\t\t\t'height' => $data[1]\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tif (!$data) {\n\t\t\t\t$image = @imagecreatefromstring(file_get_contents($file->path()));\n\t\t\t\t$dims = array(\n\t\t\t\t\t'width' => @imagesx($image),\n\t\t\t\t\t'height' => @imagesy($image)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn $dims;\n\t\t});\n\t}", "public function ajax_check_banner_image_size() {\n \n $path = $_FILES['banner_image']['name'];\n $ext = pathinfo($path, PATHINFO_EXTENSION); \n \n $allowTypes = array('jpg','jpeg','gif','png');\n if(in_array(strtolower($ext),$allowTypes)){\n list($w, $h) = getimagesize($_FILES[\"banner_image\"][\"tmp_name\"]);\n if ($w == 1346 && $h == 660) echo 'Success'; else echo 'Error';\n } else {\n echo 'File_Ext_Err';\n }\n }", "protected function checkTrueImg()\n {\n\n if($this->imgFlag){\n\n if(!getimagesize($this->fileInfo['tmp_name'])){\n\n $this->error = 'The file is not image.';\n\n return false;\n\n }\n\n }\n\n return true;\n\n }", "function image_info($image)\n{\n // http://stackoverflow.com/a/2756441/1459873\n $is_path = preg_match('#^(\\w+/){1,2}\\w+\\.\\w+$#', $image);\n if ($is_path && false !== ($info = getimagesize($image))) {\n return array(\n 'width' => $info[0],\n 'height' => $info[1],\n 'mime' => $info['mime'],\n 'type' => 'file',\n );\n }\n $im = new \\Imagick();\n if ($im->readImageBlob($image)) {\n return array(\n 'width' => $im->getImageWidth(),\n 'height' => $im->getImageHeight(),\n 'mime' => $im->getImageMimeType(),\n 'type' => 'blob',\n );\n }\n return array('width' => 0, 'height' => 0, 'mime'=>'', 'type' => '');\n\n}", "public function get_size_image($img){\n if ($this->get_path_pic($img)){\n return filesize($this->get_path_pic($img)); \n }else{\n return false;\n }\n \n }", "public function isImage(){\n if(isset($_POST[\"submit\"])) {\n $check = getimagesize($_FILES[\"fileToUpload\"][\"tmp_name\"]);\n if($check !== false) {\n echo \"File is an image - \" . $check[\"mime\"] . \".<br>\";\n $this->uploadOk = 1;\n } else {\n echo \"File is not an image.<br>\";\n $this->uploadOk = 0;\n }\n }\n return $this->uploadOk;\n }", "function Is_image($filename){\n \n $size = getimagesize($filename);\nif($size==FALSE){\n $er=FALSE; \n\n}else{\n $er=TRUE; \n}\nreturn $er;\n}", "public function _get_img_info()\n {\n if ( ! file_exists($this->source_file) || ! filesize($this->source_file)) {\n return false;\n }\n list($this->source_width, $this->source_height, $type, $this->source_atts) = getimagesize($this->source_file);\n return isset($this->_avail_types[$type]) ? ($this->source_type = $this->_avail_types[$type]) : false;\n }", "public static function validateImageFile()\n {\n if (!isset($_FILES['logo_file'])) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_IMAGE_UPLOAD_FAILED'));\n return false;\n }\n if ($_FILES['logo_file']['size'] > 5000000) {\n // if input file too big (>5MB)\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_BIG'));\n return false;\n }\n // get the image width, height and mime type\n $image_proportions = getimagesize($_FILES['logo_file']['tmp_name']);\n // if input file too small\n if ($image_proportions[0] < Config::get('AVATAR_SIZE') || $image_proportions[1] < Config::get('AVATAR_SIZE')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_TOO_SMALL'));\n return false;\n }\n if (!($image_proportions['mime'] == 'image/jpeg')) {\n Session::add('feedback_negative', Text::get('FEEDBACK_AVATAR_UPLOAD_WRONG_TYPE'));\n return false;\n }\n return true;\n }", "function validImageSize($tempFileName)\n{\n\t$validSize = true;\n\t\n // Check if image file is valid size\n $imageStats = getimagesize($tempFileName);\n\t\n\t//invalid if height or width < 256px or > 1024px\n if (($imageStats[0] < 256) || ($imageStats[1] < 256) || ($imageStats[0] > 1280) || ($imageStats[1] > 1280))\n\t{\n $validSize = false;\n\t}\n\t\n\treturn $validSize;\n}", "public function correctImage(){\n parent::isImage();\n parent::exist();\n parent::sizeFile();\n return $this->uploadOk;\n }", "public function isImage(){\n if($this->imageFileType != \"jpg\" && $this->imageFileType != \"png\" && $this->imageFileType != \"jpeg\"\n && $this->imageFileType != \"gif\" ) {\n echo \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.<br>\";\n $this->uploadOk = 0;\n }\n return $this->uploadOk;\n }", "public function check_image_sizes($image_file){\n\t\t\t$error['error_exists'] = false;\n\t\t\t$error['error_message'] = false;\n\t\t\t\n\t\t\t//if the image file is not there then show error\n\t\t\tif (!isset($image_file) || $image_file == null){\n\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t$error['error_message'] = $this->file_uploading_settings['file_not_exist'];\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$image_size = getimagesize($image_file);\n\n\t\t\t\t$width = $image_size[0];\n\t\t\t\t$height = $image_size[1];\n\t\t\t\t\n\t\t\t\t//must be greater than a certain dimension\n\t\t\t\tif ($width < $this->file_uploading_settings['min_height_width'] || $height < $this->file_uploading_settings['min_height_width']){\n\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['min_image_size_error'];\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//must be smaller than a certain dimension -> no need to do if config set to 0 -> 0 = unlimited\n\t\t\t\tif ($this->file_uploading_settings['max_width'] > 0){\n\t\t\t\t\tif ($width > $this->file_uploading_settings['max_width']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->file_uploading_settings['max_height'] > 0){\n\t\t\t\t\tif ($height > $this->file_uploading_settings['max_height']){\n\t\t\t\t\t\t$error['error_exists'] = true;\n\t\t\t\t\t\t$error['error_message'] = $this->file_uploading_settings['max_image_size_error'];\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\n\n\n\t\t\treturn $error;\n\n\n\t\t\t\n\t\t}", "private function isValidImage() {\r\n\t\t\treturn in_array($this->extension, $this->extAllowed) ? true : false;\r\n\t\t}", "function image_dimensions ( $image_path ) {\r\n\t\t$image = image_read($image_path,false);\r\n\t\tif ( !$image ) return $image;\r\n\t\t$width = imagesx($image);\r\n\t\t$height = imagesy($image);\r\n\t\t$dimensions = compact('width','height');\r\n\t\treturn $dimensions;\r\n\t}", "function elk_getimagesize($file, $error = 'array')\n{\n\t$sizes = @getimagesize($file);\n\n\t// Can't get it, what shall we return\n\tif (empty($sizes))\n\t{\n\t\t$sizes = $error === 'array' ? array(-1, -1, -1) : false;\n\t}\n\n\treturn $sizes;\n}", "function ImageInfo($file){\n $ret=array('width'=>0,'height'=>0,'ImageExt'=>'');\n $size = getimagesize($file);\nif($size==FALSE){\n\n\n}else{\n $ext=explode(\"/\", $size['mime']);\n $ret['ImageExt']=$ext[1]; \n $ret['width']=$size[0]; \n $ret['height']=$size[1];\n}\nreturn $ret;\n}", "public function is_image()\n\t\t{\n\t\t\treturn !is_null($f = $this->format()) && $f;\n\t\t}", "public function getImageSize()\n\t{\n\t\tlist($width, $height) = getimagesize($this->getFullpath());\n\n\t\treturn compact('width', 'height');\n\t}", "public function imageSize($image)\n\t{\n\t\tif (is_file($image))\n\t\t{\n\t\t\t$image = getimagesize($image);\n\n\t\t\treturn [\n\t\t\t\t'w' => $image[0],\n\t\t\t\t'h' => $image[1],\n\t\t\t];\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn [\n\t\t\t\t'w' => 0,\n\t\t\t\t'h' => 0,\n\t\t\t];\n\t\t}\n\t}", "public function hasImageWidth()\n {\n return $this->image_width !== null;\n }", "function __checkDimensions($filePath) {\n\t\t$size = getimagesize($filePath);\n\t\t\t\t\n\t\tif(!$size) {\n\t\t\t$this->Session->setFlash('We could not check that image\\'s size, so we can\\'t upload it.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\n\t\tif($size[0] > 800 || $size[1] > 800) {\n\t\t\t$this->Session->setFlash('Images cannot be any larger than 800 by 800 pixels.');\n\t\t\t$this->redirect(Controller::referer('/'));\n\t\t}\n\t\t\n\t}", "public function image_size()\n\t{\n if (!$this->local_file) {\n $this->get_local_file();\n }\n $image_size = getimagesize($this->local_file);\n $this->mime = $image_size['mime'];\n return $image_size;\n\t}", "function getImageSize() \n { \n return array($this->_width,$this->_height); \n }", "function isImage($tempFile) {\n\n // Get the size of the image\n $size = getimagesize($tempFile);\n\n if (isset($size) && $size[0] && $size[1] && $size[0] * $size[1] > 0) {\n return true;\n } else {\n return false;\n }\n\n }", "function exif_imagetype( $filename ) {\n\t\tif ( ! is_dir( $filename ) && ( list( $width, $height, $type, $attr ) = getimagesize( $filename ) ) !== false ) {\n\t\t\treturn $type;\n\t\t}\n\n\t\treturn false;\n\t}", "function isImage($path)\n {\n return is_array(getimagesize($path));\n }", "public function getImageDimensions()\n {\n $dimension = $this->_getSetting('dimension');\n if ($this->getRow()->use_crop) {\n $parentDimension = $this->_getImageEnlargeComponent()->getImageDimensions();\n $dimension['crop'] = $parentDimension['crop'];\n }\n $data = $this->getImageData();\n return Kwf_Media_Image::calculateScaleDimensions($data['file'], $dimension);\n }", "function has_image_size($name)\n {\n }", "protected function getImageParams($imagePath) {\n $imageParams = getimagesize($imagePath);\n if($imageParams) {\n return array(\n 'width' => $imageParams[0],\n 'height' => $imageParams[1],\n 'mime' => $imageParams['mime']\n ); \n } else {\n return false;\n } \n }", "function __checkImgParams() {\n\t\t/* check file type */\n\t\t$this->__checkType($this->request->data['Upload']['file']['type']);\n\t\t\n\t\n\t\t\n\t\t/* check file size */\n\t\t$this->__checkSize($this->request->data['Upload']['file']['size']);\n\t\t\n\t\t\n\t\t\n\t\t/* check image dimensions */\n\t\t$this->__checkDimensions($this->request->data['Upload']['file']['tmp_name']);\n\t\t\n\t\t\t\n\t}", "public function get_image_sizes() {\n\t\tif ( ! is_array( $this->image_sizes ) || empty( $this->image_sizes ) ) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->image_sizes;\n\t}", "public function isImage()\n {\n $mime_type = $this->getMimeType() ?: $this->detectMimeType();\n\n return (strpos($mime_type, 'image') === 0);\n }", "public function hasImage(): bool;", "function wp_is_file_image( $file ) {\n\tif ( @getimagesize( $file ) )\n\t\treturn true;\n\n\treturn false;\n\n}", "public function getDimensions() {\n\t\treturn array('width' => $this->getImageWidth(),'height' =>$this->getImageHeight());\t\n\t}", "public function hasImage(): bool\n {\n return $this->hasImageType(\n $this->getMimeType()\n );\n }", "public function add_image_sizes() {\n\t\tif ( ! is_array( $this->image_sizes ) || empty( $this->image_sizes ) ) {\n\t\t\treturn false;\n\t\t}\n\t\tforeach ( $this->image_sizes as $key => $value ) {\n\t\t\tforeach ( $value as $name => $attributes ) {\n\t\t\t\tif ( empty( $attributes ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( isset( $attributes->width ) && ! empty( $attributes->width ) && isset( $attributes->height ) && ! empty( $attributes->height ) && isset( $attributes->crop ) ) {\n\t\t\t\t\tadd_image_size( $name, $attributes->width, $attributes->height, $attributes->crop );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public function isImage() {\n return $this->_is_image;\n }", "function get_image_size($image) {\n if($image = getimagesize($image)) {\n $image[2] = image_type_to_extension($image[2],false);\n if($image[2] == 'jpeg') {\n $image[2] = 'jpg';\n }\n return $image;\n } else {\n return false;\n }\n}", "public function hasImageHeight()\n {\n return $this->image_height !== null;\n }", "private function varIsImage($img) {\r\n $fp = fopen($img, 'rb');\r\n $exif_data = @exif_read_data($fp);\r\n if(is_array($exif_data)) {\r\n $this->varIsArray($exif_data);\r\n } else {\r\n $this->checkType($img . ' : No exif support for this image format!');\r\n }\r\n fclose($fp);\r\n }", "function validateImage($src) {\n\t\t$imageResult = '';\n\t\tif ($_FILES[$src]['tmp_name'] == '') {\n\t\t\tif (1 == $_FILES[$src]['error']) {\n\t\t\t\t$imageResult = 'Image Size is above server max upload size';\n\t\t\t}\n\t\t\t$imageResult .= '<br/>Image is empty!';\n\t\t}\n\t\tif (!is_uploaded_file($_FILES[$src]['tmp_name'])) {\n\t\t\t$imageResult .= '<br/>Image not uploaded';\n\t\t}\n\t\tif ($_FILES[$src]['size'] == 0) {\n\t\t\t$imageResult .= '<br/>Image size is 0';\n\t\t}\n\t\tif ($_FILES[$src]['size'] > 8388608) {\n\t\t\t$imageResult .= '<br/>Image size is greater than 8mb';\n\t\t}\n\t\t$size = GetImageSize($_FILES[$src]['tmp_name']);\n\t\tif ($size[2] != 1 && $size[2] != 2 && $size[2] != 3) {\n\t\t\t$imageResult .= '<br/>File Not an image';\n\t\t}\n\t\treturn ($imageResult == '') ? true : $imageResult;\n\t}", "function getimagesize($filename){\n\t\t$arr = @getimagesize($filename);\n\n\t\tif(isset($arr) && is_array($arr) && (count($arr) >= 4) && $arr[0] && $arr[1]){\n\t\t\treturn $arr;\n\t\t} else {\n\t\t\tif(we_base_imageEdit::gd_version()){\n\t\t\t\treturn we_base_imageEdit::getimagesize($filename);\n\t\t\t}\n\t\t\treturn $arr;\n\t\t}\n\t}", "function validateFile($file){\n\n $check = getimagesize($file[\"tmp_name\"]);\n if($check !== false) {\n $err = \"File is an image - \" . $check[\"mime\"] . \".\";\n $uploadOk = 1;\n } else {\n $err = \"File is not an image.\";\n $uploadOk = 0;\n }\n// Allow certain file formats\nif($file[\"type\"] != \"jpg\" && $file[\"type\"] != \"png\" && $file[\"type\"] != \"jpeg\"\n&& $file[\"type\"] != \"gif\" ) {\n $err = \"Sorry, only JPG, JPEG, PNG & GIF files are allowed.\";\n $uploadOk = 0;\n}\n return ($uploadOk==1)? true : false;\n}", "function pwg_image_infos($path)\n{\n list($width, $height) = getimagesize($path);\n $filesize = floor(filesize($path)/1024);\n\n return array(\n 'width' => $width,\n 'height' => $height,\n 'filesize' => $filesize,\n );\n}", "function validateFileDimensions(&$model, $fieldData, $fieldName, $dimensions) {\n if (empty($fieldData[$fieldName]['tmp_name'])) return true;\n \n if (!empty($dimensions)) {\n $info = array();\n \n if (list($info['w'], $info['h'], $info['t']) = getimagesize($fieldData[$fieldName]['tmp_name'])) {\n $tmpGeometry = $dimensions;\n $tmpGeometry = str_replace('<', '', $tmpGeometry);\n $tmpGeometry = str_replace('>', '', $tmpGeometry);\n \n list($geometry['w'], $geometry['h']) = explode('x', $tmpGeometry);\n \n foreach ($geometry as $k => $v) {\n $geometry[$k] = str_replace('*', '', $geometry[$k]);\n if ($geometry[$k] == '') unset($geometry[$k]);\n }\n \n $geometry['gtlt'] = 'equal';\n \n if (strpos($dimensions, '>') > 0) {\n $geometry['gtlt'] = 'greater';\n } elseif (strpos($dimensions, '<') > 0) {\n $geometry['gtlt'] = 'less';\n }\n \n if (!empty($geometry['w']) && !assetCheckDimensions($info['w'], $geometry['w'], $geometry['gtlt'])) return false;\n if (!empty($geometry['h']) && !assetCheckDimensions($info['h'], $geometry['h'], $geometry['gtlt'])) return false;\n } else {\n return false;\n }\n }\n \n return true;\n }", "public function checkImageType()\n {\n if (empty($this->checkImageType)) {\n return true;\n }\n\n if (('image' == substr($this->mediaType, 0, strpos($this->mediaType, '/')))\n || (!empty($this->mediaRealType)\n && 'image' == substr($this->mediaRealType, 0, strpos($this->mediaRealType, '/')))\n ) {\n if (!@getimagesize($this->mediaTmpName)) {\n $this->setErrors(\\XoopsLocale::E_INVALID_IMAGE_FILE);\n return false;\n }\n }\n return true;\n }", "public function hasImages()\r\n {\r\n $result = FALSE;\r\n $names = $this->getColumnNames();\r\n foreach($names as $name) {\r\n if(in_array($name, $this->imagesAttributes)) {\r\n return TRUE;\r\n }\r\n }\r\n return $result;\r\n }", "public function has_image() {\r\n return ! empty( $this->image );\r\n }", "function Photo_Uploaded_Is_Valid($file_input, $Max_Size = 500000)\n{\n //Must havein HTML <form enctype=\"multipart/form-data\" .. //otherwise $_FILE is undefined // $file_input is the file input name on the HTML form\n if (!isset($_FILES[$file_input])) {\n return 'No image uploaded';\n }\n if ($_FILES[$file_input]['error'] != UPLOAD_ERR_OK) {\n return 'Error picture upload: code='.$_FILES[$file_input]['error'];\n }\n\n // Check image size\n if ($_FILES[$file_input]['size'] > $Max_Size) {\n return 'Image too big, max file size is '.$Max_Size.' Kb';\n }\n\n // Check that file actually contains an image\n $check = getimagesize($_FILES[$file_input]['tmp_name']);\n if ($check === false) {\n return 'This file is not an image';\n }\n\n // Check extension is jpg,JPG,gif,png\n $imageFileType = pathinfo(basename($_FILES[$file_input]['name']), PATHINFO_EXTENSION);\n if ($imageFileType != 'jpg' && $imageFileType != 'JPG' && $imageFileType != 'gif' && $imageFileType != 'png') {\n return 'Invalid image file type, valid extensions are: .jpg .JPG .gif .png';\n }\n\n return 'OK';\n}", "public static function checkUserImageUpload($tempfile,$imgheight='',$imgwidth='',$uploadtype ='temp') {\r\n \t if($uploadtype == 'file') \t {\r\n \t$upfilename \t= $tempfile;\r\n \t \t$tempfilename = $tempfile;\r\n \t }\r\n \t else \t {\r\n \t \t \r\n \t \t$upfilename \t= $tempfile['name'];\r\n \t \t$tempfilename = $tempfile['tmp_name'];\r\n \t }\r\n \t \r\n \r\n \tif ($tempfile) \r\n \t{\r\n \t\t$errors = 0;\r\n \t\t//echopre($tempfile);\r\n \t\t$filename \t= stripslashes($upfilename);\r\n \t\t$extension \t= self::getFileExtension($filename);\t// get the file extention\r\n \t\t$extension \t= strtolower($extension);\r\n \t\r\n \t\tif (($extension != \"jpg\") && ($extension != \"jpeg\") && ($extension != \"png\") && ($extension != \"gif\"))\r\n \t\t{ \r\n \t\t\t$errors=1; // Unknown Image extension ';\t \r\n \t\t}\r\n \t\telse\r\n \t\t{\r\n \t\t\t$size\t=filesize($tempfilename);\r\n \t\t\tif ($size > MAX_UPLOAD_SIZE*1024)\r\n \t\t\t{\r\n \t\t\t\t$errors=2; // \"You have exceeded the size limit\";\r\n \t\t\t}\r\n \t\t\telse \r\n \t\t\t{\r\n \t\t\t\tif($imgheight >0 && $imgwidth > 0)\r\n \t\t\t\t{\r\n\t \t\t\t\tlist($width,$height)=getimagesize($tempfilename);\r\n\t \t\t\t\t//echo $width.':'.$height;\r\n\t \t\t\t\t//echo '<br>'.$imgwidth.':'.$imgheight;\r\n\t \t\t\t\tif( $height < $imgheight || $width < $imgwidth)\r\n\t \t\t\t\t\t$errors = 3;\t\t// image size not matching\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t\treturn $errors;\r\n \t}\r\n }", "public function getImageDetails() {\n\t\t$details = getimagesize($this->file);\n\n\t\tif(!$details) throw new Exception('Falha na busca dos parametros da imagem!');\n\n\t\tlist($width, $height, $type, $attr, $mime) = $details;\n\t\t$aspect = ($width > $height)?'landscape':'portrait';\n\t\t$ration = $width / $height;\n\n\t\treturn array('width' => $width,'height' => $height,'aspect' => $aspect,'ratio' => $ratio,'mime' => $mime,'type' => $type);\n\t}", "public function getNewDimensionsOfFile(File $file)\n\t{\n\t\tif ( ! $file->isImage())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\tee()->load->library('image_lib');\n\t\tee()->image_lib->clear();\n\n\t\t$original_dimensions = explode(\" \", $file->file_hw_original);\n\n\t\t// We do math on these values, so we'll coerce them into integers\n\t\t// now. Empty strings ('') turn into 0.\n $original_dimensions[0] = (int) $original_dimensions[0];\n $original_dimensions[1] = (int) $original_dimensions[1];\n\n\t\t// If we have 0 or negative numbers for the original height/width\n\t\t// this is not an image\n if ($original_dimensions[0] < 1 || $original_dimensions[1] < 1)\n {\n return FALSE;\n }\n\n\t\t$width = $this->width;\n\t\t$height = $this->height;\n\n\t\t$force_master_dim = FALSE;\n\n\t\t// If either h/w unspecified, calculate the other here\n\t\tif ($this->width == '' OR $this->width == 0)\n\t\t{\n\t\t\t$width = ($original_dimensions[1]/$original_dimensions[0])*$this->height;\n\t\t\t$force_master_dim = 'height';\n\t\t}\n\t\telseif ($this->height == '' OR $this->height == 0)\n\t\t{\n\t\t\t// Old h/old w * new width\n\t\t\t$height = ($original_dimensions[0]/$original_dimensions[1])*$this->width;\n\t\t\t$force_master_dim = 'width';\n\t\t}\n\n\t\t// If the original is smaller than the thumb hxw, we'll make a copy rather than upsize\n\t\tif (($force_master_dim == 'height' && $original_dimensions[0] < $height) OR\n\t\t\t($force_master_dim == 'width' && $original_dimensions[1] < $width) OR\n\t\t\t($force_master_dim == FALSE &&\n\t\t\t\t($original_dimensions[1] < $width && $original_dimensions[0] < $height)\n\t\t\t))\n\t\t{\n\t\t\treturn array(\n\t\t\t\t'height' => $original_dimensions[0],\n\t\t\t\t'width' => $original_dimensions[1],\n\t\t\t);\n\t\t}\n\n\t\t$config = array(\n\t\t\t'source_image' => $file->getAbsolutePath(),\n\t\t\t'image_library' => ee()->config->item('image_resize_protocol'),\n\t\t\t'library_path' => ee()->config->item('image_library_path'),\n\t\t\t'maintain_ratio' => TRUE,\n\t\t\t'width' => $width,\n\t\t\t'height' => $height,\n\t\t\t'master_dim' => $force_master_dim\n\t\t);\n\n\t\tif (isset($this->resize_type) && $this->resize_type == 'crop')\n\t\t{\n\t\t\t// Scale the larger dimension up so only one dimension of our\n\t\t\t// image fits within the desired dimension\n\t\t\tif ($original_dimensions[1] > $original_dimensions[0])\n\t\t\t{\n\t\t\t\t$config['width'] = round($original_dimensions[1] * $height / $original_dimensions[0]);\n\n\t\t\t\t// If the new width ends up being smaller than the\n\t\t\t\t// resized width\n\t\t\t\tif ($config['width'] < $width)\n\t\t\t\t{\n\t\t\t\t\t$config['width'] = $width;\n\t\t\t\t\t$config['master_dim'] = 'width';\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ($original_dimensions[0] > $original_dimensions[1])\n\t\t\t{\n\t\t\t\t$config['height'] = round($original_dimensions[0] * $width / $original_dimensions[1]);\n\n\t\t\t\t// If the new height ends up being smaller than the\n\t\t\t\t// desired resized height\n\t\t\t\tif ($config['height'] < $height)\n\t\t\t\t{\n\t\t\t\t\t$config['height'] = $height;\n\t\t\t\t\t$config['master_dim'] = 'height';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If we're dealing with a perfect square image\n\t\t\telseif ($original_dimensions[0] == $original_dimensions[1])\n\t\t\t{\n\t\t\t\t// And the desired image is landscape, edit the\n\t\t\t\t// square image's width to fit\n\t\t\t\tif ($width > $height ||\n\t\t\t\t\t$width == $height)\n\t\t\t\t{\n\t\t\t\t\t$config['width'] = $width;\n\t\t\t\t\t$config['master_dim'] = 'width';\n\t\t\t\t}\n\t\t\t\t// If the desired image is portrait, edit the\n\t\t\t\t// square image's height to fit\n\t\t\t\telseif ($width < $height)\n\t\t\t\t{\n\t\t\t\t\t$config['height'] = $height;\n\t\t\t\t\t$config['master_dim'] = 'height';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tee()->image_lib->initialize($config);\n\n\t\t\t$config['x_axis'] = ((ee()->image_lib->width / 2) - ($width / 2));\n\t\t\t$config['y_axis'] = ((ee()->image_lib->height / 2) - ($height / 2));\n\t\t\t$config['maintain_ratio'] = FALSE;\n\t\t\t$config['width'] = $width;\n\t\t\t$config['height'] = $height;\n\t\t}\n\n\t\tee()->image_lib->initialize($config);\n\n\t\t$dimensions = array(\n\t\t\t'height' => round(ee()->image_lib->height),\n\t\t\t'width' => round(ee()->image_lib->width),\n\t\t);\n\n\t\treturn $dimensions;\n\t}", "public function hasImage()\n {\n return !is_null($this->image);\n }", "function logonscreener_image_info($file) {\n if (!is_file($file)) {\n logonscreener_log(\"$file is not a file.\");\n return FALSE;\n }\n\n $data = getimagesize($file);\n\n if (!is_array($data)) {\n logonscreener_log(\"No details for $file\");\n return FALSE;\n }\n\n $extensions = array('1' => 'gif', '2' => 'jpeg', '3' => 'png');\n $extension = isset($extensions[$data[2]]) ? $extensions[$data[2]] : '';\n $info = array(\n 'width' => $data[0],\n 'height' => $data[1],\n 'extension' => $extension,\n 'file_size' => filesize($file),\n );\n\n logonscreener_log(\"$file details:\", $info);\n return $info;\n}", "public function hasSizes() {\n if (!empty($this->cropBox['width'])) {\n return TRUE;\n }\n\n if (!empty($this->cropBox['height'])) {\n return TRUE;\n }\n\n return FALSE;\n }", "function Photo_Uploaded_Is_Valid($Max_Size = 500000)\n{\n //sinon $_FILES n'est pas défini\n\n // 'un_fichier' est le nom sur le formulaire HTML\n if (!isset($_FILES['un_fichier'])) {\n return 'Aucune image téléversée';\n }\n\n if ($_FILES['un_fichier']['error'] != UPLOAD_ERR_OK) {\n return 'Erreur téléchargement de la photo: code='.$_FILES['un_fichier']['error'];\n }\n\n // Vérifier taille de l'image\n if ($_FILES['un_fichier']['size'] > $Max_Size) {\n return 'Fichier trop gros, taille maximum = '.$Max_Size.' Kb';\n }\n\n // Vérifier si le fichier contient une image\n $check = getimagesize($_FILES['un_fichier']['tmp_name']);\n if ($check === false) {\n return \"Ce fichier n'est pas une image\";\n }\n\n // Vérifier si extension est jpg,JPG,gif,png\n $imageFileType = pathinfo(basename($_FILES['un_fichier']['name']), PATHINFO_EXTENSION);\n if ($imageFileType != 'jpg' && $imageFileType != 'JPG' && $imageFileType != 'gif' && $imageFileType != 'png') {\n return \"L'extension du fichier est invalide. Doit être parmis: .jpg .JPG .gif .png\";\n }\n\n return 'OK';\n}", "function guy_imagedims($src) {\n\tif (substr($src,0,1)=='/') $src = \nsubstr_replace($src,$_SERVER['DOCUMENT_ROOT'].'/',0,1);\n\tif (is_file($src)) {\n\t\t$wh = @GetImageSize($src);\n\t\treturn $wh[3];\n\t}\n\treturn '';\n}", "public function isImage()\n\t{\n\t\treturn in_array($this->getMimetype(), $this->imagesMimeTypes);\n\t}", "function imageCheck($target,$width=1,$height=1){\n if($width==1&&$height==1){\n return is_array(getimagesize($target));\n }else{\n $rvalue = false;\n if(is_array(getimagesize($target))){\n try {\n $img = new Imagick($target);\n if(strtoupper($img->getImageFormat())=='GIF'){\n $img = $img->coalesceImages();\n $img = $img->coalesceImages();\n do {\n if($width==0||$height==0)\n $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1);\n else $img->resizeImage($width, $height, Imagick::FILTER_BOX, 1,true);\n } while ($img->nextImage());\n $img = $img->deconstructImages();\n $img->writeImages($target,true);\n }else{\n if($width==0||$height==0)\n $img->thumbnailImage($width, $height);\n else $img->thumbnailImage($width, $height,true);\n $img->writeImage($target);\n }\n $img->destroy();\n $rvalue = true;\n } catch (Exception $e) {\n }\n }\n return $rvalue;\n }\n}", "public function testGetImageInfoFromBlob()\n {\n $imgBlob = file_get_contents($this->_testImagePath);\n $imgInfo = Tinebase_ImageHelper::getImageInfoFromBlob($imgBlob);\n \n $this->assertEquals($this->_testImageData['width'], $imgInfo['width']);\n }", "public function hasImage()\n {\n if ($this->_image) {\n return true;\n } else {\n return false;\n }\n }", "public static function isImage($source)\n {\n return getimagesize($source);\n }", "public function getImageSize()\n {\n return $this->ImageSize;\n }", "function validate_image_size( $file ) {\n\t$image = getimagesize($file['tmp_name']);\n\t$maximum = array(\n\t\t'width' => '2500',\n\t\t'height' => '2500'\n\t);\n\t$image_width = $image[0];\n\t$image_height = $image[1];\n\t$too_large = \"Image dimensions are too large. Maximum size is {$maximum['width']} by {$maximum['height']} pixels. Uploaded image is $image_width by $image_height pixels.\";\n\tif ( $image_width > $maximum['width'] || $image_height > $maximum['height'] ) {\n\t\t\t//add in the field 'error' of the $file array the message\n\t\t\t$file['error'] = $too_large; \n\t\t\treturn $file;\n\t}\n\telse {\n\t\treturn $file;\n\t}\n}", "function get_image_size_dimensions($size) {\n\t\tglobal $_wp_additional_image_sizes;\n\t\tif (isset($_wp_additional_image_sizes[$size])) {\n\t\t\t$width = intval($_wp_additional_image_sizes[$size]['width']);\n\t\t\t$height = intval($_wp_additional_image_sizes[$size]['height']);\n\t\t} else {\n\t\t\t$width = get_option($size.'_size_w');\n\t\t\t$height = get_option($size.'_size_h');\n\t\t}\n\n\t\tif ( $width && $height ) {\n\t\t\treturn array(\n\t\t\t\t'width' => $width,\n\t\t\t\t'height' => $height\n\t\t\t);\n\t\t} else return false;\n\t}", "public function isImage()\n {\n return strtolower(substr($this->getMimeType(), 0, 5)) == 'image';\n }", "protected function _checkImage() {\n if ( !is_file ( $this->src ) ) {\n $this->src = $this->default_missing_image; \n }\n $image_path_parts = pathinfo ( $this->src );\n $this->_image_name = $image_path_parts['basename'];\n $this->_thumb_filename = $this->attributes['width'] . 'x' . $this->attributes['height'] . '_' . $this->_image_name;\n $this->_thumb_src = $this->thumbs_dir_path . $this->_thumb_filename;\n if ( is_readable ( $this->_thumb_src ) ) {\n $this->_calculated_width = $this->attributes['width'];\n $this->_calculated_height = $this->attributes['height'];\n $this->src = $this->_thumb_src;\n return 'no_thumb_required';\n }\n if ( !$this->_original_image_info = getimagesize ( $this->src ) ) {\n return 'abort';\n } \n if (!in_array ( $this->_original_image_info['mime'], $this->_valid_mime ) ) {\n return 'abort';\n }\n }", "public function testGetImageSize()\n {\n $img = new P4Cms_Image();\n $data = file_get_contents(TEST_ASSETS_PATH . '/images/luigi.png');\n $img->setData($data);\n $this->assertSame(\n $img->getImageSize(),\n array('width' => 516, 'height' => 710),\n 'Expected image size to be 516x710 pixels.'\n );\n\n if (extension_loaded('imagick')) {\n $img = new P4Cms_Image();\n try {\n $img->getImageSize();\n $this->fail('Expected failure with empty Imagick object.');\n } catch (P4Cms_Image_Exception $e) {\n $this->assertSame(\n $e->getMessage(),\n \"Can not get image size: no image data were set.\"\n );\n } catch (Exception $e) {\n $this->fail('Unexpected exception: '. $e->getMessage());\n }\n } else {\n $this->markTestIncomplete(\"Cannot verify default driver, 'imagick' extension not found.\");\n }\n }", "public function getImgSize() {\n\t\t$this->imgSize = getimagesize($this->imgUri);\n\t}", "public function isImage()\n {\n return str_contains($this->mimetype, 'image/');\n }", "public function getImageSize()\n {\n return (($this->isWrapped() || $this->isTemp()) ?\n getimagesizefromstring($this->getRaw())\n : getimagesize($this->getPathname())\n );\n }", "function file_is_valid_image($path)\n {\n }", "public function &get_cat_image_size($url)\n {\n $false = false;\n\n if (empty($url) || ($url == 'http://') || ($url == 'https://')) {\n return $false;\n }\n\n $size =& $this->_remote_image->get_image_size($url);\n if (!$size) {\n $this->_set_error_code($this->_remote_image->getErrorCode());\n $this->_set_errors($this->_remote_image->getErrors());\n return $false;\n }\n\n list($orig_width, $orig_height) = $size;\n\n list($show_width, $show_height) = $this->_image_size->adjust_size($orig_width, $orig_height, $this->_conf['cat_img_width'], $this->_conf['cat_img_height']);\n\n $arr = array(\n 'orig_width' => $orig_width,\n 'orig_height' => $orig_height,\n 'show_width' => $show_width,\n 'show_height' => $show_height,\n );\n\n return $arr;\n }", "public function isValidImage()\n\t{\n\t\t$src = $this->source_path;\n\t\t$extension = \\strtolower(\\substr($src, (\\strrpos($src, '.') + 1)));\n\n\t\tif (!\\in_array($extension, $this->image_extensions)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$r = @\\imagecreatefromstring(\\file_get_contents($src));\n\n\t\treturn \\is_resource($r) && \\get_resource_type($r) === 'gd';\n\t}", "public function hasImages()\n {\n return ($this->resource->getNumberImages() > 0);\n }", "public function isValid() {\n if ($this->advanced) {\n $this->image = imagecreatefromstring($this->image);\n }\n\n if (!$this->checkFiletype()) {\n trigger_error('Image format is invalid', E_USER_ERROR);\n failed(WEBROOT . '/', 'Image format is invalid');\n return false;\n }\n if ($this->isVideo) {\n $videoAtts = $this->getVideoAttributes();\n $width = $videoAtts['width'];\n $height = $videoAtts['height'];\n if ($width != $height) {\n trigger_error('Video is not 1:1 aspect ratio', E_USER_ERROR);\n failed(WEBROOT . '/', 'Video is not 1:1 aspect ratio');\n return false;\n }\n if ($width < MINIMAGESIZE) {\n trigger_error('Video is smaller than ' . MINIMAGESIZE, E_USER_ERROR);\n failed(WEBROOT . '/', 'Video is smaller than ' . MINIMAGESIZE);\n return false;\n }\n \n $filesize = filesize($this->image);\n $maxFilesize = Helper::getInstance()->convertToBytes(MAXVIDEOFILESIZE, 'mb');\n if ($filesize > $maxFilesize) {\n trigger_error('Video is too large, max filesize is ' . MAXVIDEOFILESIZE, E_USER_ERROR);\n failed(WEBROOT . '/', 'Video is too large, max filesize is ' . MAXVIDEOFILESIZE);\n return false;\n }\n } else if ($this->filetype == 'svg') {\n \n } else {\n if ($this->advanced) {\n $width = imagesx($this->image);\n $height = imagesy($this->image);\n } else {\n $imageSize = getimagesize($this->image);\n $width = $imageSize[0];\n $height = $imageSize[1];\n }\n if ($width != $height) {\n trigger_error('Image is not 1:1 aspect ratio', E_USER_ERROR);\n failed(WEBROOT . '/', 'Image is not 1:1 aspect ratio');\n return false;\n }\n if ($width < MINIMAGESIZE) {\n trigger_error('Image is smaller than ' . MINIMAGESIZE, E_USER_ERROR);\n failed(WEBROOT . '/', 'Image is smaller than ' . MINIMAGESIZE);\n return false;\n }\n }\n \n return true;\n }", "function isImage($filename) {\n \tglobal $synAbsolutePath;\n if (file_exists($synAbsolutePath.$filename)) {\n if (getimagesize($synAbsolutePath.$filename)!==false) $ret=true;\n else $ret=false;\n } else $ret=false;\n return $ret;\n }", "public static function isImageSupported($image_data) {\n $maxFileSize = 2097152;\n $maxWidth = 1920;\n $maxHeight = 1080;\n\n $path_info = pathinfo($image_data[\"userfile\"][\"name\"]);\n if (!self::isValidType($path_info['extension']))\n return false;\n\n if ($image_data['userfile']['size'] > $maxFileSize)\n return false;\n\n $image_dimensions = getimagesize($image_data['userfile']['tmp_name']);\n $image_width = $image_dimensions[0];\n $image_height = $image_dimensions[1];\n if (($image_width > $maxWidth) || ($image_height > $maxHeight))\n return false;\n\n return true;\n }", "public function getDimensions()\n {\n $imageDimension = getimagesize($this->image);\n\n $width = $imageDimension[0];\n $height = $imageDimension[1];\n\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $modified = $effect->getNewDimensions($width, $height);\n\n $width = $modified['w'];\n $height = $modified['h'];\n }\n }\n\n return array(\n 'w' => $width,\n 'h' => $height,\n );\n }", "function logonscreener_image_is_valid($info) {\n $valid = $info['width'] == $GLOBALS['screen_width']\n && $info['height'] == $GLOBALS['screen_height']\n && $info['extension'] == 'jpeg'\n && $info['file_size'] <= LOGONSCREENER_MAX_FILESIZE;\n\n if ($valid) {\n logonscreener_log('Image is valid with no further transformation.');\n }\n\n return $valid;\n}", "public function isSupportedImage()\n\t{\n\t\t$mime = $this->getMimeType();\n\t\tif (in_array($mime, array('image/jpeg', 'image/gif', 'image/png')))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function wp_getimagesize($filename, array &$image_info = \\null)\n {\n }", "protected function isImage($fileInfo)\n {\n // Maybe array with file info came in\n if (is_array($fileInfo)) {\n return strstr($fileInfo['type'], 'image/');\n }\n\n // File path came in - check the physical file\n if (!$this->rootDirectory->isReadable($this->rootDirectory->getRelativePath($fileInfo))) {\n return false;\n }\n $imageInfo = getimagesize($fileInfo);\n if (!$imageInfo) {\n return false;\n }\n return true;\n }", "public function checkMaxWidth()\n {\n if (!isset($this->maxWidth)) {\n return true;\n }\n if (false !== $dimension = getimagesize($this->mediaTmpName)) {\n if ($dimension[0] > $this->maxWidth) {\n $this->setErrors(sprintf(\\XoopsLocale::EF_FILE_WIDTH_TO_LARGE, $this->maxWidth, $dimension[0]));\n return false;\n }\n } else {\n trigger_error(sprintf(\\XoopsLocale::EF_IMAGE_SIZE_NOT_FETCHED, $this->mediaTmpName), E_USER_WARNING);\n }\n return true;\n }", "public static function isImage($file){\n if(is_file($file)){\n $info = getimagesize($file);\n if(isset($info) && $info[2] > 0)\n return true;\n }\n return false;\n }", "public function hasImages()\n {\n return count($this->images) > 0;\n }", "public function isImage() {\n\t\treturn MimeType::isImage($this);\n\t}", "function isValidFile($fileArray)\n{\n\t# Creating image type array\n\t$imgTypeArr = array('jpg','gif','png','jpeg');\n\t\n\t# image size variable\n\t$fileSize\t= $fileArray['file']['size']; \n\t\n\t# image type variable\n\t$fileType\t= $fileArray['file']['name']; \n\t\n\t# Creating Image extension variable and converting to lowercase\n\t\t$imageExt\t= strtolower(substr($fileType, strrpos($fileType, '.') + 1));\n\t\n\t# Checking weather file type is image and size is less then OR equal to 2 MB\n\tif(in_array($imageExt,$imgTypeArr) && $fileSize <= '2090000'){\n\t\treturn TRUE;\n\t}else{\n\t\treturn FALSE;\n\t}\n}", "function fa_get_custom_image_size( $image_id, $width, $height ){\n\t$image_id \t= absint( $image_id );\n\t$width \t\t= absint( $width );\n\t$height \t= absint( $height );\n\t// if width or height is 0, don't do anything\n\tif( $width == 0 || $height == 0 ){\n\t\treturn false;\n\t}\n\t// get the metadata from image\t\n\t$attachment_meta = get_post_meta( $image_id, '_wp_attachment_metadata', true );\n\tif( !$attachment_meta ){\n\t\treturn false;\n\t}\n\t// if width and height exceed the full image size, return the full image\n\tif( $width >= $attachment_meta['width'] && $height >= $attachment_meta['height'] ){\n\t\t$attachment = wp_get_attachment_image_src( $image_id, 'full' );\n\t\treturn $attachment[0];\n\t}\n\t\n\t// check if any of the registered sizes match the size we're looking for\n\tforeach( $attachment_meta['sizes'] as $size_name => $size_details ){\n\t\t// size matched, return it\n\t\tif( $width == $size_details['width'] && $height == $size_details['height'] ){\n\t\t\t$attachment = wp_get_attachment_image_src( $image_id, $size_name );\t\n\t\t\treturn $attachment[0];\t\t\n\t\t}\n\t}\n\t\n\t// get the upload dir details\n\t$wp_upload_dir = wp_upload_dir();\n\t// an extra meta field on image to store fa image sizes of resized images\n\t$fa_sizes = get_post_meta( $image_id, '_fa_attachment_metadata', true );\n\n\t// check sizes stored by FA\n\tif( $fa_sizes ){\n\t\tforeach( $fa_sizes as $details ){\n\t\t\tif( $width == $details['width'] && $height == $details['height'] ){\n\t\t\t\treturn $wp_upload_dir['baseurl'] . wp_normalize_path( $details['rel_path'] );\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// create the new size if not found yet\n\t$image_path = path_join( $wp_upload_dir['basedir'] , $attachment_meta['file'] );\n\t// create the new image size\n\t$img_editor = wp_get_image_editor( $image_path );\n\t$img_editor->set_quality( 90 );\t\t\t\n\t$resized \t= $img_editor->resize( $width, $height, true );\n\t$new_file \t= $img_editor->generate_filename( null, null );\n\t$saved \t\t= $img_editor->save( $new_file );\n\t// relative file path\n\t$rel_path = str_replace( $wp_upload_dir['basedir'], '', $new_file );\n\t$new_file_url = $wp_upload_dir['baseurl'] . wp_normalize_path( $rel_path );\n\t\n\t// store the new size on image meta\n\t$fa_sizes = is_array( $fa_sizes ) ? $fa_sizes : array();\n\t$file_details = array(\n\t\t'basename' \t=> wp_basename( $new_file ),\n\t\t'rel_path' \t=> $rel_path,\n\t\t'width' \t=> $width,\n\t\t'height' \t=> $height\n\t);\n\t$fa_sizes[] = $file_details;\n\tupdate_post_meta( $image_id, '_fa_attachment_metadata', $fa_sizes);\n\treturn $new_file_url;\n}", "public function hasHardSizes() {\n return (!empty($this->cropBox['width']) && !empty($this->cropBox['height'])) ? TRUE : FALSE;\n }", "function check_image_type_array($source_pic)\n{\n switch ($source_pic) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "private function checkImage()\n\t{\n\t\tif (!$this->imageResized) {\n\t\t\t$this->resize($this->width, $this->height);\n\t\t}\n\t}", "public function getSize() {\n return $_FILES['uploadfile']['size'];\n }" ]
[ "0.7213394", "0.7162518", "0.71464676", "0.71033216", "0.68905336", "0.68886024", "0.6876985", "0.6869756", "0.679584", "0.67584443", "0.67538893", "0.67511433", "0.6708959", "0.66778356", "0.6675638", "0.66334563", "0.66254205", "0.66207093", "0.6612658", "0.6583274", "0.65483606", "0.65386283", "0.65383166", "0.65178233", "0.6509317", "0.6477785", "0.6433035", "0.6381094", "0.6377943", "0.6374378", "0.6362945", "0.6360617", "0.6351494", "0.6348462", "0.62982595", "0.627062", "0.62609285", "0.62349033", "0.6218074", "0.6216963", "0.6199619", "0.61962116", "0.6176069", "0.61669755", "0.616594", "0.61605036", "0.61444026", "0.6110356", "0.6098762", "0.6097176", "0.60782427", "0.6070804", "0.6066897", "0.60666996", "0.6060511", "0.60604686", "0.6046183", "0.6036579", "0.60353863", "0.6021631", "0.6018583", "0.6000035", "0.5999851", "0.5999347", "0.59960526", "0.59920526", "0.5972472", "0.59618974", "0.5960835", "0.5947264", "0.5941539", "0.5938795", "0.59360594", "0.59348863", "0.59338313", "0.5919703", "0.59158975", "0.5907879", "0.59065765", "0.58889204", "0.5877272", "0.5872073", "0.58720237", "0.5866059", "0.5865743", "0.585178", "0.58515817", "0.58496934", "0.584383", "0.58387333", "0.58292186", "0.58271486", "0.58232003", "0.58065957", "0.5797197", "0.57902133", "0.57814", "0.57783496", "0.5772458", "0.576617" ]
0.72267246
0
Returns mimetype of uploaded file or null if hosting does not support checking. This is real mimetype detection, not via file extension.
public function GetMimeType() { if ($this->IsValid() && $this->MimeType === null) { if (function_exists('mime_content_type')) { $this->MimeType= mime_content_type($this->TmpName); } elseif (function_exists('finfo_open')) { $fInfo= finfo_open(FILEINFO_MIME); $this->MimeType= finfo_file($fInfo, $this->TmpName); finfo_close($fInfo); } } return $this->MimeType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function type() {\n\t\treturn $this->_cache(__FUNCTION__, function($file) {\n\t\t\t$type = null;\n\n\t\t\t// We can't use the file command on windows\n\t\t\tif (!defined('PHP_WINDOWS_VERSION_MAJOR')) {\n\t\t\t\t$type = shell_exec(sprintf(\"file -b --mime %s\", escapeshellarg($file->path())));\n\n\t\t\t\tif ($type && strpos($type, ';') !== false) {\n\t\t\t\t\t$type = strstr($type, ';', true);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback because of fileinfo bug: https://bugs.php.net/bug.php?id=53035\n\t\t\tif (!$type) {\n\t\t\t\t$info = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t\t$type = finfo_file($info, $file->path());\n\t\t\t\tfinfo_close($info);\n\t\t\t}\n\n\t\t\t// Check the mimetype against the extension or $_FILES type\n\t\t\t// If they are different, use the upload type since fileinfo returns invalid mimetypes\n\t\t\t// This could be problematic in the future, but unknown better alternative\n\t\t\t$extType = $file->data('type') ?: MimeType::getTypeFromExt($file->ext());\n\n\t\t\tif ($type !== $extType) {\n\t\t\t\t$type = $extType;\n\t\t\t}\n\n\t\t\treturn $type;\n\t\t});\n\t}", "public function detectMimeType()\n {\n static::checkFileinfoExtension();\n\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n\n return (($this->isWrapped() || $this->isTemp()) ?\n $finfo->buffer($this->getRaw())\n : $finfo->file($this->getPathname())\n );\n }", "private function _getUploadedFileMimeType($file_data) {\n if(function_exists('mime_content_type')) {\n $mime_type = mime_content_type($file_data['tmp_name']);\n return $mime_type;\n }\n\n if(function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mime_type = finfo_file($finfo, $file_data['tmp_name']);\n finfo_close($finfo);\n return $mime_type;\n }\n\n return null;\n }", "public function getType()\n {\n return MimeType::detectByFilename($this->fullPath);\n }", "public function getMimeType()\n {\n if (!class_exists('finfo', false)) return $this->type;\n $info = new \\finfo(FILEINFO_MIME);\n return $info->file($this->tmp);\n }", "public function getMimeType(): ?string\n {\n return $this->mime_type;\n }", "public function getMimeType()\n {\n return $this->file['type'];\n }", "public function guessMimeType(): string\n {\n $mimeType = mime_content_type($this->getPath());\n\n if ($mimeType === false) {\n return '';\n }\n\n return $mimeType;\n }", "function get_file_type($file_mimetype)\n{\n // Get mimetype from file\n $mimetype = explode('/', $file_mimetype);\n\n switch ($mimetype[0]) {\n case 'image':\n return 'image';\n break;\n case 'video':\n return 'video';\n break;\n case 'audio':\n return 'audio';\n break;\n default:\n return 'file';\n }\n}", "public function mime()\n {\n if (!$this->exists()) {\n return false;\n }\n if (class_exists('finfo')) {\n $finfo = new finfo(FILEINFO_MIME);\n $type = $finfo->file($this->pwd());\n if (!$type) {\n return false;\n }\n list($type) = explode(';', $type);\n\n return $type;\n }\n if (function_exists('mime_content_type')) {\n return mime_content_type($this->pwd());\n }\n\n return false;\n }", "public function getPreferredContentType()\n\t{\n\t\t$accept = explode(',', $this->getHeader('Accept'));\n\t\tforeach ($accept as $mimeType) {\n\t\t\tforeach ($this->formats as $formatMime) {\n\t\t\t\tif (Strings::contains($mimeType, $formatMime)) {\n\t\t\t\t\treturn $formatMime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn NULL;\n\t}", "function getFileMimetype($file_path)\n {\n if (function_exists('finfo_open'))\n {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $type = finfo_file($finfo, $file_path);\n finfo_close($finfo);\n }\n elseif (function_exists('mime_content_type'))\n {\n $type = mime_content_type($file);\n }\n else\n {\n // Unable to get the file mimetype!\n $type = '';\n }\n return $type;\n }", "function mimetype($filedata) {\r\n\t\t$filepath = $filedata['tmp_name'];\r\n\t\t// Check only existing files\r\n\t\tif (!file_exists($filepath) || !is_readable($filepath)) return false;\r\n\r\n\t\t// Trying to run file from the filesystem\r\n\t\tif (function_exists('exec')) {\r\n\t\t\t$mimeType = exec(\"/usr/bin/file -i -b $filepath\");\r\n\t\t\tif (!empty($mimeType)) return $mimeType;\r\n\t\t}\r\n\r\n\t\t// Trying to get mimetype from images\r\n\t\t$imageData = @getimagesize($filepath);\r\n\t\tif (!empty($imageData['mime'])) {\r\n\t\t\treturn $imageData['mime'];\r\n\t\t}\r\n\r\n\t\t// Reverting to guessing the mimetype from a known list\r\n\t\t // Thanks to MilesJ Uploader plugin : http://milesj.me/resources/logs/uploader-plugin\r\n\t\tstatic $mimeTypes = array(\r\n\t\t\t// Images\r\n\t\t\t'bmp'\t=> 'image/bmp',\r\n\t\t\t'gif'\t=> 'image/gif',\r\n\t\t\t'jpe'\t=> 'image/jpeg',\r\n\t\t\t'jpg'\t=> 'image/jpeg',\r\n\t\t\t'jpeg'\t=> 'image/jpeg',\r\n\t\t\t'pjpeg'\t=> 'image/pjpeg',\r\n\t\t\t'svg'\t=> 'image/svg+xml',\r\n\t\t\t'svgz'\t=> 'image/svg+xml',\r\n\t\t\t'tif'\t=> 'image/tiff',\r\n\t\t\t'tiff'\t=> 'image/tiff',\r\n\t\t\t'ico'\t=> 'image/vnd.microsoft.icon',\r\n\t\t\t'png'\t=> 'image/png',\r\n\t\t\t'xpng'\t=> 'image/x-png',\r\n\t\t\t// Text\r\n\t\t\t'txt' \t=> 'text/plain',\r\n\t\t\t'asc' \t=> 'text/plain',\r\n\t\t\t'css' \t=> 'text/css',\r\n\t\t\t'csv'\t=> 'text/csv',\r\n\t\t\t'htm' \t=> 'text/html',\r\n\t\t\t'html' \t=> 'text/html',\r\n\t\t\t'stm' \t=> 'text/html',\r\n\t\t\t'rtf' \t=> 'text/rtf',\r\n\t\t\t'rtx' \t=> 'text/richtext',\r\n\t\t\t'sgm' \t=> 'text/sgml',\r\n\t\t\t'sgml' \t=> 'text/sgml',\r\n\t\t\t'tsv' \t=> 'text/tab-separated-values',\r\n\t\t\t'tpl' \t=> 'text/template',\r\n\t\t\t'xml' \t=> 'text/xml',\r\n\t\t\t'js'\t=> 'text/javascript',\r\n\t\t\t'xhtml'\t=> 'application/xhtml+xml',\r\n\t\t\t'xht'\t=> 'application/xhtml+xml',\r\n\t\t\t'json'\t=> 'application/json',\r\n\t\t\t// Archive\r\n\t\t\t'gz'\t=> 'application/x-gzip',\r\n\t\t\t'gtar'\t=> 'application/x-gtar',\r\n\t\t\t'z'\t\t=> 'application/x-compress',\r\n\t\t\t'tgz'\t=> 'application/x-compressed',\r\n\t\t\t'zip'\t=> 'application/zip',\r\n\t\t\t'rar'\t=> 'application/x-rar-compressed',\r\n\t\t\t'rev'\t=> 'application/x-rar-compressed',\r\n\t\t\t'tar'\t=> 'application/x-tar',\r\n\t\t\t// Audio\r\n\t\t\t'aif' \t=> 'audio/x-aiff',\r\n\t\t\t'aifc' \t=> 'audio/x-aiff',\r\n\t\t\t'aiff' \t=> 'audio/x-aiff',\r\n\t\t\t'au' \t=> 'audio/basic',\r\n\t\t\t'kar' \t=> 'audio/midi',\r\n\t\t\t'mid' \t=> 'audio/midi',\r\n\t\t\t'midi' \t=> 'audio/midi',\r\n\t\t\t'mp2' \t=> 'audio/mpeg',\r\n\t\t\t'mp3' \t=> 'audio/mpeg',\r\n\t\t\t'mpga' \t=> 'audio/mpeg',\r\n\t\t\t'ra' \t=> 'audio/x-realaudio',\r\n\t\t\t'ram' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rm' \t=> 'audio/x-pn-realaudio',\r\n\t\t\t'rpm' \t=> 'audio/x-pn-realaudio-plugin',\r\n\t\t\t'snd' \t=> 'audio/basic',\r\n\t\t\t'tsi' \t=> 'audio/TSP-audio',\r\n\t\t\t'wav' \t=> 'audio/x-wav',\r\n\t\t\t'wma'\t=> 'audio/x-ms-wma',\r\n\t\t\t// Video\r\n\t\t\t'flv' \t=> 'video/x-flv',\r\n\t\t\t'fli' \t=> 'video/x-fli',\r\n\t\t\t'avi' \t=> 'video/x-msvideo',\r\n\t\t\t'qt' \t=> 'video/quicktime',\r\n\t\t\t'mov' \t=> 'video/quicktime',\r\n\t\t\t'movie' => 'video/x-sgi-movie',\r\n\t\t\t'mp2' \t=> 'video/mpeg',\r\n\t\t\t'mpa' \t=> 'video/mpeg',\r\n\t\t\t'mpv2' \t=> 'video/mpeg',\r\n\t\t\t'mpe' \t=> 'video/mpeg',\r\n\t\t\t'mpeg' \t=> 'video/mpeg',\r\n\t\t\t'mpg' \t=> 'video/mpeg',\r\n\t\t\t'mp4'\t=> 'video/mp4',\r\n\t\t\t'viv' \t=> 'video/vnd.vivo',\r\n\t\t\t'vivo' \t=> 'video/vnd.vivo',\r\n\t\t\t'wmv'\t=> 'video/x-ms-wmv',\r\n\t\t\t// Applications\r\n\t\t\t'js'\t=> 'application/x-javascript',\r\n\t\t\t'xlc' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xll' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlm' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xls' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'xlw' \t=> 'application/vnd.ms-excel',\r\n\t\t\t'doc'\t=> 'application/msword',\r\n\t\t\t'dot'\t=> 'application/msword',\r\n\t\t\t'pdf' \t=> 'application/pdf',\r\n\t\t\t'psd' \t=> 'image/vnd.adobe.photoshop',\r\n\t\t\t'ai' \t=> 'application/postscript',\r\n\t\t\t'eps' \t=> 'application/postscript',\r\n\t\t\t'ps' \t=> 'application/postscript'\r\n\t\t);\r\n\t\t$ext = $this->ext($filedata);\r\n\t\treturn array_key_exists($ext, $mimeTypes) ? $mimeTypes[$ext] : false;\r\n\t}", "public function getMimeType()\n\t{\n\t\treturn mime_content_type($this->tmp_name);\n\t}", "public function getMimeType()\n {\n $this->mime_type = null;\n\n if ($this->exists === false) {\n return;\n }\n\n if ($this->is_file === true) {\n } else {\n return;\n }\n\n if (function_exists('finfo_open')) {\n $php_mime = finfo_open(FILEINFO_MIME);\n $this->mime_type = strtolower(finfo_file($php_mime, $this->temp));\n finfo_close($php_mime);\n\n } elseif (function_exists('mime_content_type')) {\n $this->mime_type = mime_content_type($this->temp);\n\n } else {\n throw new \\RuntimeException\n ('Ftp Filesystem: getMimeType either finfo_open or mime_content_type are required in PHP');\n }\n\n return;\n }", "public static function get_mime_type($filename)\n {\n // If the finfo module is compiled into PHP, use it.\n $path = BASE_PATH . DIRECTORY_SEPARATOR . $filename;\n if (class_exists('finfo') && file_exists($path)) {\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n return $finfo->file($path);\n }\n\n // Fallback to use the list from the HTTP.yml configuration and rely on the file extension\n // to get the file mime-type\n $ext = strtolower(File::get_file_extension($filename));\n // Get the mime-types\n $mimeTypes = HTTP::config()->uninherited('MimeTypes');\n\n // The mime type doesn't exist\n if (!isset($mimeTypes[$ext])) {\n return 'application/unknown';\n }\n\n return $mimeTypes[$ext];\n }", "public function getMimetype();", "public function getFileType()\n\t{\n\t\tif (is_dir($this->getFullPath()))\n\t\t{\n\t\t\treturn 'directory';\n\t\t}\n\t\tif (is_link($this->getFullPath()))\n\t\t{\n\t\t\treturn 'link';\n\t\t}\n\t\tif (is_file($this->getFullPath()))\n\t\t{\n\t\t\treturn 'file';\n\t\t}\n\t\treturn 'unknown';\n\n\t}", "function getfiletype($path){\n\t$extension = getextension($path);\n\tif($extension!=null)\n\t{\n if (isset($_ENV['MIME_TYPES']['binary'][$extension])){\n return 'binary';\n } else if (isset($_ENV['MIME_TYPES']['ascii'][$extension])){\n return 'ascii';\n }\n }\n return null;\n}", "function _mime_content_type($filename) {\n $finfo = finfo_open();\n $fileinfo = finfo_file($finfo, $filename, FILEINFO_MIME);\n finfo_close($finfo);\n return reset(explode(\";\",$fileinfo));\n \n \n //hiphop workaround hiphop does not work with inotify\n //exec(\"file \".str_replace(\" \",\"\\ \",$filename).\" --mime\",$output);\n \n $half = explode(\": \",$output[0]);\n $done = explode(\"; \",$half[1]);\n return $done[0];\n }", "public function getMimeType(): string\n\t{\n\t\tif( $this->upload->error === 4 )\n\t\t\tthrow new RuntimeException( 'No file uploaded' );\n\t\treturn $this->upload->type;\n\t}", "function fn_get_mime_content_type($filename, $check_by_extension = true, $not_available_result = 'application/octet-stream')\n{\n $type = '';\n\n if (class_exists('finfo')) {\n $finfo_handler = @finfo_open(FILEINFO_MIME);\n if ($finfo_handler !== false) {\n $type = @finfo_file($finfo_handler, $filename);\n list($type) = explode(';', $type);\n @finfo_close($finfo_handler);\n }\n }\n\n if (empty($type) && function_exists('mime_content_type')) {\n $type = @mime_content_type($filename);\n }\n\n if (empty($type) && $check_by_extension && strpos(fn_basename($filename), '.') !== false) {\n $type = fn_get_file_type(fn_basename($filename), $not_available_result);\n }\n\n return !empty($type) ? $type : $not_available_result;\n}", "function _mime_content_type($filename) {\n if (!file_exists($filename) || !is_readable($filename)) return false;\n if(class_exists('finfo')){\n $result = new finfo();\n if (is_resource($result) === true) {\n return $result->file($filename, FILEINFO_MIME_TYPE);\n }\n }\n \n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filename);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';')) list($mimeType,) = explode(';', $mimeType);\n return $mimeType;\n }\n \n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filename);\n }\n \n\n // Trying to get mimetype from images\n $imageData = getimagesize($filename);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n // Trying exec\n if (function_exists('exec')) {\n $mimeType = exec(\"/usr/bin/file -i -b $filename\");\n if(strpos($mimeType,';')){\n $mimeTypes = explode(';',$mimeType);\n return $mimeTypes[0];\n }\n if (!empty($mimeType)) return $mimeType;\n }\n return false;\n }", "public function getMimetype() {\n $mimetype = false;\n if (isset($this->_mimetype)) {\n $mimetype = $this->_mimetype;\n }\n\n return $mimetype;\n }", "function _file_get_type($file) {\n $ext = file_ext($file);\n if (preg_match(\"/$ext/i\", get_setting(\"image_ext\")))\n return IMAGE;\n if (preg_match(\"/$ext/i\", get_setting(\"audio_ext\")))\n return AUDIO;\n if (preg_match(\"/$ext/i\", get_setting(\"video_ext\")))\n return VIDEO;\n if (preg_match(\"/$ext/i\", get_setting(\"document_ext\")))\n return DOCUMENT;\n if (preg_match(\"/$ext/i\", get_setting(\"archive_ext\")))\n return ARCHIVE;\n }", "function getMimeType($filename)\n{\n\t$mimeType = '';\n\n\t// Check only existing readable files\n\tif (!file_exists($filename) || !is_readable($filename))\n\t{\n\t\treturn '';\n\t}\n\n\t// Try finfo, this is the preferred way\n\tif (function_exists('finfo_open'))\n\t{\n\t\t$finfo = finfo_open(FILEINFO_MIME);\n\t\t$mimeType = finfo_file($finfo, $filename);\n\t\tfinfo_close($finfo);\n\t}\n\t// No finfo? What? lets try the old mime_content_type\n\telseif (function_exists('mime_content_type'))\n\t{\n\t\t$mimeType = mime_content_type($filename);\n\t}\n\t// Try using an exec call\n\telseif (function_exists('exec'))\n\t{\n\t\t$mimeType = @exec(\"/usr/bin/file -i -b $filename\");\n\t}\n\n\t// Still nothing? We should at least be able to get images correct\n\tif (empty($mimeType))\n\t{\n\t\t$imageData = elk_getimagesize($filename, 'none');\n\t\tif (!empty($imageData['mime']))\n\t\t{\n\t\t\t$mimeType = $imageData['mime'];\n\t\t}\n\t}\n\n\t// Account for long responses like text/plain; charset=us-ascii\n\tif (!empty($mimeType) && strpos($mimeType, ';'))\n\t{\n\t\tlist($mimeType,) = explode(';', $mimeType);\n\t}\n\n\treturn $mimeType;\n}", "public function getContentType()\n {\n if (isset($_SERVER[\"CONTENT_TYPE\"])) {\n return $_SERVER[\"CONTENT_TYPE\"];\n } elseif (isset($_SERVER[\"HTTP_CONTENT_TYPE\"])) {\n //fix bug https://bugs.php.net/bug.php?id=66606\n return $_SERVER[\"HTTP_CONTENT_TYPE\"];\n }\n\n return null;\n }", "function get_mime_type($file, $real_filename = null, $use_native_functions = true) {\n if (function_exists('mime_content_type') && $use_native_functions) {\n $mime_type = trim(mime_content_type($file));\n if (!$mime_type) {\n return 'application/octet-stream';\n } // if\n $mime_type = explode(';', $mime_type);\n return $mime_type[0];\n } else if (function_exists('finfo_open') && function_exists('finfo_file') && $use_native_functions) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mime_type;\n } else {\n if ($real_filename) {\n $file = $real_filename;\n } // if\n \n $mime_types = array(\n 'txt' => 'text/plain',\n 'htm' => 'text/html',\n 'html' => 'text/html',\n 'php' => 'text/html',\n 'css' => 'text/css',\n 'js' => 'application/javascript',\n 'json' => 'application/json',\n 'xml' => 'application/xml',\n 'swf' => 'application/x-shockwave-flash',\n 'flv' => 'video/x-flv',\n 'png' => 'image/png',\n 'jpe' => 'image/jpeg',\n 'jpeg' => 'image/jpeg',\n 'jpg' => 'image/jpeg',\n 'gif' => 'image/gif',\n 'bmp' => 'image/bmp',\n 'ico' => 'image/vnd.microsoft.icon',\n 'tiff' => 'image/tiff',\n 'tif' => 'image/tiff',\n 'svg' => 'image/svg+xml',\n 'svgz' => 'image/svg+xml',\n 'zip' => 'application/zip',\n 'rar' => 'application/x-rar-compressed',\n 'exe' => 'application/x-msdownload',\n 'msi' => 'application/x-msdownload',\n 'cab' => 'application/vnd.ms-cab-compressed',\n 'mp3' => 'audio/mpeg',\n 'qt' => 'video/quicktime',\n 'mov' => 'video/quicktime',\n 'pdf' => 'application/pdf',\n 'psd' => 'image/vnd.adobe.photoshop',\n 'ai' => 'application/postscript',\n 'eps' => 'application/postscript',\n 'ps' => 'application/postscript',\n 'doc' => 'application/msword',\n 'rtf' => 'application/rtf',\n 'xls' => 'application/vnd.ms-excel',\n 'ppt' => 'application/vnd.ms-powerpoint',\n 'odt' => 'application/vnd.oasis.opendocument.text',\n 'ods' => 'application/vnd.oasis.opendocument.spreadsheet',\n );\n \n $extension = strtolower(get_file_extension($file));\n if (array_key_exists($extension, $mime_types)) {\n return $mime_types[$extension];\n } else {\n return 'application/octet-stream';\n } // if\n } // if\n }", "public function getMimeType(): ?string\n\t{\n\t\treturn $this->mimeType;\n\t}", "function getMimeType($file) {\n\t\tif (!function_exists('mime_content_type')) {\n\t\t\t$f = escapeshellarg($file);\n\t\t\tif ($mimeType = trim( `file -b --mime $f` )) {\n\t\t\t\t// The --mime parameter will return more information than necessary\n\t\t\t\t// i.e. \"text/plain; charset=us-ascii\" vs. \"text/plain\"\n\t\t\t\t$mimeParts = explode('; ', $mimeType);\n\t\t\t\treturn $mimeParts[0];\n\t\t\t}\n\t\t}\n\t\treturn mime_content_type($file);\n\t}", "public static function detect($file)\n {\n if ($file instanceof File) {\n $file = $file->getPath();\n }\n if (file_exists($file) && is_file($file)) {\n return mime_content_type($file);\n }\n\n return false;\n }", "function mimeType($path) {\n\t\tif ($file = $this->file($path)) {\n\t\t\treturn Mime_Type::guessType($file);\n\t\t}\n\t}", "protected function readMimeType()\n {\n $ext = pathinfo($this->filename, PATHINFO_EXTENSION);\n $this->mimeType = PMF_Attachment_MimeType::guessByExt($ext);\n\n return $this->mimeType;\n }", "protected static function _get_mime_type( $resource ) {\r\n $type = function_exists( 'mime_content_type' ) && file_exists($resource) ? \r\n mime_content_type( $resource ) :\r\n 'text/plain';\r\n if( preg_match( '/\\.js(\\?|$)/', $resource ) ) {\r\n $type = 'text/javascript';\r\n } else if( preg_match( '/\\.css(\\?|$)/', $resource ) ) {\r\n $type = 'text/css';\r\n }\r\n\r\n// if( $type == 'text/plain' ) {\r\n// error_log( \"PLAIN: $resource\" );\r\n// }\r\n return $type; \r\n }", "function get_mime_type($path)\n{\n\t$file = trim(basename($path));\n\t//get extension\n\tif($pos=strpos($file, '.')) {\n\t\t$ext = trim(substr($file,$pos),'.');\n\t} else {\n\t\t//either no '.'' or at pos 0, no extention\n\t\treturn false;\n\t}\n\t//check system mime file for ours\n\t$mime = false;\n\tif($sys_mime = fopen('/etc/mime.types','r')) {\n\t\twhile(!$mime && ($line=fgets($sys_mime)) !== false) {\n\t\t\t$line = trim($line);\n\t\t\tif($line && $line[0]!=='#') {\n\t\t\t\t$parts = preg_split('/\\s+/', $line);\n\t\t\t\tif(count($parts) !== 1) {\n\t\t\t\t\tforeach ($parts as $extension) {\n\t\t\t\t\t\tif($extension === $ext) {\n\t\t\t\t\t\t\t$mime = $parts[0];\n\t\t\t\t\t\t\tbreak;\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\tfclose($sys_mime);\n\t}\n\treturn $mime;\n}", "public function mime() : string {\n return $this->file->type;\n }", "public function getMimeType() {\n return explode('/', $this->contentType)[0];\n }", "private static function getMIMEType(&$file) {\n\t\t$type = Util_Mime::get_mime_type($file);\n\t\treturn $type;\n\t}", "private function get_mime_type($filepath) {\n if (!file_exists($filepath) || !is_readable($filepath))\n return false;\n\n // Trying finfo\n if (function_exists('finfo_open')) {\n $finfo = finfo_open(FILEINFO_MIME);\n $mimeType = finfo_file($finfo, $filepath);\n finfo_close($finfo);\n // Mimetype can come in text/plain; charset=us-ascii form\n if (strpos($mimeType, ';'))\n list($mimeType, ) = explode(';', $mimeType);\n return $mimeType;\n }\n\n // Trying mime_content_type\n if (function_exists('mime_content_type')) {\n return mime_content_type($filepath);\n }\n\n // Trying exec\n if (function_exists('system')) {\n $mimeType = system(\"file -i -b $filepath\");\n if (!empty($mimeType))\n return $mimeType;\n }\n\n // Trying to get mimetype from images\n $imageData = @getimagesize($filepath);\n if (!empty($imageData['mime'])) {\n return $imageData['mime'];\n }\n\n return false;\n }", "private static function __getMIMEType(&$file)\n\t{\n\t\tstatic $exts = array(\n\t\t\t'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'gif' => 'image/gif',\n\t\t\t'png' => 'image/png', 'ico' => 'image/x-icon', 'pdf' => 'application/pdf',\n\t\t\t'tif' => 'image/tiff', 'tiff' => 'image/tiff', 'svg' => 'image/svg+xml',\n\t\t\t'svgz' => 'image/svg+xml', 'swf' => 'application/x-shockwave-flash', \n\t\t\t'zip' => 'application/zip', 'gz' => 'application/x-gzip',\n\t\t\t'tar' => 'application/x-tar', 'bz' => 'application/x-bzip',\n\t\t\t'bz2' => 'application/x-bzip2', 'rar' => 'application/x-rar-compressed',\n\t\t\t'exe' => 'application/x-msdownload', 'msi' => 'application/x-msdownload',\n\t\t\t'cab' => 'application/vnd.ms-cab-compressed', 'txt' => 'text/plain',\n\t\t\t'asc' => 'text/plain', 'htm' => 'text/html', 'html' => 'text/html',\n\t\t\t'css' => 'text/css', 'js' => 'text/javascript',\n\t\t\t'xml' => 'text/xml', 'xsl' => 'application/xsl+xml',\n\t\t\t'ogg' => 'application/ogg', 'mp3' => 'audio/mpeg', 'wav' => 'audio/x-wav',\n\t\t\t'avi' => 'video/x-msvideo', 'mpg' => 'video/mpeg', 'mpeg' => 'video/mpeg',\n\t\t\t'mov' => 'video/quicktime', 'flv' => 'video/x-flv', 'php' => 'text/x-php'\n\t\t);\n\n\t\t$ext = strtolower(pathinfo($file, PATHINFO_EXTENSION));\n\t\tif (isset($exts[$ext])) return $exts[$ext];\n\n\t\t// Use fileinfo if available\n\t\tif (extension_loaded('fileinfo') && isset($_ENV['MAGIC']) &&\n\t\t($finfo = finfo_open(FILEINFO_MIME, $_ENV['MAGIC'])) !== false)\n\t\t{\n\t\t\tif (($type = finfo_file($finfo, $file)) !== false)\n\t\t\t{\n\t\t\t\t// Remove the charset and grab the last content-type\n\t\t\t\t$type = explode(' ', str_replace('; charset=', ';charset=', $type));\n\t\t\t\t$type = array_pop($type);\n\t\t\t\t$type = explode(';', $type);\n\t\t\t\t$type = trim(array_shift($type));\n\t\t\t}\n\t\t\tfinfo_close($finfo);\n\t\t\tif ($type !== false && strlen($type) > 0) return $type;\n\t\t}\n\n\t\treturn 'application/octet-stream';\n\t}", "protected function getContentType() {\n\t\tforeach ( headers_list() as $header ) {\n\t\t\tif ( preg_match( '#^content-type: (\\w+/\\w+);?#i', $header, $m ) ) {\n\t\t\t\treturn $m[1];\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "static function guessMimeType($file_name) {\r\n $ext = pathinfo($file_name, PATHINFO_EXTENSION);\r\n $map = require(dirname(__FILE__) . \"/mime.types.php\");\r\n\r\n return isset($map[$ext]) ? $map[$ext] : 'application/octet-stream';\r\n }", "protected static function detectMimeType($file) {\n\t\t$mimetype = ElggFile::detectMimeType($file['tmp_name'], $file['type']);\n\n\t\t// Hack for Microsoft zipped formats\n\t\t$info = pathinfo($file['name']);\n\t\t$office_formats = array('docx', 'xlsx', 'pptx');\n\t\tif ($mimetype == \"application/zip\" && in_array($info['extension'], $office_formats)) {\n\t\t\tswitch ($info['extension']) {\n\t\t\t\tcase 'docx':\n\t\t\t\t\t$mimetype = \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'xlsx':\n\t\t\t\t\t$mimetype = \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pptx':\n\t\t\t\t\t$mimetype = \"application/vnd.openxmlformats-officedocument.presentationml.presentation\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Check for bad ppt detection\n\t\tif ($mimetype == \"application/vnd.ms-office\" && $info['extension'] == \"ppt\") {\n\t\t\t$mimetype = \"application/vnd.ms-powerpoint\";\n\t\t}\n\n\t\treturn $mimetype;\n\t}", "public function type(): ?string\n {\n if (isset($this->type)) {\n return $this->type;\n }\n if (Str::startsWith($this->mimeType(), 'image')) {\n return $this->type = 'image';\n }\n if (Str::startsWith($this->mimeType(), 'text')) {\n return $this->type = 'text';\n }\n if (Str::startsWith($this->mimeType(), 'audio')) {\n return $this->type = 'audio';\n }\n if (Str::startsWith($this->mimeType(), 'video')) {\n return $this->type = 'video';\n }\n if ($this->mimeType() === MimeType::fromExtension('pdf')) {\n return $this->type = 'pdf';\n }\n if ($this->matchExtensions(['doc', 'docx', 'odt', 'odm', 'ott'])) {\n return $this->type = 'document';\n }\n if ($this->matchExtensions(['ppt', 'pptx', 'pps', 'odp', 'otp'])) {\n return $this->type = 'presentation';\n }\n if ($this->matchExtensions(['xls', 'xlsx', 'ods', 'ots'])) {\n return $this->type = 'spreadsheet';\n }\n if ($this->matchExtensions(['gz', '7z', 'bz2', 'rar', 'tar', 'zip'])) {\n return $this->type = 'archive';\n }\n return null;\n }", "public function getMimeType()\n {\n return CFileHelper::getMimeType($this->file->getTempName());\n }", "private function getFileType()\n {\n $uriString = $this->uri->getPath();\n\n if (substr($uriString, strlen($uriString) - 1) == \"/\") {\n return 'html';\n }\n\n $pathParts = pathinfo($uriString);\n\n if (!array_key_exists('extension', $pathParts)) {\n return 'html';\n } else {\n $extension = $pathParts['extension'];\n if ($extension === \"\") {\n return 'html';\n } else {\n // @todo if ? and # are set this function will not work correct\n $pos = max((int)strpos($extension, \"?\"), (int)strpos($extension, \"#\"));\n if ($pos === 0) {\n $pos = strlen($extension);\n }\n return substr($extension, 0, $pos);\n }\n }\n }", "public function getMimeType()\r\n {\r\n $this->caseClosedOrFail();\r\n\r\n return $this->mime;\r\n }", "public function getMIMEType()\n {\n return $this->mimetype;\n }", "public function getType() {\n if (!isset($_FILES[$this->_file])) {\n return false;\n }\n \n return $_FILES[$this->_file]['type'];\n }", "public function getMimeType()\r\n {\r\n if (array_key_exists($this->getExtension(), $this->fileTypes)) {\r\n return $this->fileTypes[$this->getExtension()]['type'];\r\n }\r\n\r\n return 'application/octet-stream';\r\n }", "public function getMimeType(){\n return (new \\finfo())->buffer($this->getContent(), FILEINFO_MIME_TYPE);\n }", "public function getTemplateType() : string\r\n {\r\n // After adding HEIC files, we also need to exclude them \r\n // from being displayed like regular images. \r\n $validImgMime = array(\r\n 'image/bmp',\r\n 'image/gif',\r\n 'image/jpg',\r\n 'image/jpeg',\r\n 'image/png',\r\n 'image/tiff'\r\n );\r\n\r\n $fileType = explode('/', $this->mime_type, 2)[0];\r\n if($fileType == 'image' && !in_array($this->mime_type, $validImgMime))\r\n {\r\n $fileType = 'file';\r\n }\r\n else if(!in_array($fileType, array('image', 'audio', 'video')))\r\n {\r\n $fileType = 'file';\r\n }\r\n return $fileType;\r\n }", "private function getType(UploadedFile $file)\n {\n $mime = $file->getMimeType();\n\n return $mime ? explode('/', $mime)[0] : 'n/a';\n }", "public function getFileType() {\n return $this->type;\n }", "private function _getFileMimeType($file)\n {\n return mime_content_type($file);\n }", "function verifyMimeType( $pFile ) {\n\t\t$mime = NULL;\n\t\tif( file_exists( $pFile ) ) {\n\t\t\tif( function_exists( 'finfo_open' ) ) {\n\t\t\t\tif( is_windows() && defined( 'PHP_MAGIC_PATH' ) && is_readable( PHP_MAGIC_PATH )) {\n\t\t\t\t\t$finfo = finfo_open( FILEINFO_MIME, PHP_MAGIC_PATH );\n\t\t\t\t} else {\n\t\t\t\t\t$finfo = finfo_open( FILEINFO_MIME );\n\t\t\t\t}\n\t\t\t\t$mime = finfo_file( $finfo, $pFile );\n\t\t\t\tfinfo_close( $finfo );\n\t\t\t} else {\n\t\t\t\tif( function_enabled( \"escapeshellarg\" ) && function_enabled( \"exec\" )) {\n\t\t\t\t\t$mime = exec( trim( 'file -bi ' . escapeshellarg( $pFile )));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif( empty( $mime ) ) {\n\t\t\t\t$mime = $this->lookupMimeType( substr( $pFile, strrpos( $pFile, '.' ) + 1 ) );\n\t\t\t}\n\t\t\tif( $len = strpos( $mime, ';' )) {\n\t\t\t\t$mime = substr( $mime, 0, $len );\n\t\t\t}\n\t\t}\n\t\treturn $mime;\n\t}", "function getmimetype($path){\n\t$extension = getextension($path);\n $filetype = getfiletype($path);\n if ($filetype != null){\n return $_ENV['MIME_TYPES'][$filetype][$extension];\n } else {\n return 'text/plain';\n }\n}", "public function guessContentType($magic_file, $magic_mode = null) {}", "static function get_mime_type( $data, $type = '' )\n\t{\n $data = str_replace( chr(0), '', $data ); // Clean input of null bytes\n\t\tif( ! empty( $data ) && @file_exists( $data )){\n\t\t\t$type = mime_content_type( $data );\n\t\t}elseif( function_exists('finfo_open' ) ){\n\t\t\t$finfo = finfo_open(FILEINFO_MIME_TYPE);\n\t\t\t$type = finfo_buffer($finfo, $data);\n\t\t\tfinfo_close($finfo);\n\t\t}\n\t\treturn $type;\n\t}", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public function getMimeType();", "public static function detectMimeType($content)\n\t{\n\t\t$mime_type = null;\n\n\t\tif(function_exists('finfo_file')) { // Test if finfo extention is present.\n\t\t\t$finfo = finfo_open(FILEINFO_MIME);\n\n\t\t\tif(is_file($content)) // Test if content is a file name.\n\t\t\t{\n\t\t\t\t$mime_type = finfo_file($finfo, $content);\n\t\t\t}\n\t\t\telse // Test if content is a file name.\n\t\t\t{\n\t\t\t\t$mime_type = finfo_buffer($finfo, $content);\n\t\t\t} // Test if content is a file name.\n\n\t\t\tfinfo_close($finfo);\n\t\t}\n\t\telse // Test if finfo extention is present.\n\t\t{\n\n\t\t\tif(is_file($content)) // Test if content is a file name.\n\t\t\t{\n\t\t\t\t$mime_type = mime_content_type($content);\n\t\t\t}\n\t\t\telse // Test if content is a file name.\n\t\t\t{\n\t\t\t\t// We create a temporary file to detect MIME type.\n\t\t\t\t$mime_temp_file = tempnam(sys_get_temp_dir(), \"ecd_\") . \"\";\n\t\t\t\tfile_put_contents($mime_temp_file, $content);\n\n\t\t\t\t$mime_type = mime_content_type($mime_temp_file);\n\n\t\t\t\tunlink($mime_temp_file);\n\t\t\t} // Test if content is a file name.\n\n\t\t} // Test if finfo extention is present.\n\n\t\treturn $mime_type;\n\t}", "public function getMimeType()\n {\n return $this->mime_type;\n }", "public function getMimeType()\n {\n return $this->mime_type;\n }", "public function getMimeType()\n {\n return $this->mime_type;\n }", "public function getMimeType(): string\n {\n return $this->filesystem->mimeType(\n $this->resource->getPath()\n ) ?: 'application/octet-stream';\n }", "public function getFileType()\n {\n return $this->fileType;\n }", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public function getMimeType() {}", "public static function guessContentType($magic_file, $magic_mode = null) {}", "public function provider_mime_type() {\n\t\treturn array(\n\t\t\tarray( 'not-found.txt', false ),\n\t\t\tarray( 'empty.txt', version_compare( PHP_VERSION, '7.4', '>=' ) ? 'application/x-empty' : 'inode/x-empty' ),\n\t\t\tarray( 'file.aac', 'audio/aac' ),\n\t\t\tarray( 'file.css', 'text/css' ),\n\t\t\tarray( 'file.csv', 'text/plain' ),\n\t\t\tarray( 'file.flac', 'audio/flac' ),\n\t\t\tarray( 'file.gif', 'image/gif' ),\n\t\t\tarray( 'file.htm', 'text/html' ),\n\t\t\tarray( 'file.html', 'text/html' ),\n\t\t\tarray( 'file.jpe', 'image/jpeg' ),\n\t\t\tarray( 'file.jpeg', 'image/jpeg' ),\n\t\t\tarray( 'file.jpg', 'image/jpeg' ),\n\t\t\tarray( 'file.js', 'application/javascript' ),\n\t\t\tarray( 'file.m4a', 'audio/m4a' ),\n\t\t\tarray( 'file.mp3', 'audio/mpeg' ),\n\t\t\tarray( 'file.png', 'image/png' ),\n\t\t\tarray( 'file.svg', 'image/svg+xml' ),\n\t\t\tarray( 'file.txt', 'text/plain' ),\n\t\t\tarray( 'file.wav', 'audio/wav' ),\n\t\t\tarray( 'file.xml', 'application/xml' ),\n\t\t\tarray( 'no-extension-text', 'text/plain' ),\n\t\t\tarray( 'no-extension-media', 'application/octet-stream' ),\n\t\t\tarray( 'upper-case.JPG', 'image/jpeg' ),\n\t\t);\n\t}", "function get_file_type_from_mimetype($mimetype)\n{\n return explode('/', $mimetype)[1];\n}", "function getTypeMime () {\n if ($this->thumbToolkit == null) {\n return '';\n }\n return $this->thumbToolkit->getTypeMime();\n }", "function fn_get_file_type($filename, $not_available_result = 'application/octet-stream')\n{\n $file_type = $not_available_result;\n\n $types = fn_get_ext_mime_types('ext');\n\n $ext = fn_strtolower(fn_get_file_ext($filename));\n\n if (!empty($types[$ext])) {\n $file_type = $types[$ext];\n }\n\n return $file_type;\n}", "public function getMimeType()\n {\n $header = $this->getMimeTypes();\n $contentType = $header[0];\n return $contentType;\n }", "public function getContentType()\n {\n $result = $this->getHeader('Content-Type');\n\n return $result ? $result[0] : null;\n }", "public static function getContentType($file_name)\n {\n $file_extension = strtolower(substr(strrchr($file_name, '.'), 1));\n switch($file_extension) {\n case \"gif\": return \"image/gif\";\n case \"png\": return \"image/png\";\n case \"jpeg\":\n case \"jpg\": return \"image/jpg\";\n case \"css\": return \"text/css\";\n case \"js\": return \"application/javascript\";\n case \"pdf\": return \"application/pdf\";\n default:\n }\n return false;\n }", "public static function mimeType($_path)\r\n {\r\n return finfo_file(finfo_open(FILEINFO_MIME_TYPE), $_path);\r\n }", "private function getNewResourceMimeType(\r\n\t\t\t$wp) {\r\n\t\t// $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension\r\n\t\t// $fileMimeType finfo_file($finfo, $_FILES[\"file1\"][\"name\"]);\r\n\t\t// finfo_close($finfo);\r\n\t\t$filetype = wp_check_filetype ( $_FILES [\"file1\"] [\"name\"] );\r\n\t\treturn $filetype ['type'];\r\n\t}", "public function getMimeTypeDetector()\n {\n if (null === $this->mimeTypeDetector) {\n $this->setMimeTypeDetector(new FileinfoDetector());\n }\n\n return $this->mimeTypeDetector;\n }", "private function get_mime_type( $object_key = null )\n\t{\n\t\tif ( is_null($object_key) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Need to make a head request to get the object metadata.\n\t\t// Mime type not returned by Finder.\n\t\t$head = $this->client->headObject( array(\n\t\t\t'Bucket' => $this->data['bucket'],\n\t\t\t'Key' => $object_key,\n\t\t));\n\n\t\t// Check for a valid response from the headObject request.\n\t\tif( $body = $head->toArray() ) {\n\t\t\treturn $body['ContentType'];\n\t\t\t// $file_data['mime_type'] = $body['ContentType'];\n\t\t\t// $mime_type_parts = explode('/', $body['ContentType']);\n\t\t\t// $file_data['is_image'] = strtolower(reset($mime_type_parts)) === 'image' ? 'true' : 'false';\n\t\t} else {\n\t\t\treturn null;\n\t\t\t// $mime_type = null;\n\t\t\t// $file_data['is_image'] = false;\n\t\t}\n\t}", "public function getFileType() {\n\n return $this->fileType;\n }", "public static function getMimeType($file) {\n\t\t$extension = strtolower(substr(strrchr($file, '.'), 1));\n\t\t\n\t\t$mimes = load_config('mimes', array());\n\t\t\n\t\tif (array_key_exists($extension, $mimes)) {\n\t\t\tif (is_array($mimes[$extension])) {\n\t\t\t\t// Multiple mime types, just give the first one\n\t\t\t\treturn current($mimes[$extension]);\n\t\t\t} else {\n\t\t\t\treturn $mimes[$extension];\n\t\t\t}\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t}", "public function fileMimeType($path)\n {\n $type = $this->findType(strtolower(pathinfo($path, PATHINFO_EXTENSION)));\n if (!empty($type)) {\n return $type;\n }\n\n return 'unknown/type';\n }", "function system_guess_mime($filename)\n{\n $mime_map = system_mime_map();\n $ext = pathinfo($filename,PATHINFO_EXTENSION);\n return array_search($ext,$mime_map);\n}", "function get_file_format($file) {\n if(function_exists('finfo_open')) {\n $file_info = finfo_open(FILEINFO_MIME_TYPE);\n $mime_type = finfo_file($file_info, $file);\n finfo_close($file_info);\n if($mime_type) {\n return $mime_type;\n }\n }\n\n if(function_exists('mime_content_type')) {\n if($mime_type = @mime_content_type($file)) {\n return $mime_type;\n }\n }\n\n if($extension = get_file_extension($file)) {\n switch($extension) {\n case 'js' :\n return 'application/x-javascript';\n case 'json' :\n return 'application/json';\n case 'jpg' :\n case 'jpeg' :\n case 'jpe' :\n return 'image/jpg';\n case 'png' :\n case 'gif' :\n case 'bmp' :\n case 'tiff' :\n return 'image/'.$extension;\n case 'css' :\n return 'text/css';\n case 'xml' :\n return 'application/xml';\n case 'doc' :\n case 'docx' :\n return 'application/msword';\n case 'xls' :\n case 'xlt' :\n case 'xlm' :\n case 'xld' :\n case 'xla' :\n case 'xlc' :\n case 'xlw' :\n case 'xll' :\n return 'application/vnd.ms-excel';\n case 'ppt' :\n case 'pps' :\n return 'application/vnd.ms-powerpoint';\n case 'rtf' :\n return 'application/rtf';\n case 'pdf' :\n return 'application/pdf';\n case 'html' :\n case 'htm' :\n case 'php' :\n return 'text/html';\n case 'txt' :\n return 'text/plain';\n case 'mpeg' :\n case 'mpg' :\n case 'mpe' :\n return 'video/mpeg';\n case 'mp3' :\n return 'audio/mpeg3';\n case 'wav' :\n return 'audio/wav';\n case 'aiff' :\n case 'aif' :\n return 'audio/aiff';\n case 'avi' :\n return 'video/msvideo';\n case 'wmv' :\n return 'video/x-ms-wmv';\n case 'mov' :\n return 'video/quicktime';\n case 'zip' :\n return 'application/zip';\n case 'tar' :\n return 'application/x-tar';\n case 'swf' :\n return 'application/x-shockwave-flash';\n default:\n return 'unknown/'.trim($extension,'.');\n }\n }\n return false;\n}", "public function mimeType(): string\n {\n return $this->mimeType ??= FileSystem::mimeType($this->path);\n }", "function getMimeType() ;", "public function getExtension(){\n $guesser = \"\\Symfony\\Component\\Mime\\MimeTypes\";\n if (class_exists($guesser) !== false) {\n /** @var Symfony\\Component\\Mime\\MimeTypes $guesser */\n $extensions = $guesser::getDefault()->getExtensions($this->getMimeType());\n return $extensions[0] ?? null;\n }\n\n $deprecated_guesser = \"\\Symfony\\Component\\HttpFoundation\\File\\MimeType\\ExtensionGuesser\";\n if (class_exists($deprecated_guesser) !== false){\n /** @var \\Symfony\\Component\\HttpFoundation\\File\\MimeType\\ExtensionGuesser $deprecated_guesser */\n return $deprecated_guesser::getInstance()->guess($this->getMimeType());\n }\n\n return null;\n }", "public static function getMimeType($file) {\n $ext = pathinfo($file, PATHINFO_EXTENSION);\n if (isset(self::$extToMime[$ext])) {\n return self::$extToMime[$ext];\n } else {\n $finfo = new finfo(FILEINFO_MIME_TYPE);\n return $finfo->file($file);\n }\n }", "public function getMime(): string|null\n {\n return $this->mime;\n }", "function get_mimetype($name) {\n\t// We're only allowing archives.\n\tif (!substr_count($_FILES[$name]['name'],'.tar.gz') &&\n\t\t!substr_count($_FILES[$name]['name'],'.tgz') &&\n\t\t!substr_count($_FILES[$name]['name'],'.zip')) {\n\n\t\treturn FALSE;\n\t}\n\n\tif (substr_count($_FILES[$name]['name'],'.tar.gz') ||\n\t\tsubstr_count($_FILES[$name]['name'],'.tgz')) {\n\n\t\treturn 'application/x-gzip';\n\t} else {\n\t\treturn 'application/zip';\n\t}\n}", "public static function getMimeType( $file ) {\n $finfo = finfo_open(FILEINFO_MIME_TYPE);\n $mimetype = finfo_file($finfo, $file);\n finfo_close($finfo);\n return $mimetype;\n }", "public function getContentType()\n {\n return $this->mediaFile->getContentType();\n }", "public static function detectMime( string $path ) : string {\n\t\t$ext = \\pathinfo( $path, \\PATHINFO_EXTENSION ) ?? '';\n\t\t\n\t\t// Simpler text types\n\t\tswitch( \\strtolower( $ext ) ) {\n\t\t\tcase 'txt':\n\t\t\t\treturn 'text/plain';\n\t\t\t\t\n\t\t\tcase 'css':\n\t\t\t\treturn 'text/css';\n\t\t\t\t\n\t\t\tcase 'js':\n\t\t\t\treturn 'text/javascript';\n\t\t\t\t\n\t\t\tcase 'svg':\n\t\t\t\treturn 'image/svg+xml';\n\t\t\t\t\n\t\t\tcase 'vtt':\n\t\t\t\treturn 'text/vtt';\n\t\t}\n\t\t\n\t\t// Intercept potential mime warning as error\n\t\t\\set_error_handler( function( \n\t\t\t$eno, $emsg, $efile, $eline \n\t\t) use ( $path ) {\n\t\t\t$str\t= \n\t\t\t'Unable to detect mime of ' . $path . ' ' . \n\t\t\t'Message: {msg} File: {file} Line: {line}';\n\t\t\tlogException( \n\t\t\t\tnew \\ErrorException( \n\t\t\t\t\t$emsg, 0, $eno, $efile, $eline \n\t\t\t\t), $str \n\t\t\t);\n\t\t}, E_WARNING );\n\t\t\n\t\t// Detect other mime types\n\t\t$mime = \\mime_content_type( $path );\n\t\t\n\t\t\\restore_error_handler();\n\t\t\n\t\t\n\t\treturn \\strtolower( $mime );\n\t}" ]
[ "0.7940607", "0.76699597", "0.7559069", "0.74096936", "0.7395556", "0.73367757", "0.72435385", "0.72203726", "0.71776974", "0.7175969", "0.71661997", "0.7162659", "0.71540016", "0.71534836", "0.7137104", "0.70945907", "0.70916563", "0.70895606", "0.708719", "0.7058984", "0.7057018", "0.7036404", "0.7016598", "0.70074445", "0.7007337", "0.69834876", "0.6982607", "0.69784635", "0.69782734", "0.69634145", "0.69540477", "0.6948988", "0.6947854", "0.69311625", "0.6929731", "0.6927005", "0.69243985", "0.6915455", "0.6904239", "0.68994635", "0.68881214", "0.68803793", "0.6878116", "0.68773794", "0.6859461", "0.68573886", "0.6844491", "0.68379563", "0.6835478", "0.68288696", "0.6818021", "0.6816307", "0.68120766", "0.68055564", "0.68042445", "0.6800969", "0.6799314", "0.6790131", "0.6789629", "0.6772814", "0.6772814", "0.6772814", "0.6772814", "0.6772814", "0.67498755", "0.6740775", "0.6740775", "0.6740775", "0.67206097", "0.6717214", "0.67150766", "0.67150766", "0.67150766", "0.67150766", "0.6707179", "0.66917884", "0.66910416", "0.66811377", "0.667849", "0.66774756", "0.6673625", "0.6673526", "0.6667546", "0.6664204", "0.66628355", "0.66578203", "0.6656336", "0.6655342", "0.665299", "0.6652305", "0.6646132", "0.66418546", "0.6640431", "0.6639692", "0.6629463", "0.662415", "0.6622868", "0.66054225", "0.65938216", "0.6569771" ]
0.7337965
5
Change name of file before moving it to target location.
public function Rename($NewName) { $this->Name= $this->SanitizeFilename($NewName); return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_file_name($new_name = '') {\r\n\t\tif ($this->rename_file) {\r\n\t\t\tif ($this->the_file == '') return;\r\n\t\t\t$name = ($new_name == '') ? strtotime('now') : $new_name;\r\n\t\t\tsleep(3);\r\n\t\t\t$name = $name.$this->get_extension($this->the_file);\r\n\t\t} else {\r\n\t\t\t$name = str_replace(' ', '_', $this->the_file); // space will result in problems on linux systems\r\n\t\t}\r\n\t\treturn $name;\r\n\t}", "public function rename($file, $new_file);", "function setName( $newName )\r\n\t{\r\n\t\t$basePath = dirname( $this->path );\r\n\t\tif(rename( $this->path, $basePath.'/'.$newName ))\r\n\t\t{\r\n\t\t\t$this->path = $basePath.'/'.$newName;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"Não foi possível renomear a pasta \" . $this->path);\r\n\t\t}\r\n\t}", "abstract function rename($old_file, $new_file, $move = FALSE);", "public static function renamefile()\n\t{\n\t\tglobal $g_dir;\n\t\t$filetorename = $_POST['fileToRename'];\n\t\t$newfilename = $_POST['newRenamedFileName'];\n\n\t\t//$dir= '/var/www/html/UPLOADS/';\n\n\t\tif(rename($g_dir.$filetorename, $g_dir.$newfilename))\n\t\t\techo(\"Successfully renamed $filetorename to $newfilename!\");\n\t\telse\n\t\t\techo(\"ERROR: Could not rename $filetorename to $newfilename!\");\n\t}", "public function rename($source, $target)\n {\n \n }", "public static function move($_path, $_target)\r\n {\r\n return rename($_path, $_target);\r\n }", "function renameFile( $file )\n {\n $ext = $this->getExt( $file ); //\tRetorna extensão do arquivo\n $file_tmp = explode( \".\", $file ); //\tNome do arquivo, sem extensao\n $file_tmp = array_slice( $file_tmp, 0, sizeof( $file_tmp ) - 1 );\n $file_tmp = implode( \".\", $file_tmp );\n\t\t$file_tmp = substr( $file_tmp, 0, 15 );\n\n do {\n \t\n $file_tmp = str_replace( array( '=', '+', '/', '*' ), \"\", base64_encode( date( \"Hisu\" ) . $file_tmp ) );\n// print $file_tmp . \"<br />\";\n \n } while( file_exists( $this->path . $file_tmp . \".\" . $ext ) );\n \n $this->name = $file_tmp . \".\" . $ext;\n //\tatualiza o nome no LOG\n $this->source[ \"name\" ] = $this->name;\n \n return $this->name;\n }", "public function rename($newname);", "public function moveFile($filename, $key);", "protected function onMove(){\n\t\tif (empty($this->post['directory']) || empty($this->post['file'])) return;\n\t\t\n\t\t$rename = empty($this->post['newDirectory']) && !empty($this->post['name']);\n\t\t$dir = $this->getDir($this->post['directory']);\n\t\t$file = realpath($dir . '/' . $this->post['file']);\n\t\t\n\t\t$is_dir = is_dir($file);\n\t\tif (!$this->checkFile($file) || (!$rename && $is_dir))\n\t\t\treturn;\n\t\t\n\t\tif ($rename || $is_dir){\n\t\t\tif (empty($this->post['name'])) return;\n\t\t\t$newname = $this->getName($this->post['name'], $dir);\n\t\t\t$fn = 'rename';\n\t\t}else{\n\t\t\t$newname = $this->getName(pathinfo($file, PATHINFO_FILENAME), $this->getDir($this->post['newDirectory']));\n\t\t\t$fn = !empty($this->post['copy']) ? 'copy' : 'rename';\n\t\t}\n\t\t\n\t\tif (!$newname) return;\n\t\t\n\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\t\tif ($ext) $newname .= '.' . $ext;\n\t\t$fn($file, $newname);\n\t\t\n\t\techo json_encode(array(\n\t\t\t'name' => pathinfo($this->normalize($newname), PATHINFO_BASENAME),\n\t\t));\n\t}", "public function rename($name){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\t$this->path = $newPath;\n\t\trename($oldPath, $newPath);\n\t}", "public function testRename()\n {\n $oldFilename = static::$baseFile . '/fs/tmp.txt';\n $newFilename = static::$baseFile . '/fs/test/tmp.txt';\n\n file_put_contents($oldFilename, 'It works!');\n\n $this->assertTrue(rename($oldFilename, $newFilename));\n\n $this->assertFalse(file_exists($oldFilename));\n $this->assertTrue(file_exists($newFilename));\n }", "private function setFileName() {\n $FileName = Uteis::Name($this->Name) . strrchr($this->File->name, '.');\n if (file_exists(self::$BaseDir . $this->Send . $FileName)):\n $FileName = Uteis::Name($this->Name) . '-' . time() . strrchr($this->File->name, '.');\n endif;\n $this->Name = $FileName;\n }", "public function rename($source, $destination);", "public function setNameAfterUploaded($name) {\n $this->_newName = $name;\n }", "public function rename($name, $new_name);", "function gttn_tpps_rename_file($fid, $new_name, array $options = array()) {\n if (!array_key_exists('preserve', $options)) {\n $options['preserve'] = FALSE;\n }\n\n if (!empty($fid) and ($file = file_load($fid))) {\n $new_filename = $new_name . \".\" . gttn_tpps_get_path_extension($file->uri);\n if (!preg_match('/^(.*\\/)(.*)$/', $new_name, $matches)) {\n preg_match('/^(.*\\/).*$/', $file->uri, $matches);\n $new_filename = $matches[1] . $new_filename;\n }\n\n if ($options['preserve']) {\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n return file_copy($file, $new_filename);\n }\n return file_move($file, $new_filename);\n }\n throw new Exception(\"Error: could not open file\");\n}", "private function setNameFil($newNameFile)\n\t {\n\t $this->nameFile = $newNameFile;\n\t }", "public function moveFile($oldPath, $newPath, $filename)\n {\n // TODO: Implement moveFile() method.\n }", "public function rename($new_name) {\n\t\t$new_path = $this->getParentDirectory()->getPath().DIRECTORY_SEPARATOR.$new_name;\n\t\tif (!rename($this->getPath(), $new_path)) throw new \\Exception(\"Couldn't rename the file $this to $new_path\");\n\t\t$this->path = $new_path;\n\t}", "public function rename_plugin_file( $file ) {\n\t\tif ( is_dir( $file ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->is_code_file( $file ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only when the file is the kickstart file.\n\t\tif ( 'wpkickstart.php' === basename( $file ) ) {\n\t\t\t$dir = untrailingslashit( dirname( $file ) );\n\n\t\t\t$slug = $this->slugify( $this->cli_args->get_arg( 'name' ) );\n\n\t\t\tif ( ! $this->dryrun ) {\n\t\t\t\t$this->fs->move( $file, \"{$dir}/{$slug}.php\" );\n\t\t\t}\n\t\t}\n\t}", "public function moveUploadedFile($filename, $key);", "public function rename_file( string $old_name, string $new_name ): void {\n\t\t$blob_client = $this->get_blob_client();\n\t\t$container_name = $this->get_container_name();\n\n\t\t$blob_client->copyBlob( $container_name, $new_name, $container_name, $old_name );\n\t\t$blob_client->deleteBlob( $container_name, $old_name );\n\t}", "private function moveFile($old_file, $new_file)\n {\n if (!file_exists($old_file)) {\n return;\n }\n\n if (!is_dir(dirname($new_file))) {\n mkdir(dirname($new_file), 0755, true);\n }\n\n // move the file to the archive folder\n rename($old_file, $new_file);\n }", "public function setTargetFileName($value)\n {\n $this->targetFileName = strval(trim($value));\n }", "public function move($from, $to)\n\t{\n\t\trename($from, $this->base_location . \"/\" . $to);\n\t}", "public function move($sDestinationFileName);", "function _moveFile($sourceDir, $destDir, $filename) {\n\t\t$currentFilePath = $sourceDir . DIRECTORY_SEPARATOR . $filename;\n\t\t$destinationPath = $destDir . DIRECTORY_SEPARATOR . $filename;\n\n\t\tif (!rename($currentFilePath, $destinationPath)) {\n\t\t\t$message = __('admin.fileLoader.moveFileFailed', array('filename' => $filename,\n\t\t\t\t'currentFilePath' => $currentFilePath, 'destinationPath' => $destinationPath));\n\t\t\t$this->addExecutionLogEntry($message, SCHEDULED_TASK_MESSAGE_TYPE_ERROR);\n\n\t\t\t// Script should always stop if it can't manipulate files inside\n\t\t\t// its own directory system.\n\t\t\tfatalError($message);\n\t\t}\n\n\t\treturn $destinationPath;\n\t}", "public function setName($name)\n {\n $this->file['name'] = (string) $name;\n }", "function PclZipUtilRename($p_src, $p_dest)\n {\n }", "function rename($old, $new = null) {\n \n if (!$new) {\n $new = $old;\n \t$old = $this->_file;\n }\n \n if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && (strtolower($old) == strtolower($new))) {\n \n $rand = sprintf('%s%s%s%s%s',\n dirname($old),\n DIRECTORY_SEPARATOR,\n microtime(),\n rand(1, 999),\n basename($old)\n );\n \n if (!@rename($old, $rand)) {\n Fire_Error::throwError(sprintf('Failed to temporary rename \"%s\".',\n $old\n ), __FILE__, __LINE__\n );\n }\n $old = $rand;\n }\n \n if (!@rename($old, $new)) {\n Fire_Error::throwError(sprintf('Failed to rename \"%s\" to \"%s\".',\n $old,\n $new\n ), __FILE__, __LINE__\n );\n } \n }", "public function rename($targetPath, $handlerObj = NULL, $handlerMethod = NULL) {\n $this->fileService->renameFile( $this->path, $targetPath, $handlerObj, $handlerMethod );\n }", "function rename($file)\r\n {\r\n if(!empty($_POST['rename']))\r\n {\r\n if(rename($_POST['file'],$_POST['rename']));\r\n return 1;return 0;\r\n }\r\n }", "public function rename($path, $newpath)\n {\n }", "public function rename(Storable $storable, string $newName): void;", "public static function rename($filename) {\n\t\t$info = pathinfo ( $filename );\n\t\t$dirname = $info ['dirname'];\n\t\t$lastname = $info ['filename'] . time ();\n\t\t$extension = $info ['extension'];\n\t\treturn $dirname . $lastname . \".\" . $extension;\n\t}", "public static function move($path, $target)\n\t{\n\t\treturn rename($path, $target);\n\t}", "public function renameIfExists(UploadedFile $file)\n {\n if ($this->getStorage()->exists(\"{$this->getDirectory()}/$this->name\")) {\n $this->name = $this->generateUniqueName($file);\n }\n }", "private function renameFile($source, $target)\n {\n if (false === @rename($source, $target)) {\n if (defined('PHP_WINDOWS_VERSION_BUILD')) {\n if (false === copy($source, $target)) {\n throw new \\RuntimeException(sprintf('(WIN) Could not write new cache file to %s.', $target));\n }\n if (false === unlink($source)) {\n throw new \\RuntimeException(sprintf('(WIN) Could not delete temp cache file to %s.', $source));\n }\n } else {\n throw new \\RuntimeException(sprintf('Could not write new cache file to %s.', $target));\n }\n }\n }", "function getTargetFileName() ;", "public function rename(string $newName): void\n {\n if ( ! $this->exists() ) {\n $this->filename = $newName;\n return;\n }\n\n if ( false !== strpos(str_replace('\\\\', '/', $newName), '/') ) {\n throw new FileSystemException('newName parameter can not contain slashes');\n }\n\n $done = rename($this->directory->getPath().'/'.$this->filename, $this->directory->getPath().'/'.$newName);\n\n if ( ! $done ) {\n throw new FileSystemException('renaming failed, probably due to access issues');\n }\n\n $this->filename = $newName;\n }", "public function covers_rename(): void\n {\n $response = $this->check_request('Rename cover');\n if (!$response) {\n $original = input_request('original');\n $newname = input_request('newname');\n if (file_exists(folder_covers() . $newname)) {\n $response = $this->get_response(true,\n 'Cannot rename, file exists');\n $this->log_error(\"Cover rename $original -> $newname EXISTS\");\n } else {\n $result = rename(folder_covers() . $original,\n folder_covers() . $newname);\n if ($result) {\n $response = $this->get_response(false, 'Cover renamed');\n $this->log_info(\"Cover rename $original -> $newname\");\n } else {\n $response = $this->get_response(true, 'Rename failed');\n $this->log_error(\n \"Cover rename $original -> $newname FAILED\");\n }\n }\n }\n exit(json_encode($response));\n }", "function SetFileName(){\n\t\t$this->FindRootFile();\n\t\t$this->BookLink = $_SERVER['DOCUMENT_ROOT'].'/'.$this->BookLink.'/'.$this->RootFile;\n\t}", "public static function rename($source, $newName)\r\n {\r\n if (file_exists($source)) {\r\n rename($source, $newName);\r\n }\r\n }", "function move_file($name)\n{\n $old_file = __DIR__ . '/xml_schemas/' . $name . '.xml';\n $new_file = Path::get_repository_path() . 'lib/content_object/' . $name . '/install/' . $name . '.xml';\n Filesystem::copy_file($old_file, $new_file);\n return $new_file;\n}", "function narrative_move_files($current_narrative_dir, $new_narrative_dir)\n{\n $file_scan = scandir($current_narrative_dir);\n foreach ($file_scan as $filecheck)\n {\n if ($filecheck != '.' && $filecheck != '..' && !is_dir($current_narrative_dir . $filecheck))\n {\n rename($current_narrative_dir . $filecheck, $new_narrative_dir . $filecheck);\n }\n }\n}", "public static function move($path, $target)\n {\n return rename($path, $target);\n }", "function _stageFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_stagePath, $this->_claimedFilename);\n\t}", "function move($src, $dest)\n\t{\n\t\treturn rename($src, $dest);\n\t}", "public function moveToTmpDir()\n\t{\n\t\tif($this->source instanceof UploadedFile) {\n\t\t\t$this->source->move($this->getTmpDir()->getRootPath());\n\t\t} else if(is_string($this->source)) {\n\t\t\tcopy($this->params['path'], $this->getTmpDir()->getRootPath() . '/' . $this->params['name']);\n\t\t}\n\t}", "public function getTargetFileName() {}", "public static function rename_file($from,$to){\n\t\tif(rename($from,$to)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function swapFiles() {\r\n\t\tglobal $file;\r\n\r\n\t\trename($file, $file.\".tmp\");\r\n\t\trename($file.\".bak\", $file);\r\n\t\trename($file.\".tmp\", $file.\".bak\");\r\n\t}", "public function setFileName($file);", "function name_update($name){\r\n $this->check(); // first check\r\n unlink(sys_get_temp_dir().\"/$this->file_name\");\r\n $this->init($name);\r\n }", "public function copy($name){\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\tcopy($this->path, $newPath);\n\t}", "public function move($path){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$fileName = $path_array[sizeof($path_array) - 1];\n\t\t$newPath = $path . self::DS . $fileName;\n\t\t$this->path = $newPath;\n\t\t$this->createFile($newPath);\n\t\tunlink($oldPath);\n\t}", "private function setFileName(){\n if($this->customFileName !== ''){\n $prefix = $this->customFileName.'_';\n $this->finalFileName = uniqid($prefix).'.'.$this->fileExt;\n }else{\n $this->finalFileName = basename($this->fileName, \".\".$this->fileExt ).md5(microtime()).'.'.$this->fileExt;\n } \n }", "public function rename($basename) {\n\t\tforeach($this->extras() as $extra) {\n\t\t\t$extra->filename(); // init\n\t\t}\n\t\t$basename = $this->pagefiles->cleanBasename($basename, true); \n\t\tif($this->wire('files')->rename($this->filename, $this->pagefiles->path . $basename, true)) {\n\t\t\t$this->set('basename', $basename); \n\t\t\t$basename = $this->basename();\n\t\t\tforeach($this->extras() as $extra) {\n\t\t\t\t$extra->rename();\n\t\t\t}\n\t\t\treturn $basename;\n\t\t}\n\t\treturn false; \n\t}", "function __moveUploadedFile($source, $destination) {\r\n\t\tif (!Configure::read('Documents.isTesting')) {\r\n\t\t\treturn move_uploaded_file($source, $destination);\r\n\t\t} else {\r\n\t\t\treturn rename($source, $destination);\r\n\t\t}\r\n\r\n\t}", "protected function checkName($file) {\n $this->_newName = null;\n $unwantedArray = [' ', '-']; # replace spaces, hyphens\n foreach ($unwantedArray as $remove) {\n $nospaces = str_replace($remove, '_', $file['name']);\n }\n if ($nospaces != $file['name']) {\n $this->_newName = $nospaces;\n }\n $extension = pathinfo($nospaces, PATHINFO_EXTENSION);\n if (!$this->_typeCheckingOn && !empty($this->_suffix)) {\n if (in_array($extension, $this->_notTrusted) || empty($extension)) {\n $this->_newName = $nospaces . $this->_suffix;\n }\n }\n if ($this->_renameDuplicates) {\n $name = isset($this->_newName) ? $this->_newName : $file['name'];\n $existing = scandir($this->_destination);\n if (in_array($name, $existing)) {\n // rename file\n $basename = pathinfo($name, PATHINFO_FILENAME);\n $extension = pathinfo($name, PATHINFO_EXTENSION);\n $i = 1;\n do {\n $this->_newName = $basename . '_' . $i++;\n if (!empty($extension)) {\n $this->_newName .= \".$extension\";\n }\n } while (in_array($this->_newName, $existing));\n }\n }\n }", "private function _set_movie_name($file_name){\n\t\t\n\t\t$this->movie_name = preg_replace('/(\\_|\\.|\\-|\\[|\\]|\\(|\\)|\\{|\\})/', ' ', $file_name);\n\t\t\n\t\tforeach($this->remove_from_title as $key => $patern){\n\t\t\t$this->remove_from_title[$key] = '/(\\s'.$patern.'\\s)/i';\n\t\t}\n\t\t$this->movie_name = preg_replace($this->remove_from_title, '', ' '.$this->movie_name.' ');\n\t\t$this->movie_name = preg_replace('/([\\s\\s]+)/', ' ', trim($this->movie_name));\n\t\t$this->movie_name = preg_replace_callback('%[0-9]{4}(?!.*[0-9]{4}.*)(.*)%', create_function('$match', 'return substr($match[0], 0, 4);'), $this->movie_name);\n\t}", "public function test_rename()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->rename('test_new_dir');\n $this->assertEquals($object->get_base_name(), 'test_new_dir');\n }", "public function check_file_exists_change_filename($filename, $target_folder = false){\n\t\t\tif (!$this->file_uploading_settings['allow_overwrites']){\n\t\t\t\tif (file_exists($target_folder . $filename)){\n\t\t\t\t\t//rename file if file exists\n\t\t\t\t\t$filename = rand(1000,9999) . time() . $filename;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $filename;\n\t\t\t\n\t\t}", "public function testRenameFailure($newFilename)\n {\n $oldFilename = static::$baseFile . '/fs/tmp.txt';\n\n file_put_contents($oldFilename, 'It works!');\n $this->assertFalse(rename($oldFilename, $newFilename));\n }", "public function rename(string $source, string $newFileName): bool\n {\n $path = pathinfo($source);\n $newFilePath = $path['dirname'] . '/' . $newFileName;\n\n return rename($source, $newFilePath);\n }", "public function moveMigrationFile()\n {\n $from = base_path('Modules/' . $this->module . '/database/migrations/create_things_table.php.stub');\n $to = getMigrationFileName('create_' . mb_strtolower($this->module) . '_table');\n $this->files->move($from, $to);\n }", "public function setFileName( $name )\n {\n $this->properties[\"fileName\"] = $name;\n $this->properties[\"fileNameLength\"] = strlen( $name );\n }", "function _archiveFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_archivePath, $this->_claimedFilename);\n\t}", "function wp_swap_source($old_source_file) {\n\t\t\t\n\t\t$ext = pathinfo($old_source_file, PATHINFO_EXTENSION);\n\t\t\n\t\t$name = pathinfo($old_source_file, PATHINFO_FILENAME);\n\t\t$name = explode('-', $name);\n\t\t$temp = array_pop($name);\n\t\t$name = implode('-', $name);\n\t\t\n\t\t$path = dirname($old_source_file) . '/';\n\t\t\n\n\t\t$new_source_file = $path . $name . '.' . $ext;\n\t\t\n\t\t// In case there cannot be found an unresized original file in Wordpress’ media directory\n\t\t// Fallback to original file requested\n\t\t// This happens when cropping was done manuall in Wordpress, e.g. on a thumbnail\n\t\t// Why? The filename changes and no information about how and where cropping took place is stored \n\t\tif ( !file_exists($new_source_file) ) $new_source_file = $old_source_file;\n\n\t\treturn $new_source_file;\n\t}", "public function moveTo($targetPath): void\n {\n $this->ensureUploadedFileIsValid();\n\n if (empty($targetPath) || !is_string($targetPath)) {\n throw new InvalidArgumentException('Invalid path provided.');\n }\n\n if ($this->file !== null) {\n if (PHP_SAPI === 'cli') {\n $this->hasMoveTo = rename($this->file, $targetPath);\n } else {\n $this->hasMoveTo = move_uploaded_file($this->file, $targetPath);\n }\n } elseif ($this->stream !== null) {\n if ($this->stream->isSeekable()) {\n $this->stream->rewind();\n }\n\n try {\n $dst = new Stream($targetPath, 'w');\n } catch (Throwable $e) {\n throw new RuntimeException(\"Target path cannot be opened: \" . $e->getMessage(), $e->getCode(), $e);\n }\n\n while (!$this->stream->eof()) {\n if ($dst->write($this->stream->read(1024000)) === 0) {\n throw new RuntimeException(\"Error occurred while writing stream to target.\");\n }\n }\n\n $this->hasMoveTo = true;\n }\n\n if ($this->hasMoveTo === false) {\n throw new RuntimeException('Unable to move uploaded file to ' . $targetPath);\n }\n }", "private function renameFile($ext){\n\t\t//append the file name with the current time stamp and a random number\n\t\treturn time().'_'.mt_rand(1000,9999).$ext;\n\t\t\n\t\t\n\t}", "function renameFile($FileId, $fileName){\n\t $args = array($FileId, $fileName);\n\n\t return $this->owner->call('FileService.renameFile', $args);\n\t}", "public function autoResize(&$targetFileName, \\TYPO3\\CMS\\Core\\Resource\\Folder $folder, $sourceFile) {\n\t\t$storageConfiguration = $folder->getStorage()->getConfiguration();\n\t\t$storageRecord = $folder->getStorage()->getStorageRecord();\n\t\tif ($storageRecord['driver'] === 'Local') {\n\t\t\t$targetDirectory = $storageConfiguration['pathType'] === 'relative' ? PATH_site : '';\n\t\t\t$targetDirectory .= rtrim($storageConfiguration['basePath'], '/') . $folder->getIdentifier();\n\n\t\t\t$extension = strtolower(substr($targetFileName, strrpos($targetFileName, '.') + 1));\n\n\t\t\t// Various operation (including IM/GM) relies on a file WITH an extension\n\t\t\t$originalSourceFile = $sourceFile;\n\t\t\t$sourceFile .= '.' . $extension;\n\n\t\t\tif (rename($originalSourceFile, $sourceFile)) {\n\t\t\t\t$newSourceFile = static::$imageResizer->processFile(\n\t\t\t\t\t$sourceFile,\n\t\t\t\t\t$targetFileName,\n\t\t\t\t\t$targetDirectory,\n\t\t\t\t\tNULL,\n\t\t\t\t\t$GLOBALS['BE_USER'],\n\t\t\t\t\tarray($this, 'notify')\n\t\t\t\t);\n\n\t\t\t\tstatic::$metadata = static::$imageResizer->getLastMetadata();\n\n\t\t\t\t$newExtension = strtolower(substr($newSourceFile, strrpos($newSourceFile, '.') + 1));\n\n\t\t\t\t// We must go back to original (temporary) file name\n\t\t\t\trename($newSourceFile, $originalSourceFile);\n\n\t\t\t\tif ($newExtension !== $extension) {\n\t\t\t\t\t$targetFileName = substr($targetFileName, 0, -strlen($extension)) . $newExtension;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function makeName(UploadedFile $file, $documentName);", "public function rename($filename)\n {\n return $filename;\n }", "public function setFileName($value)\n {\n $this->setProperty(\"FileName\", $value, true);\n }", "public function rename(Request $request)\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n $newname=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['title'];\n if (!file_exists($file)) die('File not found '.$file);\n rename($file, $newname);\n }", "public function newName($newName)\n {\n $this->newName = $newName;\n }", "function incrementFileName($origFileName, $newFileName, $version)\r\n\t{\r\n\t\tif (JFile::exists($newFileName)) {\r\n\t\t\t$bits = explode('.', $newFileName);\r\n\t\t\t$ext = array_pop($bits);\r\n\t\t\t$f = implode('.', $bits);\r\n\t\t\t$f = rtrim($f, $version - 1);\r\n\t\t\t$newFileName = $f . $version . \".\" . $ext;\r\n\t\t\t$version ++;\r\n\t\t\t$newFileName = uploader::incrementFileName($origFileName, $newFileName, $version);\r\n\t\t}\r\n\t\treturn $newFileName;\r\n\t}", "public function test_rename_same_name()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->rename('test_dir');\n $this->assertEquals($object->get_base_name(), 'test_dir');\n }", "function sync_file_move($old, $new)\n{\n require_code('files2');\n _sync_file_move($old, $new);\n}", "protected function createFileName($name, $overwrite) {\n\t \n\t //get rid of any blank space in the submitted file name\n\t $nospaces = str_replace(' ', '_', $name);\n\t //mark the file as renamed if that changed the name from what was submitted\n\t if ($nospaces != $name) {\n\t $this->_renamed = true;\n\t}\n\tif (!$overwrite) {\n\t\t$existing = scandir($this->_destination);\n\t\t//check if an image with that name already exists\n\t\tif (in_array($nospaces, $existing)) {\n\t\t//if the filename already exists, we need to rename the file, so let's start by finding the character number of the '.' character\t\n\t\t$dot = strrpos($nospaces, '.');\n\t\tif ($dot) {\n\t\t\t//get the name of the file up to but without the dot\n\t\t\t$base = substr($nospaces, 0, $dot);\n\t\t\t//store the current file extension as well\n\t\t\t$extension = substr($nospaces, $dot);\n\t\t} else {\n\t\t\t//else if the file has no extension, store its name too\n\t\t\t$base = $nospaces;\n\t\t \t$extension = '';\n\t\t}\n\t\t//Now proceed to rename the file\n\t\t//we use a do while loop because we may be renaming multiple files from a multiple file upload, otherwise it will be just the one file being renamed,\n\t\t// hence the choice of do..while loop which will run at least once\t\n\t\t$i = 1; \n\t\tdo {\n\t\t\t//we rename the file by adding an underscore and an incremented number (e.g. gus_2) to the basename (before the extension)\n\t\t\t//notice how we commence by incrementing the number after the underscore by one ($i++). The initial 1 value of $i is to indicate that we're uploading a second version of that same file\n\t\t\t//but the while loop below will also ensure that the renamed file has an incremented number for as long as it finds another file existing in the destination folder\n\t\t\t$nospaces = $base . '_' . $i++ . $extension;\n\t\t} while (in_array($nospaces, $existing));\n\t\t\t//mark the file as renamed\n\t\t\t$this->_renamed = true;\n\t }\n\t}\n\t//return the new file name\n\treturn $nospaces;\n }", "function SetNewFileName($New = true) {\n\t\t\t// Si se va a generar un nuevo nombre\n\t\t\tif ($New) {\n\t\t\t\t$R = new Rand();\n\t\t\t\t/**\n\t\t\t\t * El metodo para generar el nombre es:\n\t\t\t\t * timestamp + nro_aleatorio + filename\n\t\t\t\t * todo esto encriptado a md5\n\t\t\t\t */\n\t\t\t\t$this->NewFileName = md5(time().$R->GetRandNumber().$this->GetFileName());\n\t\t\t// Cuando solo existirá una asignación del mismo\n\t\t\t} else {\n\t\t\t\t$this->NewFileName = $this->GetFileName();\n\t\t\t}\n\t\t}", "function file_newname($path, $filename){\n if ($pos = strrpos($filename, '.')) {\n $name = substr($filename, 0, $pos);\n $ext = substr($filename, $pos);\n } else {\n $name = $filename;\n }\n\n $newpath = $path.'/'.$filename;\n $newname = $filename;\n $counter = 0;\n while (file_exists($newpath)) {\n $newname = $name .'_'. $counter . $ext;\n $newpath = $path.'/'.$newname;\n $counter++;\n }\n\n return $newname;\n }", "public function rename($file, $name)\n {\n if (\\File::exists(parentPath($file) . '/' . $name))\n return $this->notify('There is already another file with that name', 409);\n \n try {\n \\File::move($file, parentPath($file) . '/' . $name);\n }\n catch (Exception $e) {\n return $this->notify($e->getMessage(), 500);\n }\n }", "public function setCurrentFileName(string $filename): void\n {\n $this->currentFileName = $filename;\n }", "function renameteam() {\n $this->auth(COMP_ADM_LEVEL);\n $team_id = $this->uri->segment(3);\n $new_name = urldecode($this->uri->segment(4));\n $data['team'] = $this->m_team->updateName($team_id, $new_name);\n $this->teamedit();\n }", "public function setFileName($fileName);", "function setFilename($filename);", "public function setNewName(): ParseFile\n {\n $slugName = $this->slug($this->getFilename());\n $hashName = bin2hex(random_bytes(8));\n $this->newName = \"{$slugName}_{$hashName}.{$this->getExtension()}\";\n return $this;\n }", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}", "public static function rename ($path, $newPath) {\n\t\t\\rename($path, $newPath);\n\t}", "private function renameTempFile($path, $newPath, $webRoot)\n {\n $fs = $this->getFileSystem();\n\n $fs->copy($webRoot.$path, $webRoot.$newPath, true);\n $fs->remove($webRoot.$path);\n }", "public function renameFile(Request $request) {\n\n // Get file old name and pathinfo\n $oldName = request('name');\n $pathinfo = pathinfo($oldName);\n\n // Get file new name (PS: Title is the new name typed on console)\n $title = substr( FileUploader::filterFilename( request('title') ), 0, 200);\n $newName = $title . (isset($pathinfo['extension']) ? '.' . $pathinfo['extension'] : '');\n\n // Rename file\n File::move(\n storage_path('app/public/') . 'albums/' . auth()->user()->id . '/' . request('album_month') . '/' . $oldName, \n storage_path('app/public/') . 'albums/' . auth()->user()->id . '/' . request('album_month') . '/' . $newName\n );\n\n // Return JSON for view update (through JavaScript)\n echo json_encode([\n 'title' => $title,\n 'file' => $newName,\n 'url' => $newName,\n ]);\n\n }", "public function rename($new_name, $new_extension = false)\n\t{\n\t\t$info = pathinfo($this->path);\n\n\t\t$new_name = str_replace(array('..', '/', '\\\\'), array('', '', ''), $new_name);\n\t\t$extension = $new_extension === false\n\t\t\t? $info['extension']\n\t\t\t: ltrim(str_replace(array('/', '\\\\'), array('', '', ''), $new_name), '.');\n\t\t$extension = ! empty($extension) ? '.'.$extension : '';\n\n\t\t$new_path = $info['dirname'].DS.$new_name.$extension;\n\n\t\t$return = $this->area->rename($this->path, $new_path);\n\t\t$return and $this->path = $new_path;\n\t\t\n\t\treturn $return;\n\t}", "public static function _RenameFile(Phar $phar, $file, $newname){\r\n if(!Phar::canWrite()) return self::ERR_RDONLY;\r\n if(isset($phar[$file])){\r\n $phar[$newname] = $phar[$file]->getContent();\r\n unset($phar[$file]);\r\n return self::SUCCESS;\r\n }\r\n return self::ERR_FILE_NOT_FOUND;\r\n }", "public function move($new_path)\n\t{\n\t\t$info = pathinfo($this->path);\n\t\t$new_path = $this->area->get_path($new_path);\n\n\t\t$new_path = rtrim($new_path, '\\\\/').DS.$info['basename'];\n\n\t\t$return = $this->area->rename($this->path, $new_path);\n\t\t$return and $this->path = $new_path;\n\t\t\n\t\treturn $return;\n\t}", "protected function destinationFile(): string\n {\n return $this->destinationDir() . '/' . ucfirst($this->arg('name')) . '.php';\n }", "public function move($modify = 'original',$overwrite = false) {\n\t$path = $this->_destination;\n\n\tif ($this->_uploaded) {\n\t\t$field = current($this->_uploaded);\n\t\tif (is_array($field['name'])) {\n\t\t\tforeach ($field['name'] as $number => $filename) {\n\t\t\t\t// process multiple upload\n\t\t\t\t$this->_renamed = false;\n\t\t\t\t$this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $path, $modify, $overwrite);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $path, $modify, $overwrite);\n\t\t}\n\t}\n }" ]
[ "0.7137183", "0.7072955", "0.69715595", "0.6959627", "0.69268346", "0.68998754", "0.67529595", "0.6702538", "0.6695465", "0.657887", "0.65189224", "0.64992607", "0.6460489", "0.64575166", "0.64473134", "0.6421975", "0.64060795", "0.6402514", "0.6339466", "0.63290626", "0.6328748", "0.6245259", "0.6232587", "0.62211853", "0.6173202", "0.615204", "0.61483204", "0.61479676", "0.61415744", "0.6139264", "0.6137952", "0.6128778", "0.6125649", "0.6117873", "0.6100771", "0.60969526", "0.60653", "0.605616", "0.60553306", "0.60294855", "0.59915507", "0.59887224", "0.59839416", "0.59816015", "0.5981439", "0.59699064", "0.59532326", "0.5950648", "0.5913707", "0.5896073", "0.58852017", "0.58796006", "0.5872367", "0.5867541", "0.5866437", "0.584912", "0.5838919", "0.58252054", "0.5796021", "0.5794162", "0.579318", "0.5789653", "0.57813877", "0.57655865", "0.5756825", "0.57500887", "0.5736563", "0.5729716", "0.57284427", "0.5719129", "0.56929356", "0.5680105", "0.567486", "0.56603277", "0.5658295", "0.56570166", "0.56480575", "0.56469613", "0.56434786", "0.5631386", "0.5629269", "0.5610854", "0.5609943", "0.56034243", "0.55923617", "0.55915505", "0.55861014", "0.55825824", "0.5579116", "0.5576185", "0.55752367", "0.5573245", "0.5572944", "0.5568486", "0.5564363", "0.5562352", "0.5561299", "0.55540115", "0.5549792", "0.5547513", "0.5544631" ]
0.0
-1
Change name of file (but preserve extension) before moving it to target location.
public function RenameBasename($NewName) { $Ext= $this->GetExtension(); $this->Name= $this->SanitizeFilename($NewName).'.'.$Ext; return $this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_file_name($new_name = '') {\r\n\t\tif ($this->rename_file) {\r\n\t\t\tif ($this->the_file == '') return;\r\n\t\t\t$name = ($new_name == '') ? strtotime('now') : $new_name;\r\n\t\t\tsleep(3);\r\n\t\t\t$name = $name.$this->get_extension($this->the_file);\r\n\t\t} else {\r\n\t\t\t$name = str_replace(' ', '_', $this->the_file); // space will result in problems on linux systems\r\n\t\t}\r\n\t\treturn $name;\r\n\t}", "public function rename($file, $new_file);", "function renameFile( $file )\n {\n $ext = $this->getExt( $file ); //\tRetorna extensão do arquivo\n $file_tmp = explode( \".\", $file ); //\tNome do arquivo, sem extensao\n $file_tmp = array_slice( $file_tmp, 0, sizeof( $file_tmp ) - 1 );\n $file_tmp = implode( \".\", $file_tmp );\n\t\t$file_tmp = substr( $file_tmp, 0, 15 );\n\n do {\n \t\n $file_tmp = str_replace( array( '=', '+', '/', '*' ), \"\", base64_encode( date( \"Hisu\" ) . $file_tmp ) );\n// print $file_tmp . \"<br />\";\n \n } while( file_exists( $this->path . $file_tmp . \".\" . $ext ) );\n \n $this->name = $file_tmp . \".\" . $ext;\n //\tatualiza o nome no LOG\n $this->source[ \"name\" ] = $this->name;\n \n return $this->name;\n }", "abstract function rename($old_file, $new_file, $move = FALSE);", "public static function renamefile()\n\t{\n\t\tglobal $g_dir;\n\t\t$filetorename = $_POST['fileToRename'];\n\t\t$newfilename = $_POST['newRenamedFileName'];\n\n\t\t//$dir= '/var/www/html/UPLOADS/';\n\n\t\tif(rename($g_dir.$filetorename, $g_dir.$newfilename))\n\t\t\techo(\"Successfully renamed $filetorename to $newfilename!\");\n\t\telse\n\t\t\techo(\"ERROR: Could not rename $filetorename to $newfilename!\");\n\t}", "public function rename($newname);", "function gttn_tpps_rename_file($fid, $new_name, array $options = array()) {\n if (!array_key_exists('preserve', $options)) {\n $options['preserve'] = FALSE;\n }\n\n if (!empty($fid) and ($file = file_load($fid))) {\n $new_filename = $new_name . \".\" . gttn_tpps_get_path_extension($file->uri);\n if (!preg_match('/^(.*\\/)(.*)$/', $new_name, $matches)) {\n preg_match('/^(.*\\/).*$/', $file->uri, $matches);\n $new_filename = $matches[1] . $new_filename;\n }\n\n if ($options['preserve']) {\n $file->status = FILE_STATUS_PERMANENT;\n file_save($file);\n return file_copy($file, $new_filename);\n }\n return file_move($file, $new_filename);\n }\n throw new Exception(\"Error: could not open file\");\n}", "public function rename($name){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\t$this->path = $newPath;\n\t\trename($oldPath, $newPath);\n\t}", "public static function rename($filename) {\n\t\t$info = pathinfo ( $filename );\n\t\t$dirname = $info ['dirname'];\n\t\t$lastname = $info ['filename'] . time ();\n\t\t$extension = $info ['extension'];\n\t\treturn $dirname . $lastname . \".\" . $extension;\n\t}", "public function rename($source, $target)\n {\n \n }", "function setName( $newName )\r\n\t{\r\n\t\t$basePath = dirname( $this->path );\r\n\t\tif(rename( $this->path, $basePath.'/'.$newName ))\r\n\t\t{\r\n\t\t\t$this->path = $basePath.'/'.$newName;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\ttrigger_error(\"Não foi possível renomear a pasta \" . $this->path);\r\n\t\t}\r\n\t}", "public static function move($_path, $_target)\r\n {\r\n return rename($_path, $_target);\r\n }", "public function moveFile($filename, $key);", "public function rename_plugin_file( $file ) {\n\t\tif ( is_dir( $file ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! $this->is_code_file( $file ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Only when the file is the kickstart file.\n\t\tif ( 'wpkickstart.php' === basename( $file ) ) {\n\t\t\t$dir = untrailingslashit( dirname( $file ) );\n\n\t\t\t$slug = $this->slugify( $this->cli_args->get_arg( 'name' ) );\n\n\t\t\tif ( ! $this->dryrun ) {\n\t\t\t\t$this->fs->move( $file, \"{$dir}/{$slug}.php\" );\n\t\t\t}\n\t\t}\n\t}", "private function setFileName() {\n $FileName = Uteis::Name($this->Name) . strrchr($this->File->name, '.');\n if (file_exists(self::$BaseDir . $this->Send . $FileName)):\n $FileName = Uteis::Name($this->Name) . '-' . time() . strrchr($this->File->name, '.');\n endif;\n $this->Name = $FileName;\n }", "public function rename($name, $new_name);", "private function renameFile($ext){\n\t\t//append the file name with the current time stamp and a random number\n\t\treturn time().'_'.mt_rand(1000,9999).$ext;\n\t\t\n\t\t\n\t}", "public function rename($source, $destination);", "public function rename($new_name) {\n\t\t$new_path = $this->getParentDirectory()->getPath().DIRECTORY_SEPARATOR.$new_name;\n\t\tif (!rename($this->getPath(), $new_path)) throw new \\Exception(\"Couldn't rename the file $this to $new_path\");\n\t\t$this->path = $new_path;\n\t}", "public function testRename()\n {\n $oldFilename = static::$baseFile . '/fs/tmp.txt';\n $newFilename = static::$baseFile . '/fs/test/tmp.txt';\n\n file_put_contents($oldFilename, 'It works!');\n\n $this->assertTrue(rename($oldFilename, $newFilename));\n\n $this->assertFalse(file_exists($oldFilename));\n $this->assertTrue(file_exists($newFilename));\n }", "private function renameFile($ext)\n\t{\n\t\t/*\n\t\t* Returns the timestamp and a random number\n\t\t*/\n\t\treturn time() . '_' . mt_rand(1000, 9999) . $ext ;\n\t}", "public function setNameAfterUploaded($name) {\n $this->_newName = $name;\n }", "function file_newname($path, $filename){\n if ($pos = strrpos($filename, '.')) {\n $name = substr($filename, 0, $pos);\n $ext = substr($filename, $pos);\n } else {\n $name = $filename;\n }\n\n $newpath = $path.'/'.$filename;\n $newname = $filename;\n $counter = 0;\n while (file_exists($newpath)) {\n $newname = $name .'_'. $counter . $ext;\n $newpath = $path.'/'.$newname;\n $counter++;\n }\n\n return $newname;\n }", "public function moveFile($oldPath, $newPath, $filename)\n {\n // TODO: Implement moveFile() method.\n }", "public function rename($new_name, $new_extension = false)\n\t{\n\t\t$info = pathinfo($this->path);\n\n\t\t$new_name = str_replace(array('..', '/', '\\\\'), array('', '', ''), $new_name);\n\t\t$extension = $new_extension === false\n\t\t\t? $info['extension']\n\t\t\t: ltrim(str_replace(array('/', '\\\\'), array('', '', ''), $new_name), '.');\n\t\t$extension = ! empty($extension) ? '.'.$extension : '';\n\n\t\t$new_path = $info['dirname'].DS.$new_name.$extension;\n\n\t\t$return = $this->area->rename($this->path, $new_path);\n\t\t$return and $this->path = $new_path;\n\t\t\n\t\treturn $return;\n\t}", "public function moveUploadedFile($filename, $key);", "function PclZipUtilRename($p_src, $p_dest)\n {\n }", "public function rename_file( string $old_name, string $new_name ): void {\n\t\t$blob_client = $this->get_blob_client();\n\t\t$container_name = $this->get_container_name();\n\n\t\t$blob_client->copyBlob( $container_name, $new_name, $container_name, $old_name );\n\t\t$blob_client->deleteBlob( $container_name, $old_name );\n\t}", "protected function onMove(){\n\t\tif (empty($this->post['directory']) || empty($this->post['file'])) return;\n\t\t\n\t\t$rename = empty($this->post['newDirectory']) && !empty($this->post['name']);\n\t\t$dir = $this->getDir($this->post['directory']);\n\t\t$file = realpath($dir . '/' . $this->post['file']);\n\t\t\n\t\t$is_dir = is_dir($file);\n\t\tif (!$this->checkFile($file) || (!$rename && $is_dir))\n\t\t\treturn;\n\t\t\n\t\tif ($rename || $is_dir){\n\t\t\tif (empty($this->post['name'])) return;\n\t\t\t$newname = $this->getName($this->post['name'], $dir);\n\t\t\t$fn = 'rename';\n\t\t}else{\n\t\t\t$newname = $this->getName(pathinfo($file, PATHINFO_FILENAME), $this->getDir($this->post['newDirectory']));\n\t\t\t$fn = !empty($this->post['copy']) ? 'copy' : 'rename';\n\t\t}\n\t\t\n\t\tif (!$newname) return;\n\t\t\n\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\t\tif ($ext) $newname .= '.' . $ext;\n\t\t$fn($file, $newname);\n\t\t\n\t\techo json_encode(array(\n\t\t\t'name' => pathinfo($this->normalize($newname), PATHINFO_BASENAME),\n\t\t));\n\t}", "public function setTargetFileName($value)\n {\n $this->targetFileName = strval(trim($value));\n }", "public function rename($path, $newpath)\n {\n }", "function rename($old, $new = null) {\n \n if (!$new) {\n $new = $old;\n \t$old = $this->_file;\n }\n \n if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN' && (strtolower($old) == strtolower($new))) {\n \n $rand = sprintf('%s%s%s%s%s',\n dirname($old),\n DIRECTORY_SEPARATOR,\n microtime(),\n rand(1, 999),\n basename($old)\n );\n \n if (!@rename($old, $rand)) {\n Fire_Error::throwError(sprintf('Failed to temporary rename \"%s\".',\n $old\n ), __FILE__, __LINE__\n );\n }\n $old = $rand;\n }\n \n if (!@rename($old, $new)) {\n Fire_Error::throwError(sprintf('Failed to rename \"%s\" to \"%s\".',\n $old,\n $new\n ), __FILE__, __LINE__\n );\n } \n }", "function incrementFileName($origFileName, $newFileName, $version)\r\n\t{\r\n\t\tif (JFile::exists($newFileName)) {\r\n\t\t\t$bits = explode('.', $newFileName);\r\n\t\t\t$ext = array_pop($bits);\r\n\t\t\t$f = implode('.', $bits);\r\n\t\t\t$f = rtrim($f, $version - 1);\r\n\t\t\t$newFileName = $f . $version . \".\" . $ext;\r\n\t\t\t$version ++;\r\n\t\t\t$newFileName = uploader::incrementFileName($origFileName, $newFileName, $version);\r\n\t\t}\r\n\t\treturn $newFileName;\r\n\t}", "public function rename($targetPath, $handlerObj = NULL, $handlerMethod = NULL) {\n $this->fileService->renameFile( $this->path, $targetPath, $handlerObj, $handlerMethod );\n }", "private function setNameFil($newNameFile)\n\t {\n\t $this->nameFile = $newNameFile;\n\t }", "function narrative_move_files($current_narrative_dir, $new_narrative_dir)\n{\n $file_scan = scandir($current_narrative_dir);\n foreach ($file_scan as $filecheck)\n {\n if ($filecheck != '.' && $filecheck != '..' && !is_dir($current_narrative_dir . $filecheck))\n {\n rename($current_narrative_dir . $filecheck, $new_narrative_dir . $filecheck);\n }\n }\n}", "public function rename($basename) {\n\t\tforeach($this->extras() as $extra) {\n\t\t\t$extra->filename(); // init\n\t\t}\n\t\t$basename = $this->pagefiles->cleanBasename($basename, true); \n\t\tif($this->wire('files')->rename($this->filename, $this->pagefiles->path . $basename, true)) {\n\t\t\t$this->set('basename', $basename); \n\t\t\t$basename = $this->basename();\n\t\t\tforeach($this->extras() as $extra) {\n\t\t\t\t$extra->rename();\n\t\t\t}\n\t\t\treturn $basename;\n\t\t}\n\t\treturn false; \n\t}", "public function setName($name)\n {\n $this->file['name'] = (string) $name;\n }", "function _moveFile($sourceDir, $destDir, $filename) {\n\t\t$currentFilePath = $sourceDir . DIRECTORY_SEPARATOR . $filename;\n\t\t$destinationPath = $destDir . DIRECTORY_SEPARATOR . $filename;\n\n\t\tif (!rename($currentFilePath, $destinationPath)) {\n\t\t\t$message = __('admin.fileLoader.moveFileFailed', array('filename' => $filename,\n\t\t\t\t'currentFilePath' => $currentFilePath, 'destinationPath' => $destinationPath));\n\t\t\t$this->addExecutionLogEntry($message, SCHEDULED_TASK_MESSAGE_TYPE_ERROR);\n\n\t\t\t// Script should always stop if it can't manipulate files inside\n\t\t\t// its own directory system.\n\t\t\tfatalError($message);\n\t\t}\n\n\t\treturn $destinationPath;\n\t}", "function getTargetFileName() ;", "function rename($file)\r\n {\r\n if(!empty($_POST['rename']))\r\n {\r\n if(rename($_POST['file'],$_POST['rename']));\r\n return 1;return 0;\r\n }\r\n }", "public function rename(Storable $storable, string $newName): void;", "function ext_change($filename, $ext) {\n return preg_replace('/\\.\\w+$/', \".$ext\", $filename, 1);\n}", "public function setFileName($file);", "private function moveFile($old_file, $new_file)\n {\n if (!file_exists($old_file)) {\n return;\n }\n\n if (!is_dir(dirname($new_file))) {\n mkdir(dirname($new_file), 0755, true);\n }\n\n // move the file to the archive folder\n rename($old_file, $new_file);\n }", "public function rename($filename)\n {\n return $filename;\n }", "function setFilenameExtension()\n\t{\n\t\t$sOldFilenameExtension = substr($this->filename, strlen($this->filename) - 4, 4);\n\t\tif (($sOldFilenameExtension != '.gif') &&\n\t\t\t\t($sOldFilenameExtension != '.jpg') &&\n\t\t\t\t($sOldFilenameExtension != '.png')) {\n\t\t\t$this->printError('invalid filename extension');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.gif';\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->filename = substr($this->filename, 0, strlen($this->filename) - 4) . '.png';\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "function swapFiles() {\r\n\t\tglobal $file;\r\n\r\n\t\trename($file, $file.\".tmp\");\r\n\t\trename($file.\".bak\", $file);\r\n\t\trename($file.\".tmp\", $file.\".bak\");\r\n\t}", "public function copy($name){\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $oldPath);\n\t\tarray_pop($path_array);\n\t\t$_newPath = implode(self::DS, $path_array);\n\t\t$newPath = $_newPath . self::DS . $name;\n\t\tcopy($this->path, $newPath);\n\t}", "function wp_swap_source($old_source_file) {\n\t\t\t\n\t\t$ext = pathinfo($old_source_file, PATHINFO_EXTENSION);\n\t\t\n\t\t$name = pathinfo($old_source_file, PATHINFO_FILENAME);\n\t\t$name = explode('-', $name);\n\t\t$temp = array_pop($name);\n\t\t$name = implode('-', $name);\n\t\t\n\t\t$path = dirname($old_source_file) . '/';\n\t\t\n\n\t\t$new_source_file = $path . $name . '.' . $ext;\n\t\t\n\t\t// In case there cannot be found an unresized original file in Wordpress’ media directory\n\t\t// Fallback to original file requested\n\t\t// This happens when cropping was done manuall in Wordpress, e.g. on a thumbnail\n\t\t// Why? The filename changes and no information about how and where cropping took place is stored \n\t\tif ( !file_exists($new_source_file) ) $new_source_file = $old_source_file;\n\n\t\treturn $new_source_file;\n\t}", "public function renameIfExists(UploadedFile $file)\n {\n if ($this->getStorage()->exists(\"{$this->getDirectory()}/$this->name\")) {\n $this->name = $this->generateUniqueName($file);\n }\n }", "private function setFileName(){\n if($this->customFileName !== ''){\n $prefix = $this->customFileName.'_';\n $this->finalFileName = uniqid($prefix).'.'.$this->fileExt;\n }else{\n $this->finalFileName = basename($this->fileName, \".\".$this->fileExt ).md5(microtime()).'.'.$this->fileExt;\n } \n }", "public function move($path){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$fileName = $path_array[sizeof($path_array) - 1];\n\t\t$newPath = $path . self::DS . $fileName;\n\t\t$this->path = $newPath;\n\t\t$this->createFile($newPath);\n\t\tunlink($oldPath);\n\t}", "public function autoResize(&$targetFileName, \\TYPO3\\CMS\\Core\\Resource\\Folder $folder, $sourceFile) {\n\t\t$storageConfiguration = $folder->getStorage()->getConfiguration();\n\t\t$storageRecord = $folder->getStorage()->getStorageRecord();\n\t\tif ($storageRecord['driver'] === 'Local') {\n\t\t\t$targetDirectory = $storageConfiguration['pathType'] === 'relative' ? PATH_site : '';\n\t\t\t$targetDirectory .= rtrim($storageConfiguration['basePath'], '/') . $folder->getIdentifier();\n\n\t\t\t$extension = strtolower(substr($targetFileName, strrpos($targetFileName, '.') + 1));\n\n\t\t\t// Various operation (including IM/GM) relies on a file WITH an extension\n\t\t\t$originalSourceFile = $sourceFile;\n\t\t\t$sourceFile .= '.' . $extension;\n\n\t\t\tif (rename($originalSourceFile, $sourceFile)) {\n\t\t\t\t$newSourceFile = static::$imageResizer->processFile(\n\t\t\t\t\t$sourceFile,\n\t\t\t\t\t$targetFileName,\n\t\t\t\t\t$targetDirectory,\n\t\t\t\t\tNULL,\n\t\t\t\t\t$GLOBALS['BE_USER'],\n\t\t\t\t\tarray($this, 'notify')\n\t\t\t\t);\n\n\t\t\t\tstatic::$metadata = static::$imageResizer->getLastMetadata();\n\n\t\t\t\t$newExtension = strtolower(substr($newSourceFile, strrpos($newSourceFile, '.') + 1));\n\n\t\t\t\t// We must go back to original (temporary) file name\n\t\t\t\trename($newSourceFile, $originalSourceFile);\n\n\t\t\t\tif ($newExtension !== $extension) {\n\t\t\t\t\t$targetFileName = substr($targetFileName, 0, -strlen($extension)) . $newExtension;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function changeExtension() {\n if (isset($this->params['file_id']) && $this->params['file_id'] != '' &&\n isset($this->params['extension']) && $this->params['extension'] != '' &&\n isset($this->currentFile) && is_array($this->currentFile) &&\n isset($this->currentFile['file_name'])) {\n $extensions = $this->mimeObj->getMimeTypesExtensions($this->currentFile['mimetype_id']);\n if (isset($extensions[$this->params['extension']])) {\n if ($pos = papaya_strings::strrpos($this->currentFile['file_name'], '.')) {\n $newFileName = substr($this->currentFile['file_name'], 0, $pos + 1);\n $newFileName .= $this->params['extension'];\n } else {\n $newFileName = $this->currentFile['file_name'].'.'.$this->params['extension'];\n }\n $data = array(\n 'file_name' => $newFileName,\n );\n $condition = array(\n 'file_id' => $this->params['file_id'],\n );\n if ($this->databaseUpdateRecord($this->tableFiles, $data, $condition)) {\n $this->addMsg(\n MSG_INFO, $this->_gt('File extension corrected.')\n );\n $this->loadFileData();\n }\n } else {\n $this->addMsg(\n MSG_ERROR,\n sprintf(\n $this->_gt('Invalid extension \"%s\" for filetype \"%s\".'),\n $this->params['extension'],\n $this->currentFile['mimetype']\n )\n );\n }\n }\n }", "function SetFileName(){\n\t\t$this->FindRootFile();\n\t\t$this->BookLink = $_SERVER['DOCUMENT_ROOT'].'/'.$this->BookLink.'/'.$this->RootFile;\n\t}", "public function setFileName($value)\n {\n $this->setProperty(\"FileName\", $value, true);\n }", "public static function move($path, $target)\n\t{\n\t\treturn rename($path, $target);\n\t}", "private function renameFile($source, $target)\n {\n if (false === @rename($source, $target)) {\n if (defined('PHP_WINDOWS_VERSION_BUILD')) {\n if (false === copy($source, $target)) {\n throw new \\RuntimeException(sprintf('(WIN) Could not write new cache file to %s.', $target));\n }\n if (false === unlink($source)) {\n throw new \\RuntimeException(sprintf('(WIN) Could not delete temp cache file to %s.', $source));\n }\n } else {\n throw new \\RuntimeException(sprintf('Could not write new cache file to %s.', $target));\n }\n }\n }", "public function rename(string $newName): void\n {\n if ( ! $this->exists() ) {\n $this->filename = $newName;\n return;\n }\n\n if ( false !== strpos(str_replace('\\\\', '/', $newName), '/') ) {\n throw new FileSystemException('newName parameter can not contain slashes');\n }\n\n $done = rename($this->directory->getPath().'/'.$this->filename, $this->directory->getPath().'/'.$newName);\n\n if ( ! $done ) {\n throw new FileSystemException('renaming failed, probably due to access issues');\n }\n\n $this->filename = $newName;\n }", "public function getTargetFileName() {}", "public static function rename($source, $newName)\r\n {\r\n if (file_exists($source)) {\r\n rename($source, $newName);\r\n }\r\n }", "public function move($from, $to)\n\t{\n\t\trename($from, $this->base_location . \"/\" . $to);\n\t}", "protected function checkName($file) {\n $this->_newName = null;\n $unwantedArray = [' ', '-']; # replace spaces, hyphens\n foreach ($unwantedArray as $remove) {\n $nospaces = str_replace($remove, '_', $file['name']);\n }\n if ($nospaces != $file['name']) {\n $this->_newName = $nospaces;\n }\n $extension = pathinfo($nospaces, PATHINFO_EXTENSION);\n if (!$this->_typeCheckingOn && !empty($this->_suffix)) {\n if (in_array($extension, $this->_notTrusted) || empty($extension)) {\n $this->_newName = $nospaces . $this->_suffix;\n }\n }\n if ($this->_renameDuplicates) {\n $name = isset($this->_newName) ? $this->_newName : $file['name'];\n $existing = scandir($this->_destination);\n if (in_array($name, $existing)) {\n // rename file\n $basename = pathinfo($name, PATHINFO_FILENAME);\n $extension = pathinfo($name, PATHINFO_EXTENSION);\n $i = 1;\n do {\n $this->_newName = $basename . '_' . $i++;\n if (!empty($extension)) {\n $this->_newName .= \".$extension\";\n }\n } while (in_array($this->_newName, $existing));\n }\n }\n }", "function move_file($name)\n{\n $old_file = __DIR__ . '/xml_schemas/' . $name . '.xml';\n $new_file = Path::get_repository_path() . 'lib/content_object/' . $name . '/install/' . $name . '.xml';\n Filesystem::copy_file($old_file, $new_file);\n return $new_file;\n}", "public function setFileName( $name )\n {\n $this->properties[\"fileName\"] = $name;\n $this->properties[\"fileNameLength\"] = strlen( $name );\n }", "public static function rename_file($from,$to){\n\t\tif(rename($from,$to)){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function setNewName(): ParseFile\n {\n $slugName = $this->slug($this->getFilename());\n $hashName = bin2hex(random_bytes(8));\n $this->newName = \"{$slugName}_{$hashName}.{$this->getExtension()}\";\n return $this;\n }", "protected function createFileName($name, $overwrite) {\n\t \n\t //get rid of any blank space in the submitted file name\n\t $nospaces = str_replace(' ', '_', $name);\n\t //mark the file as renamed if that changed the name from what was submitted\n\t if ($nospaces != $name) {\n\t $this->_renamed = true;\n\t}\n\tif (!$overwrite) {\n\t\t$existing = scandir($this->_destination);\n\t\t//check if an image with that name already exists\n\t\tif (in_array($nospaces, $existing)) {\n\t\t//if the filename already exists, we need to rename the file, so let's start by finding the character number of the '.' character\t\n\t\t$dot = strrpos($nospaces, '.');\n\t\tif ($dot) {\n\t\t\t//get the name of the file up to but without the dot\n\t\t\t$base = substr($nospaces, 0, $dot);\n\t\t\t//store the current file extension as well\n\t\t\t$extension = substr($nospaces, $dot);\n\t\t} else {\n\t\t\t//else if the file has no extension, store its name too\n\t\t\t$base = $nospaces;\n\t\t \t$extension = '';\n\t\t}\n\t\t//Now proceed to rename the file\n\t\t//we use a do while loop because we may be renaming multiple files from a multiple file upload, otherwise it will be just the one file being renamed,\n\t\t// hence the choice of do..while loop which will run at least once\t\n\t\t$i = 1; \n\t\tdo {\n\t\t\t//we rename the file by adding an underscore and an incremented number (e.g. gus_2) to the basename (before the extension)\n\t\t\t//notice how we commence by incrementing the number after the underscore by one ($i++). The initial 1 value of $i is to indicate that we're uploading a second version of that same file\n\t\t\t//but the while loop below will also ensure that the renamed file has an incremented number for as long as it finds another file existing in the destination folder\n\t\t\t$nospaces = $base . '_' . $i++ . $extension;\n\t\t} while (in_array($nospaces, $existing));\n\t\t\t//mark the file as renamed\n\t\t\t$this->_renamed = true;\n\t }\n\t}\n\t//return the new file name\n\treturn $nospaces;\n }", "public function new_filename($name)\n\t{\n $name = preg_replace(\"/[^a-zA-Z0-9._]/\", \"_\", $name);\n\n // First make sure that we have a directory to put it in, make a new directory for each month\n // Using base64_encode to get more interesting results than an md5 hash\n $dir = date(\"Ym\");\n $file_split = explode(\".\", $name);\n $extension = $file_split[count($file_split) - 1];\n $s3 = AWS::createClient('s3');\n do {\n $filename = substr(base64_encode(md5(uniqid(rand()))), 0, 8) . \".\" . $extension;\n } while ($s3->doesObjectExist($this->bucket, $dir . '/' . $filename));\n $this->dir = $dir;\n return $filename;\n\t}", "public function changeFileName( $sFileName ){\n return change2Latin( str_replace( Array( '$', '\\'', '\"', '~', '/', '\\\\', '?', '#', '%', '+', '*', ':', '|', '<', '>', ' ', '__' ), '_', $sFileName ) );\n }", "public function change_real_filename($real_filename)\n\t{\n\t\t$sql = 'UPDATE ' . $this->attachments_table . '\n\t\t\tSET real_filename = \"' . $this->db->sql_escape($real_filename) . '\"\n\t\t\tWHERE attachment_id = ' . $this->get_id();\n\t\t$this->db->sql_query($sql);\n\t}", "public function move($sDestinationFileName);", "public function test_rename()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->rename('test_new_dir');\n $this->assertEquals($object->get_base_name(), 'test_new_dir');\n }", "public function upFile($file, $dir)\n {\n $name = rand() . '.' . $file->getClientOriginalExtension();\n $file->move($dir, $name);\n return $name;\n }", "public function setFull_Filename(){\n \t $this->filename = $this->setDestination().'/'.$this->id.'.'.$this->ext;; \n\t}", "private function _set_movie_name($file_name){\n\t\t\n\t\t$this->movie_name = preg_replace('/(\\_|\\.|\\-|\\[|\\]|\\(|\\)|\\{|\\})/', ' ', $file_name);\n\t\t\n\t\tforeach($this->remove_from_title as $key => $patern){\n\t\t\t$this->remove_from_title[$key] = '/(\\s'.$patern.'\\s)/i';\n\t\t}\n\t\t$this->movie_name = preg_replace($this->remove_from_title, '', ' '.$this->movie_name.' ');\n\t\t$this->movie_name = preg_replace('/([\\s\\s]+)/', ' ', trim($this->movie_name));\n\t\t$this->movie_name = preg_replace_callback('%[0-9]{4}(?!.*[0-9]{4}.*)(.*)%', create_function('$match', 'return substr($match[0], 0, 4);'), $this->movie_name);\n\t}", "public static function move($path, $target)\n {\n return rename($path, $target);\n }", "function renameFile($FileId, $fileName){\n\t $args = array($FileId, $fileName);\n\n\t return $this->owner->call('FileService.renameFile', $args);\n\t}", "function frename($oldfile=false, $newfile=false, $dir=false) {\n//\t\t$ereg = '\\.([a-zA-Z0-9]*)$';\n//\t\tereg($ereg, $oldfile, $arr);\n preg_match('/\\.([a-zA-Z0-9]*)$/', $oldfile, $arr);\n\t\tif (ereg('/\\.([a-zA-Z0-9]*)$/', $newfile)) \n\t\t $newfile = preg_replace('/\\.([a-zA-Z0-9]*)$/', \".\" . $arr[1], $newfile);\n\t\telse $newfile .= \".\" . $arr[1];\n\t\treturn $this->rename($oldfile, $newfile, $dir);\n\t}", "public function move(string $destination, ?string $name = null, ?string $ext = null): bool {\n $path = explode(self::SEPARATOR, $this->getPath());\n $old_name = $path[count($path) - 1];\n $ext = $ext ?? (strpos($old_name, \".\") !== false ? explode(\".\", $old_name)[count(explode(\".\", $old_name)) - 1] : '');\n $ext = $ext !== '' ? \".\" . $ext : '';\n $name = $name ?? $old_name;\n if(substr($destination, -strlen($destination)) !== self::SEPARATOR) $destination .= self::SEPARATOR;\n return rename($this->getPath(), $destination . $name . $ext);\n }", "public function rename(Request $request)\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n $newname=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['title'];\n if (!file_exists($file)) die('File not found '.$file);\n rename($file, $newname);\n }", "protected function _setFileName($defaultName, $defaultExtension) {\n $newFileName = $defaultName;\n if ($this->configData['encrypt_name'] === true) {\n $newFileName = sha1(microtime()) . $defaultExtension;\n } elseif ($this->configData['new_file_name']) {\n $newFileName = $this->configData['new_file_name'] . $defaultExtension;\n }\n return $newFileName;\n }", "public static function move_uploaded_file_in_ext($path,$newname=false){\n\t\t$nfile = $_FILES['localfile']['name'];\n\t\tif(move_uploaded_file($_FILES['localfile']['tmp_name'], getcwd().\"/\".$path.$nfile)){\n\t\t\tif($newname){\n\t\t\t\tEFileSystem::rename_file_ext($path.$nfile,$path.$newname);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function setFilename($filename);", "public static function rename(string $path, File $new_file) : File\n {\n return (new File($path))->rename($new_file);\n }", "public function check_file_exists_change_filename($filename, $target_folder = false){\n\t\t\tif (!$this->file_uploading_settings['allow_overwrites']){\n\t\t\t\tif (file_exists($target_folder . $filename)){\n\t\t\t\t\t//rename file if file exists\n\t\t\t\t\t$filename = rand(1000,9999) . time() . $filename;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $filename;\n\t\t\t\n\t\t}", "function move($src, $dest)\n\t{\n\t\treturn rename($src, $dest);\n\t}", "public function replaceFile($filename, $move = true) {\n\t\t\n\t\t/** @var WireFileTools $files */\n\t\t$files = $this->wire('files');\n\t\tif(!is_file($filename) || !is_readable($filename)) return false;\n\t\tif($move && !is_writable($filename)) $move = false;\n\t\t\n\t\t$srcFile = $filename;\n\t\t$dstFile = $this->filename();\n\t\t$tmpFile = dirname($dstFile) . '/.' . basename($dstFile) . '.tmp'; \n\t\t\n\t\tif(file_exists($tmpFile)) $files->unlink($tmpFile);\n\t\t\n\t\t$files->rename($dstFile, $tmpFile); \n\t\t\n\t\tif($move) {\n\t\t\t$result = $files->rename($srcFile, $dstFile);\n\t\t} else {\n\t\t\t$result = $files->copy($srcFile, $dstFile); \n\t\t}\n\n\t\tif(!$result) {\n\t\t\t$files->rename($tmpFile, $dstFile);\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$files->unlink($tmpFile);\n\t\t$this->filesize(true);\n\t\t$this->filemtime(true);\n\t\t\n\t\treturn true;\n\t}", "protected function getNewFileName( $data ) {\n\n\t\t$file = KRequest::getFile($this->propertyName);\n\n\t\tif (!$file || empty($file['tmp_name'])) {\n\t\t\treturn '';\n\t\t}\n\n\t\t// Prepare file's filename and extension\n\t\t$filenameRaw = mb_strtolower($file['name']);\n\n\t\t$fileExtension = KenedoFileHelper::getExtension($filenameRaw);\n\n\t\t// If option FILENAME_TO_RECORD_ID is set, prepare the full path with new filename\n\t\t$optionTags = $this->getPropertyDefinition('optionTags', array());\n\t\tif (isset($optionTags['FILENAME_TO_RECORD_ID'])) {\n\t\t\t$newFilename = $data->id;\n\t\t}\n\t\t// Else use the sanitized filename\n\t\telseif ($this->getPropertyDefinition('filename')) {\n\t\t\t$newFilename = $this->getPropertyDefinition('filename');\n\t\t}\n\t\telse {\n\t\t\t$newFilename = preg_replace('#\\.[^.]*$#', '', $filenameRaw);\n\t\t}\n\n\t\tif ($this->getPropertyDefinition('appendSerial')) {\n\t\t\t// Append a number to circumvent outdated cache data\n\t\t\t$newFilename .= '-'.str_pad(rand(1,1000),4,0);\n\t\t}\n\n\t\treturn $newFilename.'.'.$fileExtension;\n\n\t}", "public function moveToTmpDir()\n\t{\n\t\tif($this->source instanceof UploadedFile) {\n\t\t\t$this->source->move($this->getTmpDir()->getRootPath());\n\t\t} else if(is_string($this->source)) {\n\t\t\tcopy($this->params['path'], $this->getTmpDir()->getRootPath() . '/' . $this->params['name']);\n\t\t}\n\t}", "public function covers_rename(): void\n {\n $response = $this->check_request('Rename cover');\n if (!$response) {\n $original = input_request('original');\n $newname = input_request('newname');\n if (file_exists(folder_covers() . $newname)) {\n $response = $this->get_response(true,\n 'Cannot rename, file exists');\n $this->log_error(\"Cover rename $original -> $newname EXISTS\");\n } else {\n $result = rename(folder_covers() . $original,\n folder_covers() . $newname);\n if ($result) {\n $response = $this->get_response(false, 'Cover renamed');\n $this->log_info(\"Cover rename $original -> $newname\");\n } else {\n $response = $this->get_response(true, 'Rename failed');\n $this->log_error(\n \"Cover rename $original -> $newname FAILED\");\n }\n }\n }\n exit(json_encode($response));\n }", "public static function rename ($path, $newPath) {\n\t\t\\rename($path, $newPath);\n\t}", "protected function destinationFile(): string\n {\n return $this->destinationDir() . '/' . ucfirst($this->arg('name')) . '.php';\n }", "public function setFileName($fileName);", "public function test_rename_same_name()\n {\n $object = Directory::create(ROOT.DS.'test_dir');\n $object->rename('test_dir');\n $this->assertEquals($object->get_base_name(), 'test_dir');\n }", "function uploadMiscellaneousFile($fileOldNameKey, $fileNewName, $fileNewPath){\r\n\t\t$fileOldName = basename($_FILES[$fileOldNameKey]['name']);\r\n\t\t$fileExt = substr(strrchr($fileOldName, '.'), 1);\r\n\t\t$targetAudioPath = $fileNewPath . $fileOldName;\r\n\t\r\n\t\tif(move_uploaded_file($_FILES[$fileOldNameKey]['tmp_name'], $targetAudioPath)) {\r\n\t\t\techo \"The file \". $fileOldName . \" has been uploaded.\";\r\n\t\t} \r\n\t\telse{\r\n\t\t\techo \"There was a non-fatal error uploading the file.\";\r\n\t\t}\r\n}", "public function testRenameFailure($newFilename)\n {\n $oldFilename = static::$baseFile . '/fs/tmp.txt';\n\n file_put_contents($oldFilename, 'It works!');\n $this->assertFalse(rename($oldFilename, $newFilename));\n }", "public function getTargetFilename() {}", "public function formatFileName($originalName = null);", "function generateFilename(&$articleFile, $fileStage, $originalName) {\n\t\t$extension = $this->parseFileExtension($originalName);\n\t\t$newFileName = $articleFile->getArticleId().'-'.$articleFile->getFileId().'-'.$articleFile->getRevision().'-'.$this->fileStageToAbbrev($fileStage).'.'.$extension;\n\t\t$articleFile->setFileName($newFileName);\n\t\treturn $newFileName;\n\t}" ]
[ "0.7242488", "0.70655084", "0.69141597", "0.68410635", "0.68395835", "0.6656185", "0.6651485", "0.66479355", "0.6625968", "0.66041684", "0.65480375", "0.6391009", "0.63858485", "0.6368672", "0.6360018", "0.6318708", "0.6316524", "0.627362", "0.6186027", "0.61848426", "0.6167926", "0.612752", "0.60851157", "0.60783434", "0.60778874", "0.60711086", "0.60562825", "0.6055806", "0.602209", "0.60081774", "0.5991445", "0.59714204", "0.5964119", "0.593404", "0.59267724", "0.59180737", "0.5916282", "0.590342", "0.5900625", "0.5855681", "0.5854961", "0.5836512", "0.5830533", "0.5823752", "0.5817077", "0.5810131", "0.57976496", "0.5795914", "0.579416", "0.57893586", "0.5773714", "0.5763104", "0.5760595", "0.5751781", "0.5739306", "0.5736613", "0.5729277", "0.5720465", "0.5713338", "0.5703571", "0.5702007", "0.570108", "0.5697752", "0.5688054", "0.5683177", "0.5675492", "0.5672896", "0.5672287", "0.56715745", "0.56640303", "0.56562984", "0.56510085", "0.56356597", "0.563311", "0.56237507", "0.5622393", "0.5619081", "0.5616014", "0.5614137", "0.55976707", "0.5594635", "0.5593473", "0.5590389", "0.5587362", "0.55863726", "0.5580879", "0.55799687", "0.55746686", "0.55722046", "0.55616343", "0.55606383", "0.5551846", "0.5516152", "0.5509828", "0.55039114", "0.54974645", "0.54907525", "0.5489767", "0.548697", "0.54836565", "0.5480014" ]
0.0
-1
Move uploaded file to target location.
public function Move($ToDir) { // if there is no file return null if ($this->Error === UPLOAD_ERR_NO_FILE) { return null; } // if any error occured return false if ($this->Error !== UPLOAD_ERR_OK) { return false; } // create target directory if (!$ToDir) { $this->Error= $this->MsgDef('Target directory must be specified.', 'Request.FileErr.NoDir', null, null, array($ToDir)); return false; } if (!is_dir($ToDir)) { if (!mkdir($ToDir, 0777, true)) { $this->Error= $this->MsgDef('Unable to create directory %s.', 'Request.FileErr.CreateDir', null, null, array($ToDir)); return false; } } // remove existing file (overwrite) $ToPath= rtrim($this->ResolvePath($ToDir), '\\/').'/'.$this->Name; if (is_file($ToPath)) { @unlink($ToPath); // @ - possible file permition protection } // move file to target location if (!move_uploaded_file($this->TmpName, $ToPath)) { $this->Error= error_get_last(); return false; } // success @chmod($ToPath, 0666); // @ - maybe no permition to use chmod return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function upload_move($file, $local_file);", "public function moveToTmpDir()\n\t{\n\t\tif($this->source instanceof UploadedFile) {\n\t\t\t$this->source->move($this->getTmpDir()->getRootPath());\n\t\t} else if(is_string($this->source)) {\n\t\t\tcopy($this->params['path'], $this->getTmpDir()->getRootPath() . '/' . $this->params['name']);\n\t\t}\n\t}", "public function moveTo($targetPath): void\n {\n $this->ensureUploadedFileIsValid();\n\n if (empty($targetPath) || !is_string($targetPath)) {\n throw new InvalidArgumentException('Invalid path provided.');\n }\n\n if ($this->file !== null) {\n if (PHP_SAPI === 'cli') {\n $this->hasMoveTo = rename($this->file, $targetPath);\n } else {\n $this->hasMoveTo = move_uploaded_file($this->file, $targetPath);\n }\n } elseif ($this->stream !== null) {\n if ($this->stream->isSeekable()) {\n $this->stream->rewind();\n }\n\n try {\n $dst = new Stream($targetPath, 'w');\n } catch (Throwable $e) {\n throw new RuntimeException(\"Target path cannot be opened: \" . $e->getMessage(), $e->getCode(), $e);\n }\n\n while (!$this->stream->eof()) {\n if ($dst->write($this->stream->read(1024000)) === 0) {\n throw new RuntimeException(\"Error occurred while writing stream to target.\");\n }\n }\n\n $this->hasMoveTo = true;\n }\n\n if ($this->hasMoveTo === false) {\n throw new RuntimeException('Unable to move uploaded file to ' . $targetPath);\n }\n }", "public function moveUploadedFile($filename, $key);", "public function moveImage(UploadedFile $file)\n {\n \t$file->move($this->baseDir, $this->image);\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // if there is an error when moving the file, an exception will\n // be automatically thrown by move(). This will properly prevent\n // the entity from being persisted to the database on error\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n\n // check if we have an old image\n if (isset($this->temp)) {\n // delete the old image\n unlink($this->getUploadRootDir().'/'.$this->temp);\n // clear the temp image path\n $this->temp = null;\n }\n $this->file = null;\n }", "public function move_photo(){\n move_uploaded_file($this->tmp_path, '/home/a1031316/public_html/uploaded_images/'.$this->name);\n\n }", "public function testMoveFileFromTmp(): void\n {\n $expectedFilePath = $this->imageUploader->getBasePath() . DIRECTORY_SEPARATOR . 'magento_small_image_1.jpg';\n\n $this->assertFalse($this->mediaDirectory->isExist($expectedFilePath));\n\n $this->imageUploader->moveFileFromTmp('magento_small_image.jpg');\n\n $this->assertTrue($this->mediaDirectory->isExist($expectedFilePath));\n }", "public function move($sourcePath, $destinationPath, $checkIfIsUploaded = false, $overwrite = true);", "function __moveUploadedFile($source, $destination) {\r\n\t\tif (!Configure::read('Documents.isTesting')) {\r\n\t\t\treturn move_uploaded_file($source, $destination);\r\n\t\t} else {\r\n\t\t\treturn rename($source, $destination);\r\n\t\t}\r\n\r\n\t}", "public function upload() {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "public function moveStorageFile(StorageFile $file, Storage $toStorage);", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n\n $filePath = md5(uniqid($this->getIdUser().\"_profil\",true)).\".\".\n $this->getFile()->guessClientExtension();\n\n $this->getFile()->move(\n $this->getUploadRootDir(),$filePath\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filePath;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function moveTo($targetPath)\n {\n if ($this->hasMoved) {\n throw new \\RuntimeException(\"File {$this->fileInfo['name']} has already been moved\");\n }\n\n if (!is_uploaded_file($this->fileInfo['tmp_name'])) {\n throw new \\RuntimeException(\"File {$this->fileInfo['name']} is not uploaded file\");\n }\n\n if (!move_uploaded_file($this->fileInfo['tmp_name'], $targetPath)) {\n throw new \\RuntimeException(\"Moving file {$this->fileInfo['name']} to {$targetPath} fails\");\n }\n\n $hasMoved = true;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n \n\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n Image::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->path\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "protected function _moveToImageDir()\n\t{\n\t\t$path = $this->getFilePath();\n\t\t$this->_uploadedFile->moveTo($path);\n\t\tchmod($path, 0644);\n\t}", "public function upload()\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n $filename = time().'_'.$this->getFile()->getClientOriginalName();\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::$SERVER_PATH_TO_VIDEO_FOLDER,\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->filename = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "function _stageFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_stagePath, $this->_claimedFilename);\n\t}", "function move_upload_file($srcfile, $destfile) {\n\t//if(IN_SAE) return copy($srcfile, $destfile);\n\t//$r = move_uploaded_file($srcfile, $destfile);\n\t$r = copy($srcfile, $destfile);\n\treturn $r;\n}", "function final_move($bean_id)\n\t{\n\t\tglobal $log, $root_directory, $upload_dir;\n\t\t$log->debug(\"Entering final_move(\".$bean_id.\") method ...\");\n\n\t\t$file_name = $bean_id.$this->stored_file_name;\n\t\t$destination = $root_directory.'/'.$upload_dir.$file_name;\n\n\t\tif (!move_uploaded_file($_FILES[$this->field_name]['tmp_name'], $destination)) {\n\t\t\tdie (\"ERROR: can't move_uploaded_file to destination\");\n\t\t}\n\t\t$log->debug(\"Exiting final_move method ...\");\n\t\treturn true;\n\t}", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n\t{\n\t if (null === $this->getFile()) {\n\t return;\n\t }\n\t\n\t // use the original file name here but you should\n\t // sanitize it at least to avoid any security issues\n\t\n\t // move takes the target directory and then the\n\t // target filename to move to\n\t \n\t $this->getFile()->move($this->getWebPath(),$this->imagen);\n\t \n\t \n\t // set the path property to the filename where you've saved the file\n\t $this->path = $this->getFile()->getClientOriginalName();\n\t\t//$this->temp = \n\t // clean up the file property as you won't need it anymore\n\t $this->file = null;\n\t}", "public function doMoveUploadedFile($source, $dest)\n {\n return move_uploaded_file($source, $dest);\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->setImageName($this->getFile()->getClientOriginalName());\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function moveFile()\n\t{\n\t\t$thumbnail = Image::make($this->file)->resize(null, 100, function($constraint)\n\t\t\t\t\t{\n\t\t\t\t\t\t$constraint->aspectRatio();\n\t\t\t\t\t\t// $constraint->upsize();\n\t\t\t\t\t});\n\n\t\t// Move uploaded imagesto this folder\n\t\t$file_moved = $this->file->move($this->dir, $this->file->getClientOriginalName());\n\n\t\t// If successfully moved\n\t\tif ($file_moved) {\n\t\t\t// Generate thumbnail image\n\t\t\t$thumbnail->save(public_path() . '/' . $this->dir . '/thumb_' . $this->file->getClientOriginalName());\n\n\t\t\treturn Response::json(array('filelink' => '/' . $this->dir . '/' . $this->file->getClientOriginalName()));\n\t\t}\n\n\t}", "public function upload(){\n if( NULL === $this->getFile()){\n return;\n }\n $filename= $this->getFile()->getClientOriginalName();\n\n // Move to the target directory\n \n $this->getFile()->move(\n $this->getAbsolutePath(), \n $filename);\n\n //Set the logo\n $this->setFilename($filename);\n\n $this->setFile();\n\n }", "public function upload()\n {\n //Checks if the path is null\n if (null === $this->file) {\n return;\n }\n\n $hash = uniqid('', true);\n $extension = $this->file->getClientOriginalExtension();\n $newFilename = $hash.'.'.$extension;\n\n $this->file->move($this->getUploadRootDir(), $newFilename);\n $this->path = $newFilename;\n\n // Clean the path file\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n\n\n\t\t\t\tif(!file_exists($this->getUploadRootDir())) mkdir($this->getUploadRootDir(), 0777, true);\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload(): void\n {\n // the file property can be empty if the field is not required\n if (null === $this->getFile()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setFile(null);\n }", "function move_uploaded_file($filename, $destination)\n{\n return copy($filename, $destination);\n}", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // si on avait un ancien fichier on le supprime\n if (null !== $this->tempFilename) {\n $oldFile = $this->getUploadRootDir().'/'.$this->id.'.'.$this->tempFilename;\n if (file_exists($oldFile)) {\n unlink($oldFile);\n }\n }\n\n // déplace le fichier envoyé dans le répertoire de notre choix\n $this->file->move(\n $this->getUploadRootDir(), // répertoire de destination\n $this->id.'.'.$this->url // nom du fichier à créer \"id.extension\"\n );\n\n }", "public function move($sDestinationFileName);", "public function move($path)\n {\n return move_uploaded_file($this->tmp, $path);\n }", "public function upload()\n {\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n $this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload2()\n {\n if(null === $this->getFile2()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $fname = md5(rand(0,100000) . $this->getFile2()->getClientOriginalName()) . '-' . $this->getFile2()->getClientOriginalName();\n\n $this->getFile2()->move(\n $this->getUploadRootDir(),\n $fname\n );\n\n // set the path property to the filename where you've saved the file\n $this->path2 = $fname;\n\n // clean up the file property as you won't need it anymore\n $this->file2 = null;\n }", "public function download_move($file, $local_file);", "public function move($destination,$filename){\n\t\tif(!is_uploaded_file($this->getPathname())){\n\t\t\tthrow new \\Exception('File couldn\\'t be uploaded!');\n\t\t}\n\n\t\t/// chceck that destination directory exists\n\t\tif(!is_dir($destination)){\n\t\t\t/// try to create the directory\n if(false === @mkdir($destination,0777,true) && !is_dir($destination)){\n throw new \\Exception('Can\\'t create directory \"'.$destination.'\"');\n }\n }\n /// check access rights\n else if(!is_writable($destination)){\n throw new \\Exception('Can\\'t write to directory \"'.$destination.'\"');\n }\n\n /// determine target path\n $target = rtrim($destination,'/\\\\').DIRECTORY_SEPARATOR.$this->getFilename($filename);\n\n\t\t/// move the file\n\t\tif(!@move_uploaded_file($this->getPathname(), $target)){\n\t\t\tthrow new \\Exception('Can\\'t move the file from \"'.$this->getPathname().'\" to \"'.$target.'\"');\n\t\t}\n\n\t\t/// set access rights\n\t\t@chmod($target,0666 & ~umask());\n\n\t\treturn $target;\n\t}", "public function moveUploadedFile($directory, UploadedFile $uploadedFile)\n {\n// $basename = bin2hex(random_bytes(8)); // see http://php.net/manual/en/function.random-bytes.php\n// $filename = sprintf('%s.%0.8s', $basename, $extension);\n $uploadedFile->moveTo($directory . DIRECTORY_SEPARATOR . $uploadedFile->getClientFilename());\n }", "public function upload()\n {\n if (null === $this->getImg()) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and target filename as params\n $this->getImg()->move(\n self::SERVER_PATH_TO_PRESS_IMAGE_FOLDER,\n $this->getImg()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->imageUrl = $this->getImg()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->setImg(null);\n }", "function move_uploaded_file_to_temp_directory($file, $destination_sufix_name) {\n do {\n $temp_destination = WORK_PATH.'/'.make_string(10).'_'.$destination_sufix_name;\n } while (is_file($temp_destination));\n \n if (move_uploaded_file($file, $temp_destination)) {\n return $temp_destination;\n } // if\n\n return false;\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->id . '.' .$this->ext\n );\n\n // set the ext property to the filename where you've saved the file\n //$this->ext = $this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->image) {\n return;\n }\n\n // we use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the target filename to move to\n $this->file->move($this->getUploadRootDir(), $this->image->getClientOriginalName());\n\n // set the path property to the filename where you'ved saved the file\n $this->path = $this->image->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $filename = substr( md5(rand()), 0, 15).'.'.$this->getFile()->guessExtension();\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $filename\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $filename;\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "function move_file($path) {\n $pathto = 'upload/'.$path;\n move_uploaded_file( $_FILES['new_file']['tmp_name'], $pathto) or\n die( \"Le format du fichier n\\'est pas compatibe !\");\n\n return $pathto;\n}", "public function upload(): void\n {\n // check if we have an old image\n if ($this->oldFileName !== null) {\n $this->removeOldFile();\n }\n\n if (!$this->hasFile()) {\n return;\n }\n\n $this->writeFileToDisk();\n\n $this->file = null;\n }", "private function moveFile($old_file, $new_file)\n {\n if (!file_exists($old_file)) {\n return;\n }\n\n if (!is_dir(dirname($new_file))) {\n mkdir(dirname($new_file), 0755, true);\n }\n\n // move the file to the archive folder\n rename($old_file, $new_file);\n }", "public function move($source, $target)\n {\n \n }", "public function upload()\n{\n if(null === $this->getFile())\n {\n return;\n }\n\n $this->getFile()->move(\n self::SERVER_PATH_TO_IMAGE_FOLDER,\n $this->getFile()->getClientOriginalName()\n );\n\n $this->filename =$this->getFile()->getClientOriginalName();\n\n $this->setFile(null);\n}", "public function move($modify = 'original',$overwrite = false) {\n\t$path = $this->_destination;\n\n\tif ($this->_uploaded) {\n\t\t$field = current($this->_uploaded);\n\t\tif (is_array($field['name'])) {\n\t\t\tforeach ($field['name'] as $number => $filename) {\n\t\t\t\t// process multiple upload\n\t\t\t\t$this->_renamed = false;\n\t\t\t\t$this->processFile($filename, $field['error'][$number], $field['size'][$number], $field['type'][$number], $field['tmp_name'][$number], $path, $modify, $overwrite);\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$this->processFile($field['name'], $field['error'], $field['size'], $field['type'], $field['tmp_name'], $path, $modify, $overwrite);\n\t\t}\n\t}\n }", "public function move_to_slideshow_dir()\n\t{\n\t\t\n\t\t$file_name = substr($this->file_handler[\"name\"], 0, strrpos($this->file_handler[\"name\"], \".\"));\n\t\t$file_name = $file_name . \"-\" . time();\n\t\t$file_name = $file_name . \".\" . pathinfo($this->file_handler['name'], PATHINFO_EXTENSION);\n\t\t$file_name = strtolower($file_name);\n\t\t\n\t\t$new_file_name = $this->base_path . $file_name;\n\n\t\t\n\t\tif(move_uploaded_file($this->file_handler[\"tmp_name\"], $new_file_name))\n\t\t\treturn $this->relative_path . $file_name;\n\t\telse\n\t\t\treturn false;\n\t}", "public static function move($_path, $_target)\r\n {\r\n return rename($_path, $_target);\r\n }", "public function upload()\n {\n if (null === $this->file) {\n return;\n }\n\n if(!is_dir($this->getTargetUploadRootDir())){\n mkdir($this->getTargetUploadRootDir(), 0777, true);\n }\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getTargetUploadRootDir(),\n $this->file->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = date('Y-m-d').DIRECTORY_SEPARATOR.$this->id.DIRECTORY_SEPARATOR.$this->file->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "function move_temp_file($file, $to)\n {\n if (\\Storage::disk('local')->exists($file)){\n $path = \\Storage::disk('local')->move($file, $to);\n\n return $path? : $to;\n }\n return null;\n }", "protected function onMove(){\n\t\tif (empty($this->post['directory']) || empty($this->post['file'])) return;\n\t\t\n\t\t$rename = empty($this->post['newDirectory']) && !empty($this->post['name']);\n\t\t$dir = $this->getDir($this->post['directory']);\n\t\t$file = realpath($dir . '/' . $this->post['file']);\n\t\t\n\t\t$is_dir = is_dir($file);\n\t\tif (!$this->checkFile($file) || (!$rename && $is_dir))\n\t\t\treturn;\n\t\t\n\t\tif ($rename || $is_dir){\n\t\t\tif (empty($this->post['name'])) return;\n\t\t\t$newname = $this->getName($this->post['name'], $dir);\n\t\t\t$fn = 'rename';\n\t\t}else{\n\t\t\t$newname = $this->getName(pathinfo($file, PATHINFO_FILENAME), $this->getDir($this->post['newDirectory']));\n\t\t\t$fn = !empty($this->post['copy']) ? 'copy' : 'rename';\n\t\t}\n\t\t\n\t\tif (!$newname) return;\n\t\t\n\t\t$ext = pathinfo($file, PATHINFO_EXTENSION);\n\t\tif ($ext) $newname .= '.' . $ext;\n\t\t$fn($file, $newname);\n\t\t\n\t\techo json_encode(array(\n\t\t\t'name' => pathinfo($this->normalize($newname), PATHINFO_BASENAME),\n\t\t));\n\t}", "public function moveFile($filename, $key);", "public function upload() {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(), $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->photo = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function moveFile($oldPath, $newPath, $filename)\n {\n // TODO: Implement moveFile() method.\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->backgroundImage = $this->getFile()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "protected function writeFileToDisk(): void\n {\n $this->getFile()->move($this->getUploadRootDir(), $this->fileName);\n }", "protected function moveUploadedFile($filename, $destination)\n\t{\n\t\treturn move_uploaded_file($filename, $destination);\n\t}", "public function uploadImage() \n {\n if (is_null($this->image)) {\n return;\n }\n \n // move image from temp directory to destination one\n $this->image->move(\n $this->getUploadRootDir(),\n $this->image->getClientOriginalName()\n );\n\n $this->path = $this->image->getClientOriginalName();\n $this->image = null;\n }", "public function upload()\n{\n // The file property can be empty if the field is not required\n if (null === $this->file) {\n return;\n }\n\n // Use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->file->move(\n $this->getUploadRootDir(),\n $this->path\n );\n\n // Set the path property to the filename where you've saved the file\n //$this->path = $this->file->getClientOriginalName();\n\n // Clean up the file property as you won't need it anymore\n $this->file = null;\n}", "public function upload4()\n {\n if(null === $this->getFile4()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $fname = md5(rand(0,100000) . $this->getFile4()->getClientOriginalName()) . '-' . $this->getFile4()->getClientOriginalName();\n\n $this->getFile4()->move(\n $this->getUploadRootDir(),\n $fname\n );\n\n // set the path property to the filename where you've saved the file\n $this->lawLabel = $fname;\n\n // clean up the file property as you won't need it anymore\n $this->file4 = null;\n }", "public function moveTo(FileNode $from, FileNode $to);", "protected function moveFile($file)\n {\n if (!$file->isValid()) {\n return '';\n }\n \n return $file->store(config('codegenerator_custom.files_upload_path'), config('filesystems.default'));\n }", "function _archiveFile() {\n\t\t$this->_moveFile($this->_processingPath, $this->_archivePath, $this->_claimedFilename);\n\t}", "private function move(UploadedFile $uploadedFile)\n {\n $now = Carbon::now('UTC');\n $date = $now->format('Y-m-d');\n $time = $now->format('H-i-s-v'); // Change timestamp format to control rate limit.\n $fileId = $this->id ?? 0;\n $userId = $this->user_id ?? $this->session_id;\n $mode = $this->mode ?? 0;\n $directory = self::PRIVATE_STORAGE.DIRECTORY_SEPARATOR.$date;\n $extension = pathinfo($this->name, PATHINFO_EXTENSION) ?? 'tmp';\n $inputFileName = implode('-', [$date, $time, $mode, $userId, $fileId]).'-input.'.$extension;\n $outputFileName = implode('-', [$date, $time, $mode, $userId, $fileId]).'-output.'.$extension;\n if (!$this->getStorage()->exists($directory)) {\n $this->getStorage()->makeDirectory($directory);\n }\n $realDir = storage_path('app'.DIRECTORY_SEPARATOR.$directory);\n $realInputFileDestination = $realDir.DIRECTORY_SEPARATOR.$inputFileName;\n $realOutputFileDestination = $realDir.DIRECTORY_SEPARATOR.$outputFileName;\n if (\n $this->getStorage()->exists($realInputFileDestination)\n || $this->getStorage()->exists($realOutputFileDestination)\n ) {\n // More than one file by type, user and time. Likely DoS attack.\n throw new Exception('Too many files are being uploaded by the same user at once.');\n }\n\n // Move the file and save the new location.\n $uploadedFile->move($realDir, $inputFileName);\n $this->input_location = $realInputFileDestination;\n $this->output_location = $realOutputFileDestination;\n\n $this->save();\n\n return $this;\n }", "public function move($source, $dest);", "public function moveTo($destination) {}", "protected function moveUploadToDestination($tmp_path, $target_name, $upload_dir, $target_dims=null, $target_ext='', $sub_dir='')\n\t{\n\t\tif ($target_dims===null) {\n\t\t\t$target_dims = new ImageDims();\n\t\t}\n\t\tif ($target_dims->width>0 || $target_dims->height>0) {\n\t\t\t/* move image to get at its contents */\n\t\t\t$tmp_upload_path = $upload_dir.\"tmp_\".$target_name;\n\t\t\tif (!move_uploaded_file($tmp_path, $tmp_upload_path)) {\n\t\t\t\tthrow new OperationAbortedException(\"Error moving uploaded file.\");\n\t\t\t}\n\n\t\t\t$this->formatUniquePath($upload_dir, $target_name);\n\t\t\t$this->resample($tmp_upload_path, $target_name, $target_dims, $target_ext, $sub_dir, true);\n\t\t}\n\t\telse {\n\t\t\tparent::moveUploadToDestination($tmp_path, $target_name, $upload_dir);\n\t\t}\n\t}", "public function upload3()\n {\n if(null === $this->getFile3()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $fname = md5(rand(0,100000) . $this->getFile3()->getClientOriginalName()) . '-' . $this->getFile3()->getClientOriginalName();\n\n $this->getFile3()->move(\n $this->getUploadRootDir(),\n $fname\n );\n\n // set the path property to the filename where you've saved the file\n $this->path3 = $fname;\n\n // clean up the file property as you won't need it anymore\n $this->file3 = null;\n }", "public function move($path){\n\t\t$oldPath = $this->path;\n\t\t$path_array = explode(self::DS, $this->path);\n\t\t$fileName = $path_array[sizeof($path_array) - 1];\n\t\t$newPath = $path . self::DS . $fileName;\n\t\t$this->path = $newPath;\n\t\t$this->createFile($newPath);\n\t\tunlink($oldPath);\n\t}", "function upload_file() {\n upload_file_to_temp();\n }", "function _moveFile($sourceDir, $destDir, $filename) {\n\t\t$currentFilePath = $sourceDir . DIRECTORY_SEPARATOR . $filename;\n\t\t$destinationPath = $destDir . DIRECTORY_SEPARATOR . $filename;\n\n\t\tif (!rename($currentFilePath, $destinationPath)) {\n\t\t\t$message = __('admin.fileLoader.moveFileFailed', array('filename' => $filename,\n\t\t\t\t'currentFilePath' => $currentFilePath, 'destinationPath' => $destinationPath));\n\t\t\t$this->addExecutionLogEntry($message, SCHEDULED_TASK_MESSAGE_TYPE_ERROR);\n\n\t\t\t// Script should always stop if it can't manipulate files inside\n\t\t\t// its own directory system.\n\t\t\tfatalError($message);\n\t\t}\n\n\t\treturn $destinationPath;\n\t}", "private function moveUploadedFile($postedFile, $suffix = '.tar', $timeToLive = 3)\n\t{\n\t\tif (\n\t\t\tisset($postedFile['tmp_name']) &&\n\t\t\t\\file_exists($postedFile['tmp_name'])\n\t\t)\n\t\t{\n\t\t\t/** @var Translate\\IO\\File $tmpFile */\n\t\t\t$tmpFile = Translate\\IO\\File::generateTemporalFile('translate', $suffix, $timeToLive);\n\t\t\tif (@\\copy($postedFile['tmp_name'], $tmpFile->getPhysicalPath()))\n\t\t\t{\n\t\t\t\t$this->archiveFileType = $suffix;\n\t\t\t\t$this->archiveFilePath = $tmpFile->getPhysicalPath();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t$this->addError(new Main\\Error(Loc::getMessage('TR_IMPORT_EMPTY_FILE_ERROR')));\n\n\t\treturn false;\n\t}", "function __move_file($file, $from, $to){\n\t\t\n\t\t$date = date('Y-m-d H:i:s');\n\t\t$method = 'UploadComponent'; \n\t\t$message = \"$date - $method: __move_file: moving... $from$file\";\n\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\t\t\t\n\t\t\t\t\n\t\tif(file_exists($from . $file)){\n\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t$method = 'UploadComponent'; \n\t\t\t$message = \"$date - $method: __move_file: file exists!!\";\n\t\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\t\t\t\n\t\t\t//$resp = copy($from.$file, $to.'temp_local.pdf');\n\t\t\t$resp = copy($from.$file, $to.$file);\n\t\t\t\n\t\t\t$content = file_get_contents($to.'temp_local.pdf');\n\t\t\t//file_put_contents('/10.252.76.182'.$to.'temp.pdf', $content);\n\t\t\t//$resp = copy($from.$file, '/10.252.76.182'.$to.'temp.pdf');\n\t\t\t\n\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t$method = 'UploadComponent'; \n\t\t\t$message = \"$date - $method: __move_file: copying file... $to$file -$resp-\";\n\t\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\t\t\t\n\t\t\treturn $resp;\n\t\t}\n\t\t\n\t\t\t$date = date('Y-m-d H:i:s');\n\t\t\t$method = 'UploadComponent'; \n\t\t\t$message = \"$date - $method: __move_file: file no exists :(\";\n\t\t\terror_log(\"$message\\n\", 3, \"/var/www/correspondenciaestatal.gob.pa/html/tmp/logs/info_uploads.log\");\n\t\treturn false;\n\t}", "function move($source, $destination);", "public function upload(){\n if (null === $this->getProductsFileImage()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getProductsFileImage()->move(\n $this->getUploadRootDir(),\n $this->getProductsFileImage()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = $this->getProductsFileImage()->getClientOriginalName();\n $this->productsImage = $this->getProductsFileImage()->getClientOriginalName();\n\n // clean up the file property as you won't need it anymore\n $this->productsFileImage = null;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n// use the original file name here but you should\n// sanitize it at least to avoid any security issues\n// move takes the target directory and then the\n// target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n// set the path property to the filename where you've saved the file\n $this->logo = $this->getFile()->getClientOriginalName();\n// clean up the file property as you won't need it anymore\n $this->file = null;\n\n\n }", "public function moveTo($destination)\n {\n if ($this->exists()) {\n $result = move_uploaded_file($this->current_filepath, $destination);\n\n if ($result) {\n $this->current_filepath = $destination;\n }\n\n return $result;\n }\n return false;\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n $partes_ruta = pathinfo($this->getFile()->getClientOriginalName());\n $this->nombre = md5(uniqid()) . '.' . $partes_ruta['extension'];\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->nombre\n );\n\n $this->url = $this->getWebPath();\n\n // clean up the file property as you won't need it anymore\n $this->file = null;\n }", "public function upload(UploadedFile $file)\n {\n if (null === $file) {\n return;\n }\n\n $file->move(\n $this->getImagesAbsolutePath(),\n $file->getClientOriginalName()\n );\n\n }", "public static function move($path, $toPath, $replace = TRUE) {\n \n }", "public function moveTo($destFileName) {\r\n $newFile = $this->getRealPath($destFileName);\r\n if(file_exists($newFile)) throw new IOException(\"An I/O error occurs, such as the destination file already exists or the destination device is not ready.\");\r\n $this->copyTo($newFile, false);\r\n $this->delete();\r\n }", "public function testMoveFileFromTmpWithMediaStorageDatabase(): void\n {\n $fileName = 'magento_small_image.jpg';\n $storage = $this->objectManager->get(Storage::class);\n $databaseStorage = $this->objectManager->get(Storage\\Database::class);\n $directory = $this->objectManager->get(DatabaseFactory::class)->create();\n // Synchronize media.\n $storage->synchronize(\n [\n 'type' => 1,\n 'connection' => 'default_setup'\n ]\n );\n // Upload file.\n $fixtureDir = realpath(__DIR__ . '/../_files');\n $filePath = $this->tmpDirectory->getAbsolutePath($fileName);\n copy($fixtureDir . DIRECTORY_SEPARATOR . $fileName, $filePath);\n $_FILES['image'] = [\n 'name' => $fileName,\n 'type' => 'image/jpeg',\n 'tmp_name' => $filePath,\n 'error' => 0,\n 'size' => 12500,\n ];\n $result = $this->imageUploader->saveFileToTmpDir('image');\n // Move file from tmp dir.\n $moveResult = $this->imageUploader->moveFileFromTmp($result['name'], true);\n // Verify file moved to new dir.\n $databaseStorage->loadByFilename($moveResult);\n $directory->loadByPath('catalog/category');\n $this->assertEquals('catalog/category', $databaseStorage->getDirectory());\n $this->assertEquals($directory->getId(), $databaseStorage->getDirectoryId());\n }", "function tep_copy_uploaded_file($filename, $target) {\n if (substr($target, -1) != '/') $target .= '/';\n\n $target .= $filename['name'];\n //if (!file_exists($target)) {\n //@mkdir($target);\n //@chmod($target, 0777);\n //}\n move_uploaded_file($filename['tmp_name'], $target);\n chmod($target, 0666);\n}", "public function moving_file_to_back_up_place()\r\n\t{\r\n\t\t$moved_file = array();\r\n\t\t$original_place = $this->get_original_upload_path();\r\n\t\t$back_up_place = $this->get_back_up_path();\r\n\t\t\r\n\t\tif($files = $this->get_folder_file_list($original_place))\r\n\t\t{\r\n\t\t\tforeach($files as $file)\r\n\t\t\t{\r\n\t\t\t\t$new_name = pathinfo($file, PATHINFO_FILENAME) . '_' . date(\"YmdHis\"). '.' . pathinfo($file, PATHINFO_EXTENSION);\r\n\t\t\t\tif(copy($original_place.$file, $back_up_place.$new_name))\r\n\t\t\t\t{\r\n\t\t\t\t\tunlink($original_place.$file);\r\n\t\t\t\t\t$moved_file[] = $back_up_place.$new_name;\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $moved_file;\r\n\t}", "public function move($sourceDir,$sourceFile,$targetDir,$targetFile){\n\t\tif(!$this->connected){\n\t\t\treturn false;\n\t\t}\n\t\treturn $this->apiCall('move',array('sourcedir'=>$sourceDir,'source'=>$sourceFile,'targetdir'=>$targetDir,'target'=>$targetFile),true);\n\t}", "public function moveTo(string $directory, string $name = null)\n {\n if ($this->isValid()) {\n $target = $this->getTargetFile($directory, $name);\n\n if (!@move_uploaded_file($this->getPathname(), $target)) {\n $error = error_get_last();\n\n throw new SpringyException(\n sprintf(\n 'Could not move the file \"%s\" to \"%s\" (%s)',\n $this->getPathname(),\n $target,\n strip_tags($error['message'])\n )\n );\n }\n\n @chmod($target, 0666 & ~umask());\n\n return $target;\n }\n\n throw new SpringyException($this->getErrorMessage());\n }", "public function upload_local_file()\n\t{\n if ($this->local_file) {\n \t$s3 = AWS::createClient('s3');\n $s3->putObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location,\n 'SourceFile' => $this->local_file,\n 'ContentType' => $this->mime,\n 'StorageClass' => $this->storage,\n 'ServerSideEncryption' => $this->encryption\n )\n );\n }\n\t}", "protected function moveFileRequest(Requests\\MoveFileRequest $request)\n {\n // verify the required parameter 'src_path' is set\n if ($request->srcPath === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $srcPath when calling moveFile');\n }\n // verify the required parameter 'dest_path' is set\n if ($request->destPath === null) {\n throw new \\InvalidArgumentException('Missing the required parameter $destPath when calling moveFile');\n }\n\n $resourcePath = '/slides/storage/file/move/{srcPath}';\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n\n // query params\n if ($request->destPath !== null) {\n $queryParams['destPath'] = ObjectSerializer::toQueryValue($request->destPath);\n }\n // query params\n if ($request->srcStorageName !== null) {\n $queryParams['srcStorageName'] = ObjectSerializer::toQueryValue($request->srcStorageName);\n }\n // query params\n if ($request->destStorageName !== null) {\n $queryParams['destStorageName'] = ObjectSerializer::toQueryValue($request->destStorageName);\n }\n // query params\n if ($request->versionId !== null) {\n $queryParams['versionId'] = ObjectSerializer::toQueryValue($request->versionId);\n }\n\n $resourcePath = ObjectSerializer::addPathValue($resourcePath, \"srcPath\", $request->srcPath);\n $this->headerSelector->selectHeaders(\n $headerParams,\n ['application/json'],\n ['application/json']);\n\n return $this->createRequest($resourcePath, $queryParams, $headerParams, $httpBody, 'PUT');\n }", "public function upload()\n {\n if (null === $this->getFile()) {\n return;\n }\n\n // use the original file name here but you should\n // sanitize it at least to avoid any security issues\n\n // move takes the target directory and then the\n // target filename to move to\n $this->getFile()->move(\n $this->getUploadRootDir(),\n $this->getFile()->getClientOriginalName()\n );\n\n // set the path property to the filename where you've saved the file\n $this->path = '/'.$this->getUploadDir().'/'.$this->getFile()->getClientOriginalName();\n //get the file name\n// $file = $this->getFile()->getClientOriginalName();\n// $info = pathinfo($file);\n// $file_name = basename($file,'.'.$info['extension']);\n// $this->name = $file_name ;\n// $this->setName($file_name);\n// // clean up the file property as you won't need it anymore\n// $this->file = null;\n }", "public function upload()\n\t{\n\t\t$field \t\t = $this->getUploadField();\n\t\t$newName \t = $this->getUploadNewName();\n\t\t//$destination = 'assets/images/location';\t\n\t\t$destination = $this->getUploadDestination();\n\n\t\tif (\\Input::hasFile($field))\n\t\t{\n\t\t \\Input::file($field)->move($destination, $newName);\n\t\t}\n\t\t\n\t\t$this->entity->fill([$field => $newName]);\n\t\t$this->entity->save();\n\n\t\treturn true;\n\t}", "public function moveImageFromTmp($file)\n {\n if (strrpos($file, '.tmp') == strlen($file) - 4) {\n $file = substr($file, 0, strlen($file) - 4);\n }\n $destinationFile = $this->getUniqueFileName($file);\n\n /** @var $storageHelper \\Magento\\MediaStorage\\Helper\\File\\Storage\\Database */\n $storageHelper = $this->fileStorageDb;\n\n if ($storageHelper->checkDbUsage()) {\n $storageHelper->renameFile(\n $this->mediaConfig->getTmpMediaShortUrl($file),\n $this->mediaConfig->getMediaShortUrl($destinationFile)\n );\n\n $this->mediaDirectory->delete($this->mediaConfig->getTmpMediaPath($file));\n $this->mediaDirectory->delete($this->getAttributeSwatchPath($destinationFile));\n } else {\n $this->mediaDirectory->renameFile(\n $this->mediaConfig->getTmpMediaPath($file),\n $this->getAttributeSwatchPath($destinationFile)\n );\n }\n\n return str_replace('\\\\', '/', $destinationFile);\n }", "private function _move_image($temp_location)\n {\n $filename = basename($temp_location['name']);\n $info = pathinfo($filename);\n $ext = strtolower($info['extension']);\n \n if (isset($temp_location['tmp_name']) &&\n isset($info['extension']) &&\n in_array($ext, $this->_supported_extensions)) {\n $new_file_path = self::IMAGE_UPLOAD_DIR . DIRECTORY_SEPARATOR . $filename;\n if (!is_dir(self::IMAGE_UPLOAD_DIR) ||\n !is_writable(self::IMAGE_UPLOAD_DIR)) {\n // Attempt to auto-create upload directory.\n if (!is_writable(self::IMAGE_UPLOAD_DIR) ||\n FALSE === @mkdir(self::IMAGE_UPLOAD_DIR, null , TRUE)) {\n throw new Exception('Error: File permission issue, ' .\n 'please consult your system administrator');\n }\n }\n \n if (move_uploaded_file($temp_location['tmp_name'], $new_file_path)) {\n return DIRECTORY_SEPARATOR . $new_file_path;\n }\n }\n \n throw new Exception('File could not be uploaded.');\n }", "public static function move_uploaded_file_in($path,$newname=false){\n\t\t$nfile = $_FILES['localfile']['name'];\n\t\tif(move_uploaded_file($_FILES['localfile']['tmp_name'], getcwd().\"/\".$path.$nfile)){\n\t\t\tif($newname){\n\t\t\t\tEFileSystem::rename_file($path.$nfile,$path.$newname);\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.7310539", "0.7150951", "0.6864969", "0.6847037", "0.67785996", "0.6771532", "0.67586404", "0.6738262", "0.6728246", "0.6677467", "0.66573966", "0.6655904", "0.6587532", "0.6564605", "0.6550274", "0.6543432", "0.6523433", "0.65194196", "0.65148646", "0.6512135", "0.6501361", "0.6491718", "0.6491718", "0.6491718", "0.6491718", "0.6490918", "0.64902246", "0.6475177", "0.64243454", "0.6395709", "0.6388966", "0.63790625", "0.6352943", "0.6337911", "0.63220584", "0.6321515", "0.6288255", "0.6284612", "0.62792724", "0.62740624", "0.627234", "0.62667054", "0.6260751", "0.6241466", "0.6240287", "0.6229789", "0.6208056", "0.62070227", "0.6194533", "0.61930597", "0.61757493", "0.61658275", "0.6136508", "0.6127178", "0.6126539", "0.6114529", "0.6100228", "0.60959387", "0.6074847", "0.60715425", "0.60715055", "0.6069899", "0.60698545", "0.6066484", "0.60378945", "0.6030854", "0.6023572", "0.6020606", "0.60036653", "0.597959", "0.5979402", "0.5976822", "0.59764457", "0.59713155", "0.596832", "0.5958781", "0.59518015", "0.5939088", "0.5937108", "0.5932891", "0.59191537", "0.5914763", "0.5911319", "0.59112096", "0.59096617", "0.59035987", "0.58909696", "0.586692", "0.5861544", "0.5860435", "0.5849295", "0.58371973", "0.5805281", "0.5790008", "0.57836646", "0.5780772", "0.57769114", "0.57658046", "0.5757521", "0.57566005" ]
0.6260347
43
Cleaning filename from nonstandard chars.
protected function SanitizeFilename($Name) { $Name= preg_replace('/[^A-Za-z0-9~_!\|\.\-\+]/', '', $Name); return $Name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sa_sanitize_chars($filename) {\n return strtolower(preg_replace('/[^a-zA-Z0-9-_\\.]/', '', $filename));\n}", "function cleanFileName($filename) {\n\t\t//$name = preg_replace('/[^a-zA-Z0-9.]/', '', $name);\n\t\t//$name = substr($name,0,9);\n\t\t$filename_raw = $filename;\n\t\t$special_chars = array(\"?\", \"[\", \"]\", \"/\", \"\\\\\", \"=\", \"<\", \">\", \":\", \";\", \",\", \"'\", \"\\\"\", \"&\", \"$\", \"#\", \"*\", \"(\", \")\", \"|\", \"~\", \"`\", \"!\", \"{\", \"}\", chr(0));\n\t\t$filename = preg_replace( \"#\\x{00a0}#siu\", ' ', $filename );\n\t\t$filename = str_replace($special_chars, '', $filename);\n\t\t$filename = preg_replace('/[\\s-]+/', '-', $filename);\n\t\t$filename = trim($filename, '.-_');\n\t\t$filename = str_replace(' ', '-', $filename);\n\t\treturn $filename;\n\t}", "public function sanitizeFileNameNonUTF8FilesystemDataProvider() {}", "function wpartisan_sanitize_file_name( $filename ) {\n\n $sanitized_filename = remove_accents( $filename ); // Convert to ASCII \n // Standard replacements\n $invalid = array(\n ' ' => '-',\n '%20' => '-',\n '_' => '-',\n );\n $sanitized_filename = str_replace( array_keys( $invalid ), array_values( $invalid ), $sanitized_filename );\n \n $sanitized_filename = preg_replace('/[^A-Za-z0-9-\\. ]/', '', $sanitized_filename); // Remove all non-alphanumeric except .\n $sanitized_filename = preg_replace('/\\.(?=.*\\.)/', '', $sanitized_filename); // Remove all but last .\n $sanitized_filename = preg_replace('/-+/', '-', $sanitized_filename); // Replace any more than one - in a row\n $sanitized_filename = str_replace('-.', '.', $sanitized_filename); // Remove last - if at the end\n $sanitized_filename = strtolower( $sanitized_filename ); // Lowercase\n \n return $sanitized_filename;\n}", "public static function sanitizeFileName($filename)\n {\n $special_chars = array(\n '\\\\', '/', ':', '*', '?', '\"', '<', '>', '|',\n '+', ' ', '%', '!', '@', '&', '$', '#', '`',\n ';', '(', ')', chr(0)\n );\n\n $filename = preg_replace(\"#\\x{00a0}#siu\", ' ', $filename); // non-breaking space\n $filename = str_replace($special_chars, '_', $filename);\n\n return $filename;\n }", "function cleanFileName($fileName)\n {\n // remove all special chars and keep only alphanumeric chars\n $fileName = preg_replace(\"/[^a-zA-Z0-9- .]/\", \"\", trim($fileName));\n // replace multiple white spaces with single white space\n $fileName = preg_replace(\"/\\s+/\", \" \", $fileName);\n // replace multiple dashes with single dash\n $fileName = preg_replace('/-+/', '-', $fileName);\n // again remove special chars from the beginning of the string in case it contains\n // special chars in the beginning after clean-up\n $fileName = preg_replace('/(^([^a-zA-Z0-9])*|([^a-zA-Z0-9])*$)/', '', $fileName);\n return $fileName;\n }", "function clean($filename) \n {\n return preg_replace('/[^0-9a-z\\.\\_\\-]/i','', strtolower($filename));\n }", "function clean_filename($filename)\n\t{\n//replaces all characters that are not alphanumeric with the exception of the . for filename usage\n\t\t$realname = preg_replace(\"/[^a-zA-Z0-9\\.]/\", \"\", strtolower($filename));\n\t\treturn $realname;\n\t}", "function filter_filename($name) {\n $name = str_replace(array_merge(\n array_map('chr', range(0, 31)),\n array('<', '>', ':', '\"', '/', '\\\\', '|', '?', '*','\\'')\n ), '', $name);\n // maximise filename length to 255 bytes http://serverfault.com/a/9548/44086\n $ext = pathinfo($name, PATHINFO_EXTENSION);\n $name= mb_strcut(pathinfo($name, PATHINFO_FILENAME), 0, 255 - ($ext ? strlen($ext) + 1 : 0), mb_detect_encoding($name)) . ($ext ? '.' . $ext : '');\n return $name;\n}", "public function sanitizeFileNameUTF8FilesystemDataProvider() {}", "function sanitize_filename($filename) {\n\t// Remove any trailing dots, as those aren't ever valid file names.\n\t$filename = rtrim($filename, '.');\n\n\t$regex = array('#(\\.){2,}#', '#[^A-Za-z0-9\\.\\_\\- ]#', '#^\\.#');\n\t$filename = trim(preg_replace($regex, '', $filename));\n\t$filename = str_replace(' ', '-', $filename);\n\n\treturn $filename;\n}", "function wc_upload_sanitize_accents($filename) {\n\n\t\treturn remove_accents($filename);\n\t}", "function sanitize_file_name( $filename ) {\n\treturn preg_replace(\"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\].]|[\\.]{2,})\", '_', $filename);\n}", "public function cleanFileName($fileName)\n {\n // Handle UTF-8 characters\n if ($GLOBALS['TYPO3_CONF_VARS']['SYS']['UTF8filesystem']) {\n // allow \".\", \"-\", 0-9, a-z, A-Z and everything beyond U+C0 (latin capital letter a with grave)\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . ']/u', '_', trim($fileName));\n } else {\n $fileName = GeneralUtility::makeInstance(CharsetConverter::class)->specCharsToASCII('utf-8', $fileName);\n // Replace unwanted characters by underscores\n $cleanFileName = preg_replace('/[' . self::UNSAFE_FILENAME_CHARACTER_EXPRESSION . '\\\\xC0-\\\\xFF]/', '_', trim($fileName));\n }\n // Strip trailing dots and return\n return rtrim($cleanFileName, '.');\n }", "function safe_filename($str) {\n\t\t$arrRepl = array('č' => 'c', 'Č' => 'C', 'ć' => 'c', 'Ć' => 'C', 'Ž' => 'Z', 'ž' => 'z', 'đ' => 'dj', 'Đ' => 'Dj', 'š' => 's', 'Š' => 'S', );\n\t\t$str = strtr($str, $arrRepl);\n\t\t$str = preg_replace('#[^\\w\\d.]+#', '_', $str);\n\t\treturn $str;\n\t}", "public function cleanFilename($filename = '')\n {\t\n \tif ($filename != '')\n \t{\n\t \t// Add spaces to ending HTMl tags\n\t \t$filename = preg_replace(\"/<\\/([^\\s])>/\", \"</$1> \", $filename);\n\t \t\n\t \t// Strip tags\n\t \t$filename = strip_tags($filename);\n\t \t\n\t \t// Convert all HTML entities\n\t \t$filename = html_entity_decode($filename);\n\t \t\n\t \t// Replace any white space\n\t \t$filename = preg_replace(\"/[\\r\\n\\t\\s]+/s\", \"-\", $filename);\n\t \t\n\t \t// Replace any dashes\n\t \t$filename = preg_replace(\"/[\\-]+/s\", \"-\", $filename);\n\t \t$filename = str_replace('--', '-', $filename);\n\t \t\n\t \t// Convert to lowercase\n\t \t$filename = strtolower($filename);\n\t \t\n\t \t// Remove any unexpected characters\n\t \t$filename = preg_replace(\"/[^a-zA-Z0-9\\-]?/\", \"\", $filename);\n\t }\n \n \treturn $filename;\n }", "function sanitize_filename(\n string $fileName,\n bool $sanitizeForPath = false,\n string $charToReplaceWhiteSpace = ' '\n): string {\n //check whitespace\n $fileName = str_replace(' ', $charToReplaceWhiteSpace, $fileName);\n\n // Remove any runs of periods - avoid Path Traversal Vulnerabilities OSWAP\n // https://www.owasp.org/index.php/Path_Traversal\n $notAllowedPath = [\n '//',\n '\\\\\\\\',\n '../',\n './',\n '..\\\\',\n '.\\\\',\n '%2e%2e%2f',\n '%2e%2e/',\n '..%2f',\n '%2e%2e%5c',\n '%2e%2e\\\\',\n '..%5c',\n '%252e%252e%255c',\n '..%255c',\n '..%c0%af',\n '..%c1%9c',\n ];\n while (str_contains_arrayEx($fileName, $notAllowedPath) !== false) {\n $fileName = str_replace($notAllowedPath, '', $fileName);\n }\n\n // Remove anything which isn't a word, whitespace, number\n // or any of the following caracters -_~,;[]().\n // If you don't need to handle multi-byte characters\n // you can use preg_replace rather than mb_ereg_replace\n // Thanks @Łukasz Rysiak!\n $fileName = mb_ereg_replace('([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).' . ($sanitizeForPath ? '\\\\/' : '') . '])', '', $fileName);\n\n // remove exadecimal, non white space chars\n $fileName = mb_ereg_replace('([[:cntrl:]\\b\\0\\n\\r\\t\\f])', '', $fileName);\n\n //normalize and trim\n $fileName = trim(normalizeUtf8String($fileName));\n\n //do not start with ..\n while (starts_withEx($fileName, '..') !== false) {\n $fileName = substr($fileName, 2);\n }\n\n //do not end with ..\n while (ends_withEx($fileName, '..') !== false) {\n $fileName = substr($fileName, 0, -2);\n }\n //do not end with .\n while (ends_withEx($fileName, '.') !== false) {\n $fileName = substr($fileName, 0, -1);\n }\n\n return $fileName;\n}", "public static function sanitize_file_name( $name ) {\n\t\t$name = strtolower( $name );\n\t\t$name = preg_replace('/&.+?;/', '', $name); // kill entities\n\t\t$name = str_replace( '_', '-', $name );\n\t\t$name = preg_replace('/[^a-z0-9\\s-.]/', '', $name);\n\t\t$name = preg_replace('/\\s+/', '-', $name);\n\t\t$name = preg_replace('|-+|', '-', $name);\n\t\t$name = trim($name, '-');\n\t\treturn $name;\n\t}", "function sanitize_filename(string $str = null, string $replace = '-')\n{\n if (!$str) {\n return bin2hex(random_bytes(4));\n }\n // Remove unwanted chars\n $str = mb_ereg_replace(\"([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).])\", $replace, $str);\n // Replace multiple dots by custom char\n $str = mb_ereg_replace(\"([\\.]{2,})\", $replace, $str);\n return $str;\n}", "function normalize($filename) {\n $maxlength = 20;\n $strippedString = preg_replace(\"/[^A-Za-z0-9_\\-]/\", \"\", $filename);\n return substr($strippedString, 0, min(strlen($strippedString), $maxlength));\n}", "function sanitize_file_name($filename)\n {\n }", "function cmk_sanitize_filename_on_upload($filename) {\n $ext = end(explode('.',$filename));\n // Reemplazar todos los caracteres extranos.\n $sanitized = preg_replace('/[^a-zA-Z0-9-_.]/','', substr($filename, 0, -(strlen($ext)+1)));\n // Replace dots inside filename\n $sanitized = str_replace('.','-', $sanitized);\n return strtolower($sanitized.'.'.$ext);\n}", "public function cleanFilename($filename)\n {\n $filename = str_replace('\\\\', '/', $filename ?? '');\n\n // Since we use double underscore to delimit variants, eradicate them from filename\n return preg_replace('/_{2,}/', '_', $filename ?? '');\n }", "public static function cleanFilename($dirty_filename) {\n $split = explode('.', $dirty_filename);\n $ext = array_pop($split);\n return \\Str::slug(urldecode( implode('.', $split) )).'.'.$ext;\n }", "function standardizeFileName($string){\n $partes \t= explode(\".\", $string);\n $extensao = $partes[count($partes)-1];\t\n // somente o nome do arquivo\n $inome = preg_replace('/\\.[^.]*$/', '', $string);\t\n // removendo simbolos, acentos etc\n $a = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýýþÿŔŕ?';\n $b = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuuyybyRr-';\n $inome = strtr($inome, utf8_decode($a), $b);\n $inome = str_replace(\".\",\"-\",$inome);\n $inome = preg_replace( \"/[^0-9a-zA-Z\\.]+/\",'-',$inome);\n return utf8_decode(strtolower($inome.\".\".$extensao));\n}", "public function cleanFilename($filename)\n {\n $filename = str_replace('\\\\', '/', $filename);\n\n // There's not really any relevant cleaning rule for legacy. It's not important any way because we won't be\n // generating legacy URLs, aside from maybe for testing.\n return $filename;\n }", "public static function sanitize($filename) {\n\t\t$replace_chars = array(\n\t\t\t'Š'=>'S', 'š'=>'s', 'Ð'=>'Dj','Ž'=>'Z', 'ž'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A',\n\t\t\t'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'E', 'Ì'=>'I', 'Í'=>'I', 'Î'=>'I',\n\t\t\t'Ï'=>'I', 'Ñ'=>'N', 'Ò'=>'O', 'Ó'=>'O', 'Ô'=>'O', 'Õ'=>'O', 'Ö'=>'O', 'Ø'=>'O', 'Ù'=>'U', 'Ú'=>'U',\n\t\t\t'Û'=>'U', 'Ü'=>'U', 'Ý'=>'Y', 'Þ'=>'B', 'ß'=>'Ss','à'=>'a', 'á'=>'a', 'â'=>'a', 'ã'=>'a', 'ä'=>'a',\n\t\t\t'å'=>'a', 'æ'=>'a', 'ç'=>'c', 'è'=>'e', 'é'=>'e', 'ê'=>'e', 'ë'=>'e', 'ì'=>'i', 'í'=>'i', 'î'=>'i',\n\t\t\t'ï'=>'i', 'ð'=>'o', 'ñ'=>'n', 'ò'=>'o', 'ó'=>'o', 'ô'=>'o', 'õ'=>'o', 'ö'=>'o', 'ø'=>'o', 'ù'=>'u',\n\t\t\t'ú'=>'u', 'û'=>'u', 'ý'=>'y', 'ý'=>'y', 'þ'=>'b', 'ÿ'=>'y', 'ƒ'=>'f'\n\t\t);\n\t\t$f = strtr($filename, $replace_chars);\n\n\t\t// convert & to \"and\", @ to \"at\", and # to \"number\"\n\t\t//\n\t\t$f = preg_replace(array('/[\\&]/', '/[\\@]/', '/[\\#]/'), array('-and-', '-at-', '-number-'), $f);\n\t\t$f = preg_replace('/[^(\\x20-\\x7F)]*/','', $f); // removes any special chars we missed\n\t\t$f = str_replace(' ', '-', $f); // convert space to hyphen\n\t\t$f = str_replace('\\'', '', $f); // removes apostrophes\n\t\t$f = preg_replace('/[^\\w\\-\\.]+/', '', $f); // remove non-word chars (leaving hyphens and periods)\n\t\t$f = preg_replace('/[\\-]+/', '-', $f); // converts groups of hyphens into one\n\t\treturn strtolower($f);\n\t}", "function sanitize_pathname(string $pathName, string $charToReplaceWhiteSpace): string\n{\n return sanitize_filename($pathName, true, $charToReplaceWhiteSpace);\n}", "protected function filterFilename($value) {\n $value = str_replace(\" \", \"-\", $value);\n $value = str_replace([\"å\", \"ä\", \"ö\", \"Å\", \"Ä\", \"Ö\"], [\"a\", \"a\", \"o\", \"A\", \"A\", \"O\"], $value);\n $value = preg_replace(\"/[^a-z0-9\\-\\_\\.]/i\", \"\", $value);\n return $value;\n }", "function strip_File($FileName) {\n\t//$arrItems = array(\" \", \"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"(\",\")\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$arrItems = array(\"`\", \"~\", \"!\",\"@\",\"#\",\"$\",\"^\",\"&\",\"*\",\"+\",\"=\",\"{\",\"}\",\"[\",\"]\",\"|\",\"'\",\";\",\"\\\\\",\"<\",\">\",\"&\",\"\\\"\",\"'\");\n\t$FileName = str_replace($arrItems, \"_\", $FileName);\n\t$FileName = urldecode($FileName);\n\t$FileName = str_replace(\"%\", \"_\", $FileName);\n\treturn $FileName;\n}", "private static function strip_to_valid_filename( $string ) {\r\n\t\t\tif ( !mb_detect_encoding( $string, 'UTF-8', true ) ) {\r\n\t\t\t\treturn self::uniqString( 12 );\r\n\t\t\t}\r\n\t\t\t$string = preg_replace( '/[^\\w-.]/', '', $string );\r\n\t\t\treturn substr( $string, 0, 100 );\r\n\t\t}", "public static function sanitizeFileName(string $filename)\n {\n return Str::replace([' ', '(', ')'], ['-', '', ''], $filename);\n }", "public static function sanitize($filename)\n {\n // Remove anything which isn't a word, whitespace, number\n // or any of the following caracters -_,;[]().\n $filename = mb_ereg_replace(\"([^\\w\\s\\d\\-_,;\\[\\]\\(\\).])\", '', $filename);\n // Remove any runs of periods\n $filename = mb_ereg_replace(\"([\\.]{2,})\", '', $filename);\n\n return new Str($filename);\n }", "function sanitize_filename_on_upload($filename) {\n $exp = explode('.', $filename);\n $ext = end($exp);\n // Replace all weird characters\n $sanitized = preg_replace('/[^a-zA-Z0-9-_.]/', '', substr($filename, 0, -(strlen($ext) + 1)));\n // Replace dots inside filename\n $sanitized = str_replace('.', '-', $sanitized);\n return strtolower($sanitized . '.' . $ext);\n}", "function cleanFileName($str) {\n $str = strtolower($str);\n $ext_point = strrpos($str,\".\");\n if ($ext_point===false) return false;\n $ext = substr($str,$ext_point,strlen($str));\n $str = substr($str,0,$ext_point);\n\n return preg_replace(\"/[^a-z0-9-]/\",\"_\",$str).$ext;\n}", "public static function sanitize($filename)\n {\n return str_replace([' ', '\"', '\\'', '&', '/', '\\\\', '?', '#'], '-', $filename);\n }", "function txt_filename_clean( $t )\n\t{\n\t\t$t = $this->txt_alphanumerical_clean( $t, '.' );\n\t\t$t = preg_replace( '#\\.{1,}#s', '.', $t );\n\t\t\n\t\treturn $t;\n }", "public function sanitize_filename($filename){\n\t\t\t$filename = preg_replace($this->file_uploading_settings['filename_sanitize'], '', $filename);\n\n\t\t\treturn $filename;\n\t\t}", "public static function cleanFilename($fileName)\r\n {\r\n $fileName = str_replace('../', '', $fileName);\r\n $fileName = str_replace('./', '', $fileName);\r\n $fileName = str_replace(' ', '_', $fileName);\r\n return $fileName;\r\n }", "public static function cleanNameToFilename($s) {\n return str_replace(['/', '_',], ['-', '-'], $s);\n }", "static public function sanitizeFileName( $sFileName, $sReplacement='_' ) {\n \n // Remove anything which isn't a word, whitespace, number\n // or any of the following caracters -_~,;:[](). \n $sFileName = preg_replace( \"([^\\w\\s\\d\\-_~,;:\\[\\]\\(\\).])\", $sReplacement, $sFileName );\n \n // Remove any runs of periods.\n return preg_replace( \"([\\.]{2,})\", '', $sFileName );\n \n }", "public static function cleanForFilename(?string $string): string\n {\n if (null === $string) {\n return '';\n }\n\n return (new UnicodeString($string))\n ->ascii()\n ->trim()\n ->replaceMatches('#([^a-zA-Z0-9\\.]+)#', '_')\n ->lower()\n ->toString()\n ;\n }", "function cleanFilename($inc_filename='')\n{\n\t$SafeFile = $inc_filename; \n\t$SafeFile = str_replace('#', 'No.', $SafeFile); \n\t$SafeFile = str_replace('$', 'Dollar', $SafeFile); \n\t$SafeFile = str_replace('%', 'Percent', $SafeFile); \n\t$SafeFile = str_replace('^', '', $SafeFile); \n\t$SafeFile = str_replace('&', 'and', $SafeFile); \n\t$SafeFile = str_replace('*', '', $SafeFile); \n\t$SafeFile = str_replace('?', '', $SafeFile); \n\n\t$uploaddir = 'tmp/'; \n\t$path = $uploaddir.$SafeFile;\n\treturn $path;\n}", "function sanitizeFileName($fileName)\n{\n\t//sanitize, remove double dot .. and remove get parameters if any\n\t$fileName = __DIR__ . '/' . preg_replace('@\\?.*$@' , '', preg_replace('@\\.{2,}@' , '', preg_replace('@[^\\/\\\\a-zA-Z0-9\\-\\._]@', '', $fileName)));\n\treturn $fileName;\n}", "private function _escape_filename($filename)\n {\n return str_replace('/', '', $filename);\n }", "function file_ext_strip($filename){\n\t return preg_replace('/.[^.]*$/', '', $filename);\n\t}", "public static function prepare_filename($p_filename)\r\n {\r\n return preg_replace(\r\n [\r\n '/[^a-zA-Z0-9_\\.-]/',\r\n '/[-]+/',\r\n '/^-|-$/'\r\n ],\r\n [\r\n '-',\r\n '-',\r\n ''\r\n ],\r\n isys_glob_replace_accent(strtolower($p_filename))\r\n );\r\n }", "function upload_sanitize_identifier($identifier) {\n\treturn preg_replace('/[^0-9a-zA-Z_-]/im', '', $identifier);\n}", "public function makeValidFileName($sFilename)\n {\n $sFilename = preg_replace('/[\\s]+/', '_', $sFilename);\n $sFilename = preg_replace('/[^a-zA-Z0-9_\\.-]/', '', $sFilename);\n\n return str_replace(' ', '_', $sFilename);\n }", "private function cleanFilename($filename)\n\t{\n\t\t$filenameParts = explode('.', $filename);\n\t\t$filenameParts[0] = str_slug($filenameParts[0]);\n\n\t\treturn implode('.', $filenameParts);\n\t}", "private function sanitize(string $fname) : string\n {\n $fname = trim($fname);\n\n if ($fname !== '') {\n // should only contains letters, figures or dot/minus/underscore or a slash\n if (!preg_match('/^[A-Za-z0-9-_\\.\\/]+$/', $fname)) {\n $fname = '';\n }\n } // if ($fname!=='')\n\n return $fname;\n }", "function nice_filename($name)\r\n{\r\n return preg_replace(\"(\\W)\", '_', strtolower($name));\r\n}", "public static function cleanFilename($file_name, $extension = \"\")\n {\n $clean_filename = preg_replace(\"/[?*:;{}\\\\ \\\"'\\/@#!%^()<>.]+/\", \"_\", $file_name);\n if ($extension) {\n return $clean_filename . \".\" . $extension;\n }\n return $clean_filename;\n }", "public function sanitize_file_name($filename) {\n\t\treturn preg_replace('/-db(.*)\\.gz_\\.crypt$/', '-db$1.gz.crypt', $filename);\n\t}", "public function cleanName()\n {\n $name = strtolower($this->name);\n $name = str_replace('á', 'a', $name);\n $name = str_replace('é', 'e', $name);\n $name = str_replace('í', 'i', $name);\n $name = str_replace('ó', 'o', $name);\n $name = str_replace('ú', 'u', $name);\n $name = str_replace('Á', 'a', $name);\n\n return $name;\n }", "function strip_bad_chars( $input ) {\n $output = preg_replace( \"/[^a-zA-Z0-9_-]/\", \"\", $input );\n return $output;\n }", "protected function sanitiseFilename(string $filepath): string\n {\n // Basic Sanitisation of file name\n $filename = mb_ereg_replace(\"([^\\w\\s\\d\\-_~,;\\[\\]\\(\\).])\", '', basename($filepath));\n if ($filename === basename($filepath)) {\n return $filepath;\n }\n\n // If the name needed to be sanitised, make a copy with the sanitised name and delete the original\n $sanitisedPath = dirname($filepath) . DIRECTORY_SEPARATOR . $filename;\n copy($filepath, $sanitisedPath);\n unlink($filepath);\n\n return $sanitisedPath;\n }", "function safe_name($name) {\n return preg_replace(\"/\\W/\", \"_\", $name);\n }", "function file_name($string) {\n \n $string = strtolower($string);\n \n //Rememplazamos caracteres especiales latinos\n \n $find = array('á', 'é', 'í', 'ó', 'ú', 'ñ');\n \n $repl = array('a', 'e', 'i', 'o', 'u', 'n');\n \n $string = str_replace($find, $repl, $string);\n \n // Añadimos los guiones\n \n $find = array(' ', '&', '\\r\\n', '\\n', '+');\n $string = str_replace($find, '-', $string);\n \n // Eliminamos y Reemplazamos otros carácteres especiales\n \n $find = array('/[^a-z0-9\\-<>]/', '/[\\-]+/', '/<[^>]*>/');\n \n $repl = array('', '-', '');\n \n $string = preg_replace($find, $repl, $string);\n \n return $string;\n \n }", "function standardizeFileName($dateiname)\n{\n\t// habe ich kopiert aus \".....\", alle weiteren Codezeilen einschliesslich der Kommentare von dort //übernommen\n\t// erwünschte Zeichen erhalten bzw. umschreiben\n\t// aus allen ä wird ae, ü -> ue, ß -> ss (je nach Sprache mehr Aufwand)\n\t// und sonst noch ein paar Dinge;\n\t// (ist schätzungsweise mein persönlicher Geschmach ;)\n$dateiname = strtolower ( $dateiname );\n$dateiname = str_replace ('\"', \"-\", $dateiname );\n$dateiname = str_replace (\"'\", \"-\", $dateiname );\n$dateiname = str_replace (\"*\", \"-\", $dateiname );\n$dateiname = str_replace (\"ß\", \"ss\", $dateiname );\n$dateiname = str_replace (\"ß\", \"ss\", $dateiname );\n$dateiname = str_replace (\"ä\", \"ae\", $dateiname );\n$dateiname = str_replace (\"ä\", \"ae\", $dateiname );\n$dateiname = str_replace (\"ö\", \"oe\", $dateiname );\n$dateiname = str_replace (\"ö\", \"oe\", $dateiname );\n$dateiname = str_replace (\"ü\", \"ue\", $dateiname );\n$dateiname = str_replace (\"ü\", \"ue\", $dateiname );\n$dateiname = str_replace (\"Ä\", \"ae\", $dateiname );\n$dateiname = str_replace (\"Ö\", \"oe\", $dateiname );\n$dateiname = str_replace (\"Ü\", \"ue\", $dateiname );\n$dateiname = htmlentities ( $dateiname );\n$dateiname = str_replace (\"&\", \"und\", $dateiname );\n$dateiname = str_replace (\"+\", \"und\", $dateiname );\n$dateiname = str_replace (\"(\", \"-\", $dateiname );\n$dateiname = str_replace (\")\", \"-\", $dateiname );\n$dateiname = str_replace (\" \", \"-\", $dateiname );\n$dateiname = str_replace (\"\\'\", \"-\", $dateiname );\n$dateiname = str_replace (\"/\", \"-\", $dateiname );\n$dateiname = str_replace (\"?\", \"-\", $dateiname );\n$dateiname = str_replace (\"!\", \"-\", $dateiname );\n$dateiname = str_replace (\":\", \"-\", $dateiname );\n$dateiname = str_replace (\";\", \"-\", $dateiname );\n$dateiname = str_replace (\",\", \"-\", $dateiname );\n$dateiname = str_replace (\"--\", \"-\", $dateiname );\n\n// Heilfunktion\n$dateiname = filter_var($dateiname, FILTER_SANITIZE_URL);\nreturn ($dateiname);\n}", "function sanitize($name)\n {\n return preg_replace('/[^A-Za-z0-9\\-]/', '', $name);\n }", "public function sanitizedName($name)\r\n\t{\r\n\t\t$cut_name = explode('_', $name);\r\n\t\t$fileName = array_slice($cut_name, 1);\r\n\t\treturn implode(\"_\", $fileName);\r\n\t}", "function removeSpecialChars($oldText)\r\n{\r\n // Se corrige os acentos com iso, taca iso\r\n if ( strlen($oldText) > strlen(utf8_decode($oldText)) )\r\n {\r\n $oldText = utf8_decode($oldText);\r\n }\r\n\r\n /*\r\n * A função \"strtr\" substitui os caracteres acentuados pelos não acentuados.\r\n * A função \"ereg_replace\" utiliza uma expressão regular que remove todos os\r\n * caracteres que não são letras, números e são diferentes de \"_\" (underscore).\r\n */\r\n $newText = preg_replace('[^a-zA-Z0-9_-.]', '', strtr($oldText, 'áàãâéêíóôõúüçÁÀÃÂÉÊÍÓÔÕÚÜÇ ', 'aaaaeeiooouucAAAAEEIOOOUUC_'));\r\n\r\n if ( !(strlen($newText) > 0) )\r\n {\r\n $newText = 'nome_invalido-'.getRandomNumbers().getRandomNumbers();\r\n }\r\n\r\n return $newText;\r\n}", "function fm_unzip_cleanfilename ($p_event, &$p_header) {\r\n//to clean illegal characters for given platform and to prevent directory traversal.\r\n//Produces the same result as info-zip unzip.\r\n $p_header['filename'] = ereg_replace('[[:cntrl:]]', '', $p_header['filename']); //strip control chars first!\r\n $p_header['filename'] = ereg_replace('\\.\\.+', '', $p_header['filename']); //directory traversal protection\r\n if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {\r\n $p_header['filename'] = ereg_replace('[:*\"?<>|]', '_', $p_header['filename']); //replace illegal chars\r\n $p_header['filename'] = ereg_replace('^([a-zA-Z])_', '\\1:', $p_header['filename']); //repair drive letter\r\n } else {\r\n //Add filtering for other systems here\r\n // BSD: none (tested)\r\n // Linux: ??\r\n // MacosX: ??\r\n }\r\n $p_header['filename'] = cleardoubleslashes($p_header['filename']); //normalize the slashes/backslashes\r\n return 1;\r\n}", "public static function filename($filename,$replaceChar='',$ignoreChars=array()){\n\t\t\t$ignoreChars = preg_quote(implode('',$ignoreChars),'/');\n\t\t\t$pattern = '/[^a-zA-Z0-9-_ \\(\\)\\[\\]\\{\\}'.$ignoreChars.']/';\n\t\t\treturn preg_replace($pattern, $replaceChar, $filename);\n\t\t}", "private static function _dsFixFile($filename) {\n\t\t$ds = DS;\n\t\t$notDs = DS == '/' ? '\\\\' : '/';\n\t\t$filename = str_replace($notDs, $ds, $filename);\n\t\t$filename = str_replace($ds . $ds, $ds, $filename);\n\t\treturn $filename;\n\t}", "function cln_file_name($string) {\n\t$cln_filename_find=array(\"/\\.[^\\.]+$/\", \"/\\s\\s+/\", \"/[-]+/\", \"/[_]+/\");\n\t$cln_filename_repl=array(\"\",\" \", \"-\", \"_\");\n\t$string=preg_replace($cln_filename_find, $cln_filename_repl, $string);\n\treturn trim($string);\n}", "public function sanitize($f, $type = 'file') {\n /* A combination of various methods to sanitize a string while retaining\n the \"essence\" of the original file name as much as possible.\n Note: unsuitable for file paths as '/' and '\\' are filtered out.\n Sources:\n http://www.house6.com/blog/?p=83\n and\n http://stackoverflow.com/a/24984010\n */\n $replace_chars = array(\n '&amp;' => '-and-', '@' => '-at-', '©' => 'c', '®' => 'r', 'À' => 'a',\n 'Á' => 'a', 'Â' => 'a', 'Ä' => 'a', 'Å' => 'a', 'Æ' => 'ae','Ç' => 'c',\n 'È' => 'e', 'É' => 'e', 'Ë' => 'e', 'Ì' => 'i', 'Í' => 'i', 'Î' => 'i',\n 'Ï' => 'i', 'Ò' => 'o', 'Ó' => 'o', 'Ô' => 'o', 'Õ' => 'o', 'Ö' => 'o',\n 'Ø' => 'o', 'Ù' => 'u', 'Ú' => 'u', 'Û' => 'u', 'Ü' => 'u', 'Ý' => 'y',\n 'ß' => 'ss','à' => 'a', 'á' => 'a', 'â' => 'a', 'ä' => 'a', 'å' => 'a',\n 'æ' => 'ae','ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e',\n 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ò' => 'o', 'ó' => 'o',\n 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ø' => 'o', 'ù' => 'u', 'ú' => 'u',\n 'û' => 'u', 'ü' => 'u', 'ý' => 'y', 'þ' => 'p', 'ÿ' => 'y', 'Ā' => 'a',\n 'ā' => 'a', 'Ă' => 'a', 'ă' => 'a', 'Ą' => 'a', 'ą' => 'a', 'Ć' => 'c',\n 'ć' => 'c', 'Ĉ' => 'c', 'ĉ' => 'c', 'Ċ' => 'c', 'ċ' => 'c', 'Č' => 'c',\n 'č' => 'c', 'Ď' => 'd', 'ď' => 'd', 'Đ' => 'd', 'đ' => 'd', 'Ē' => 'e',\n 'ē' => 'e', 'Ĕ' => 'e', 'ĕ' => 'e', 'Ė' => 'e', 'ė' => 'e', 'Ę' => 'e',\n 'ę' => 'e', 'Ě' => 'e', 'ě' => 'e', 'Ĝ' => 'g', 'ĝ' => 'g', 'Ğ' => 'g',\n 'ğ' => 'g', 'Ġ' => 'g', 'ġ' => 'g', 'Ģ' => 'g', 'ģ' => 'g', 'Ĥ' => 'h',\n 'ĥ' => 'h', 'Ħ' => 'h', 'ħ' => 'h', 'Ĩ' => 'i', 'ĩ' => 'i', 'Ī' => 'i',\n 'ī' => 'i', 'Ĭ' => 'i', 'ĭ' => 'i', 'Į' => 'i', 'į' => 'i', 'İ' => 'i',\n 'ı' => 'i', 'IJ' => 'ij','ij' => 'ij','Ĵ' => 'j', 'ĵ' => 'j', 'Ķ' => 'k',\n 'ķ' => 'k', 'ĸ' => 'k', 'Ĺ' => 'l', 'ĺ' => 'l', 'Ļ' => 'l', 'ļ' => 'l',\n 'Ľ' => 'l', 'ľ' => 'l', 'Ŀ' => 'l', 'ŀ' => 'l', 'Ł' => 'l', 'ł' => 'l',\n 'Ń' => 'n', 'ń' => 'n', 'Ņ' => 'n', 'ņ' => 'n', 'Ň' => 'n', 'ň' => 'n',\n 'ʼn' => 'n', 'Ŋ' => 'n', 'ŋ' => 'n', 'Ō' => 'o', 'ō' => 'o', 'Ŏ' => 'o',\n 'ŏ' => 'o', 'Ő' => 'o', 'ő' => 'o', 'Œ' => 'oe','œ' => 'oe','Ŕ' => 'r',\n 'ŕ' => 'r', 'Ŗ' => 'r', 'ŗ' => 'r', 'Ř' => 'r', 'ř' => 'r', 'Ś' => 's',\n 'ś' => 's', 'Ŝ' => 's', 'ŝ' => 's', 'Ş' => 's', 'ş' => 's', 'Š' => 's',\n 'š' => 's', 'Ţ' => 't', 'ţ' => 't', 'Ť' => 't', 'ť' => 't', 'Ŧ' => 't',\n 'ŧ' => 't', 'Ũ' => 'u', 'ũ' => 'u', 'Ū' => 'u', 'ū' => 'u', 'Ŭ' => 'u',\n 'ŭ' => 'u', 'Ů' => 'u', 'ů' => 'u', 'Ű' => 'u', 'ű' => 'u', 'Ų' => 'u',\n 'ų' => 'u', 'Ŵ' => 'w', 'ŵ' => 'w', 'Ŷ' => 'y', 'ŷ' => 'y', 'Ÿ' => 'y',\n 'Ź' => 'z', 'ź' => 'z', 'Ż' => 'z', 'ż' => 'z', 'Ž' => 'z', 'ž' => 'z',\n 'ſ' => 'z', 'Ə' => 'e', 'ƒ' => 'f', 'Ơ' => 'o', 'ơ' => 'o', 'Ư' => 'u',\n 'ư' => 'u', 'Ǎ' => 'a', 'ǎ' => 'a', 'Ǐ' => 'i', 'ǐ' => 'i', 'Ǒ' => 'o',\n 'ǒ' => 'o', 'Ǔ' => 'u', 'ǔ' => 'u', 'Ǖ' => 'u', 'ǖ' => 'u', 'Ǘ' => 'u',\n 'ǘ' => 'u', 'Ǚ' => 'u', 'ǚ' => 'u', 'Ǜ' => 'u', 'ǜ' => 'u', 'Ǻ' => 'a',\n 'ǻ' => 'a', 'Ǽ' => 'ae','ǽ' => 'ae','Ǿ' => 'o', 'ǿ' => 'o', 'ə' => 'e',\n 'Ё' => 'jo','Є' => 'e', 'І' => 'i', 'Ї' => 'i', 'А' => 'a', 'Б' => 'b',\n 'В' => 'v', 'Г' => 'g', 'Д' => 'd', 'Е' => 'e', 'Ж' => 'zh','З' => 'z',\n 'И' => 'i', 'Й' => 'j', 'К' => 'k', 'Л' => 'l', 'М' => 'm', 'Н' => 'n',\n 'О' => 'o', 'П' => 'p', 'Р' => 'r', 'С' => 's', 'Т' => 't', 'У' => 'u',\n 'Ф' => 'f', 'Х' => 'h', 'Ц' => 'c', 'Ч' => 'ch','Ш' => 'sh','Щ' => 'sch',\n 'Ъ' => '-', 'Ы' => 'y', 'Ь' => '-', 'Э' => 'je','Ю' => 'ju','Я' => 'ja',\n 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e',\n 'ж' => 'zh','з' => 'z', 'и' => 'i', 'й' => 'j', 'к' => 'k', 'л' => 'l',\n 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's',\n 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', 'ч' => 'ch',\n 'ш' => 'sh','щ' => 'sch','ъ' => '-','ы' => 'y', 'ь' => '-', 'э' => 'je',\n 'ю' => 'ju','я' => 'ja','ё' => 'jo','є' => 'e', 'і' => 'i', 'ї' => 'i',\n 'Ґ' => 'g', 'ґ' => 'g', 'א' => 'a', 'ב' => 'b', 'ג' => 'g', 'ד' => 'd',\n 'ה' => 'h', 'ו' => 'v', 'ז' => 'z', 'ח' => 'h', 'ט' => 't', 'י' => 'i',\n 'ך' => 'k', 'כ' => 'k', 'ל' => 'l', 'ם' => 'm', 'מ' => 'm', 'ן' => 'n',\n 'נ' => 'n', 'ס' => 's', 'ע' => 'e', 'ף' => 'p', 'פ' => 'p', 'ץ' => 'C',\n 'צ' => 'c', 'ק' => 'q', 'ר' => 'r', 'ש' => 'w', 'ת' => 't', '™' => 'tm',\n 'Ã' => 'A', 'Ð' => 'Dj', 'Ê' => 'E', 'Ñ' => 'N', 'Þ' => 'B', 'ã' => 'a',\n 'ð' => 'o', 'ñ' => 'n', '#' => '-nr-' );\n // \"Translate\" multi byte characters to 'corresponding' ASCII characters\n $f = strtr($f, $replace_chars);\n // Convert special characters to a hyphen\n $f = str_replace(array(\n ' ', '!', '\\\\', '/', '\\'', '`', '\"', '~', '%', '|',\n '*', '$', '^', '(' ,')', '[', ']', '{', '}',\n '+', ',', ':' ,';', '<', '=', '>', '?', '|'), '-', $f);\n // Remove any non ASCII characters\n $f = preg_replace('/[^(\\x20-\\x7F)]*/','', $f);\n if ($type == 'file') {\n // Remove non-word chars (leaving hyphens and periods)\n $f = preg_replace('/[^\\w\\-\\.]+/', '', $f);\n // Convert multiple adjacent dots into a single one\n $f = preg_replace('/[\\.]+/', '.', $f);\n }\n else { // Do not allow periods, for instance for a Grav slug\n // Convert period to hyphen\n $f = str_replace('.', '-', $f);\n // Remove non-word chars (leaving hyphens)\n $f = preg_replace('/[^\\w\\-]+/', '', $f);\n }\n // Convert multiple adjacent hyphens into a single one\n $f = preg_replace('/[\\-]+/', '-', $f);\n // Change into a lowercase string; BTW no need to use mb_strtolower() here ;)\n $f = strtolower($f);\n return $f;\n }", "private function cleanname($name)\n\t{\n\t\tdo {\n\t\t\t$original = $name;\n\t\t\t$name = preg_replace(\"/[\\{\\[\\(]\\d+[ \\.\\-\\/]+\\d+[\\]\\}\\)]/iU\", \" \", $name);\n\t\t\t$name = preg_replace(\"/[\\x01-\\x1f\\!\\?\\[\\{\\}\\]\\/\\:\\|]+/iU\", \" \", $name);\n\t\t\t$name = str_replace(\" \", \" \", $name);\n\t\t\t$name = preg_replace(\"/^[\\s\\.]+|[\\s\\.]{2,}$/iU\", \"\", $name);\n\t\t\t$name = str_replace(\" - - \", \" - \", $name);\n\t\t\t$name = preg_replace(\"/^[\\s\\-\\_\\.]/iU\", \"\", $name);\n\t\t\t$name = trim($name);\n\t\t} while ($original != $name);\n\n\t\treturn mb_strimwidth($name, 0, 255);\n\t}", "public static function cleanPath(string $input):string {\n\n # Declare result\n $result = \"\";\n\n # Convert input to ASCII encoding\n $result = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $input);\n \n # Remove all non-alphanumeric characters (except apostrophes, quotes, and backticks)\n $result = preg_replace('/[^a-zA-Z0-9\\/]/', '', $input);\n \n # Replace all spaces with underscores\n $result = preg_replace('/\\s+/', '_', $result);\n \n # Trim any leading or trailing underscores\n $result = trim($result, '_');\n \n # Return result\n return $result;\n }", "function MCW_make_name_acceptable($name) {\n \n $name = strtr($name,\" \",\"_\");\n $name=preg_replace(\"/[^a-zA-Z0-9_äöüÄÖÜ]/\" , \"\" , $name);\n return $name;\n }", "function trim_file_name($name, $type) \n\t{\n\t\t// into different directories or replacing hidden system files.\n\t\t// Also remove control characters and spaces (\\x00..\\x20) around the filename:\n\t\t$file_name = trim(basename(stripslashes($name)), \".\\x00..\\x20\");\n\t\t// Add missing file extension for known image types:\n\t\tif (strpos($file_name, '.') === false &&\n\t\t\tpreg_match('/^image\\/(gif|jpe?g|png)/', $type, $matches)) \n\t\t{\n\t\t\t$file_name .= '.'.$matches[1];\n\t\t}\n\t\treturn $file_name;\n\t}", "function removeSpecialCharacter($name) {\n $lowerName = strtolower($name);\n $what = array( 'ä','ã','à','á','â','ê','ë','è','é','ï','ì','í','ö','õ','ò','ó','ô','ü','ù','ú','û','À','Á','É','Í','Ó','Ú','ñ','Ñ','ç','Ç',' ','-','(',')',',',';',':','|','!','\"','#','$','%','&','/','=','?','~','^','>','<','ª','º', \"'\" );\n $by = array( 'a','a','a','a','a','e','e','e','e','i','i','i','o','o','o','o','o','u','u','u','u','A','A','E','I','O','U','n','n','c','C','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-','-', '-');\n\n return str_replace($what, $by, $lowerName);\n }", "private function convert_to_filename ($string) {\n\n\t // Replace spaces with underscores and makes the string lowercase\n\t $string = str_replace (\" \", \"_\", $string);\n\t $string = str_replace (\"..\", \".\", $string);\n\t $string = strtolower ($string);\n\n\t // Match any character that is not in our whitelist\n\t preg_match_all (\"/[^0-9^a-z^_^.]/\", $string, $matches);\n\n\t // Loop through the matches with foreach\n\t foreach ($matches[0] as $value) {\n\t $string = str_replace($value, \"\", $string);\n\t }\n\t return $string;\n\t}", "function thefilename($filename) {\n $encode = mb_detect_encoding($filename, \"UTF-8,GBK,GB2312,BIG5,ISO-8859-1\");\n if ($encode != 'UTF-8') {\n $filename = mb_convert_encoding($filename, \"UTF-8\", $encode);\n }\n\n return $filename;\n}", "function makeSafe($path) \n {\n $ds = (DS == '\\\\') ? '\\\\' . DS : DS;\n $regex = array('#[^A-Za-z0-9:\\_\\-' . $ds . ' ]#');\n return preg_replace($regex, '', $path);\n }", "function clean_unwanted_characters($oneStr){\n\t$cleaned_str = $oneStr;\r\n// \t$cleaned_str = str_ireplace(\"\\\"\", \"/\", $oneStr);\r\n// \t$cleaned_str = str_ireplace(\"\\\\\", \"/\", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\b\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\f\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\r\", \" / \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\t\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"\\\\u\", \" \", $cleaned_str);\r\n// \t$cleaned_str = str_ireplace(\"</\", \"<\\/\", $cleaned_str);\r\n\treturn $cleaned_str;\n\r\n}", "protected function _convertFileName($str)\n {\n return ltrim(strtolower(preg_replace('/[A-Z]/', '-$0', $str)), '-');\n }", "public function filter_file($snap_file_name){\n\t\treturn str_replace(array('.','_','-','(',')',' ','&'), '', $snap_file_name);\n\t}", "function cleanForBundleIdentifier($toClean) {\n $retVal = preg_replace('/[^A-Za-z0-9\\-\\.]/', '', $toClean);\n return $retVal;\n}", "function Strip_Bad_chars($input)\n{\n //$output = preg_replace(\"/[^a-zA-Z0-9_-]/\", \"\", $input);\n $output = preg_replace(\"/[^0-9]/\", \"\", $input);\n return $output;\n}", "function sanitize_username($s) {\n\treturn preg_replace(\"/[^a-zA-Z0-9-_]/\", '', trim($s));\n}", "function phpbb_clean_username($username)\n{\n\t$username = substr(htmlspecialchars(str_replace(\"\\'\", \"'\", trim($username))), 0, 25);\n\t$username = phpbb_rtrim($username, \"\\\\\");\n\t$username = str_replace(\"'\", \"\\'\", $username);\n\n\treturn $username;\n}", "function isCorrectFilename ($name) {\r\n if (!empty($name)) {\r\n if (preg_match('/[a-zA-Z0-9_]/', $name)) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "function cleanName($name) {\n \t$search_array=array('Р Т‘','Р”','С†','Р В¦','РЎРЉ','Р В¬','&auml;','&Auml;','&ouml;','&Ouml;','&uuml;','&Uuml;');\n \t$replace_array=array('ae','Ae','oe','Oe','ue','Ue','ae','Ae','oe','Oe','ue','Ue');\n \t$name=str_replace($search_array,$replace_array,$name); \t\n \t\n $replace_param='/[^a-zA-Z0-9]/';\n $name=preg_replace($replace_param,'-',$name); \n return $name;\n }", "function phpbb_clean_username($username)\n{\n\t$username = htmlspecialchars(rtrim(trim($username), \"\\\\\"));\n\t$username = substr(str_replace(\"\\\\'\", \"'\", $username), 0, 25);\n\t$username = str_replace(\"'\", \"\\\\'\", $username);\n\n\treturn $username;\n}", "function normalise_fichier($NomComplet){\n\t\t$valRetour = str_replace(\"'\",\"\",$NomComplet);\n\t\t$valRetour = str_replace(\" \",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"-\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\",\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"¦\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"/\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"+\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"=\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"!\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"?\",\"_\",$valRetour);\n\t\t$valRetour = str_replace(\"œ\",\"oe\",$valRetour);\n\t\t$valRetour = str_replace(\"æ\",\"ae\",$valRetour);\n\t\t$valRetour = mb_convert_encoding($valRetour,\"iso-8859-1\",\"UTF-8\");\n\t\t$valRetour = strtolower($valRetour);\n\t\t$valRetour = vireAccents($valRetour);\n\t\treturn($valRetour);\n\t}", "public function get_sanitized_zip_name( $name ) {\n\t\treturn preg_replace( '|\\W|', '', strtolower( basename( $name, '.zip') ) );\n\t}", "public function fixerCleaner($name)\n\t{\n\t\t//Extensions.\n\t\t$cleanerName = preg_replace('/([-_](proof|sample|thumbs?))*(\\.part\\d*(\\.rar)?|\\.rar)?(\\d{1,3}\\.rev\"|\\.vol.+?\"|\\.[A-Za-z0-9]{2,4}$|$)/i',\n\t\t\t\t\t\t\t\t\t' ',\n\t\t\t\t\t\t\t\t\t$name);\n\t\t//Remove stuff from the start.\n\t\t$cleanerName = preg_replace('/^(Release Name|sample-)/i', ' ', $cleanerName);\n\t\t//Replace multiple spaces with 1 space\n\t\t$cleanerName = preg_replace('/\\s\\s+/i', ' ', $cleanerName);\n\t\t//Remove invalid characters.\n\t\t$cleanerName = trim(utf8_encode(preg_replace('/[^(\\x20-\\x7F)]*/', '', $cleanerName)));\n\t\treturn $cleanerName;\n\t}", "public function validPathStrInvalidCharactersDataProvider() {}", "function processName($name) {\n//\tUncomment the next two lines and change only ISO-8859-9 to your site encoding type\n\n//\t$name = iconv(\"UTF-8\", \"ISO-8859-1\", $name);\n//\t$name = iconv(\"ISO-8859-9\", \"UTF-8\", $name);\n\n\treturn $name;\n}", "function sanitizeName() {\n $pattern = \"/[0-9`!@#$%^&*()_+\\-=\\[\\]{};':\\\"\\\\|,.<>\\/?~]/\";\n if (!preg_match($pattern, $this->fname) && !preg_match($pattern, $this->lname)) {\n $this->fname = trim($this->fname);\n $this->lname = trim($this->lname);\n } else {\n die(\"Error. Check your form data\");\n }\n }", "function fixKimi($name)\n\t{\n\t\t$name = str_replace(\"ä\", \"a\", $name);\n\t\t$name = str_replace(\"ö\", \"o\", $name);\t\n\t\treturn $name;\n\t}", "public function fileName()\n {\n return $this->getCleanString(self::$_file_name_clean);\n }", "protected function getFileName() {\n\n\t\treturn mb_strtolower( preg_replace( '@[^\\s0-9a-zA-Z]+@', '', static::$query ) );\n\t}", "private function replaceCharsConcat($filename){\n\t\t\t$file = LOG_PATH . preg_replace(\"/[^0-9_a-zA-Z]/\",\"x\",$filename) . \".log\";\n\t\t\treturn (file_exists($file)) ? $file : LOG_PATH.\"jexmlog.log\";\n\t\t}", "function remove_strange_chars($txt){\n\t\treturn(str_replace(array('<','>',\"'\",\";\",\"&\",\"\\\\\"),'',$txt));\n\t}", "function filter_chars($str) {\n\treturn preg_replace(\"/[^A-Za-z0-9_]*/\", \"\", $str);\n}", "function generateFilename($name)\n {\n // Catch every Unicode character from beggining on, because replacer might not get it\n $name = preg_replace('/[\\x00-\\x1F\\x80-\\xFF]/', '', $name);\n // Delete all signs etc. to properly display the filename\n $newname = str_replace(array(' ', '+', '*', '!', '?', \"'\", '\"', '.', ',', 'ä', 'ö', 'ü', '?', '-', ':', '&'), '', $name);\n $newname = mb_strtolower($newname);\n $newname .= '.png';\n\n return $newname;\n }", "public static function sanitizeString($url) {\r\n $url = mb_strtolower($url, 'UTF-8');\r\n $url = iconv('UTF-8', 'ASCII//TRANSLIT', $url);\r\n $url = str_replace(array(\"'\", '\"', ';', ',', ':', ' ', '_'), '-', $url);\r\n $url = preg_replace(\"/[^a-z0-9-]/\", '', $url);\r\n\t$url = str_replace('---', '-', $url);\r\n $url = str_replace('--', '-', $url);\r\n\t$url = trim($url, '-');\r\n\treturn $url;\r\n }" ]
[ "0.8468803", "0.83387846", "0.8022858", "0.79106545", "0.78771764", "0.78552", "0.7843385", "0.78226185", "0.7776485", "0.7641304", "0.76388294", "0.7598594", "0.75843364", "0.7564258", "0.7492413", "0.74915516", "0.7477909", "0.7468763", "0.7343337", "0.73060143", "0.72831744", "0.7253476", "0.7241542", "0.7239332", "0.7232722", "0.722834", "0.7193719", "0.71868414", "0.7175917", "0.716555", "0.71573645", "0.7139309", "0.71311283", "0.7124526", "0.71049935", "0.71044225", "0.69903415", "0.69880426", "0.6978867", "0.69607055", "0.69410217", "0.69181573", "0.6905493", "0.6869807", "0.6828799", "0.67110634", "0.6700826", "0.66228646", "0.65656877", "0.6530822", "0.65278524", "0.6525521", "0.650413", "0.64630014", "0.6455959", "0.64394087", "0.6428521", "0.6377303", "0.6370883", "0.63694274", "0.6349936", "0.6327043", "0.632184", "0.63209623", "0.63183755", "0.63038623", "0.6259053", "0.6229578", "0.6229304", "0.61851186", "0.6182171", "0.6175895", "0.61630964", "0.6160599", "0.61514413", "0.61266017", "0.6110103", "0.6104575", "0.609867", "0.60946554", "0.60237104", "0.6016542", "0.5996842", "0.5995198", "0.5980316", "0.5975064", "0.59535396", "0.5932444", "0.59087104", "0.59026897", "0.5901443", "0.58855927", "0.58775014", "0.5869823", "0.58406216", "0.5836248", "0.5834549", "0.58191496", "0.58175075", "0.580845" ]
0.7156327
31
Display a listing of the resource.
public function index() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $inputs = [ 'event_id' ]; // DB::beginTransaction(); try{ // foreach($inputs as $key){ if($request->filled($key)){ $this->aff->$key = $request->input($key); }else{ throw new Exception(sprintf('【%s】LINE:%s %s, Null Not Allowed', __METHOD__, __LINE__, $key).PHP_EOL); } } if(!$this->aff->main()){ throw new Exception("Something Wrong"); } DB::commit(); $result = true; }catch(Exception $e){ echo $e->getMessage().PHP_EOL; DB::rollback(); $result = false; } return $result ? 'success' : 'failed'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, $id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
Get the listings of the owner.
public function listings() { return $this->hasMany(Listing::class, 'owner_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function _getListingsByLoggedInUser()\n\t{\n\t\t$user_id = $this->_getUserId();\n\t\tif ($user_id == 0 || $user_id == null){\n\t\t\treturn array('error' => 'USER_NOT_LOGGED_IN', 'code' => 3);\n\t\t}\n\t\t\n\t\t$listings = $this->Listing->GetListingsByUserId($user_id);\n\t\tif ($listings == null)\n\t\t\treturn array('error' => 'FAILED_TO_RETRIEVE_LISTINGS', 'code' => 4);\n\n\t\treturn $listings;\n\t}", "public static function allListings()\n {\n $listings = Listing::all();\n return $listings;\n }", "function monitor_list_owners() {\n $query = \"select distinct(`wf_owner`) from `\".GALAXIA_TABLE_PREFIX.\"instances`\";\n $result = $this->query($query);\n $ret = Array();\n while($res = $result->fetchRow()) {\n $ret[] = $res['wf_owner'];\n }\n return $ret;\n }", "public function getOwnedListings($userId)\r\n\t{\r\n\t\t$query = 'SELECT m.marketID\r\n\t\t\tFROM marketplace AS m\r\n\t\t\t\tLEFT JOIN marketplacePayments AS mpp ON mpp.marketID = m.marketID\r\n\t\t\tWHERE mpp.startDate <= NOW()\r\n\t\t\t\tAND mpp.endDate >= NOW()\r\n\t\t\t\tAND mpp.paid = 1\r\n\t\t\t\tAND m.mLive = 1\r\n\t\t\t\tAND m.mUserID = '.(int) $userId;\r\n\t\t$this->_db->setQuery($query);\r\n\t\t$listings = $this->_db->loadAssocList('marketID');\r\n\t\tif (!$listings) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t// Add listing details and return\r\n\t\t$this->addDetails($listings);\r\n\t\treturn $listings;\r\n\t}", "static function get_sharing_perimssions_of_list_with_user($list_owner, $word_list_id, $email) {\n $share_with_id = self::email2id($email);\n\n global $con;\n $sql = \"\n SELECT `share`.`id`, `share`.`list`, `share`.`permissions` \n FROM `share`, `list` \n WHERE `list`.`id` = \".$word_list_id.\" AND `share`.`list` = `list`.`id` AND `list`.`creator` = \".$list_owner.\" AND `list`.`active` = 1 AND `list`.`user` = \".$share_with_id.\";\";\n $query = mysqli_query($con, $sql);\n while ($row = mysqli_fetch_assoc($query)) {\n return new SharingInformation($row['id'], new SimpleUser($share_with_id, null, null, $email), $row['list'], $row['permissions']);\n }\n }", "function lists() {\n $params = array();\n return $this->callServer(\"lists\", $params);\n }", "public function findForList()\n {\n return $this->findByShowInOverview(true);\n }", "public function client_listings(Request $request, Listing $listing = null)\n {\n // 'Real Estate Agent', 'Listing Agent', 'RH Agent', 'Co-broke'\n\n $listings = Listing::query()\n ->whereHas(\n 'users',\n fn ($builder) => $builder->where('user_id', auth()->user()->id)\n ->whereIn('group_id', [6, 10, 38, 37])\n )\n ->when($request['sort_by'] && $request['sort_dir'], fn ($query) => $query->orderBy($request['sort_by'], $request['sort_dir']))\n ->get();\n\n if($listing)\n return view('frontend.dashboard.listings-stats', compact('listings', 'listing'));\n else\n return view('frontend.dashboard.client-listings', compact('listings'));\n\n }", "public function getFollowedByList($perPage = null)\n {\n return $this->getOrPaginateFollowedBy($this->getFollowedByQueryBuilder(), $perPage);\n }", "public function getOpenings()\r\n {\r\n }", "public function index()\n {\n return Listing::all();\n }", "public function listing();", "public function meList( )\n\t{\n\t\t$userId = $this->getCurrentUserId();\n\t\treturn $this->adminListByUser($userId);\n\t}", "public function my_listings(Request $request, Listing $listing = null)\n {\n // 'Private Seller 11', 'Financial Institution 39', 'Bank Liaison 3', 'Asset Manager 24', 'Consumer Direct 36'\n\n $listings = Listing::query()\n ->whereHas(\n 'users',\n fn ($builder) => $builder->where('user_id', auth()->user()->id)\n ->whereIn('group_id', [11, 39, 3, 24, 36])\n )\n ->when($request['sort_by'] && $request['sort_dir'], fn ($query) => $query->orderBy($request['sort_by'], $request['sort_dir']))\n ->get();\n\n if($listing)\n return view('frontend.dashboard.listings-stats', compact('listings', 'listing'));\n else\n return view('frontend.dashboard.my-listings', compact('listings'));\n }", "public function list(Owner $owner, array $data): ListItemsDTO\n {\n return $this->indexModels(\n array_merge(\n $data,\n [\n 'filters' => [\n ['owner_id', $owner->id],\n ]\n ]\n )\n );\n }", "public function GetOwnedListingsByMarkerId($marker_id)\n\t{\n\t\tif( !$this->request->is('ajax') && !Configure::read('debug') > 0)\n\t\t\treturn;\n\n\t\t$this->layout = 'ajax';\n\t\t$user_id = $this->Auth->User('id');\n\t\tApp::Import('model', 'User');\n\t\t$is_university_admin = ($this->Auth->User('user_type') == User::USER_TYPE_UNIVERSITY_ADMIN);\n\t\tif ($user_id === 0 || (!$this->Listing->UserOwnsAListingAtMarkerId($user_id, $marker_id)) && !$is_university_admin) {\n\t\t\t\t$error = null;\n\t\t\t\t$error['marker_id'] = $marker_id;\n\t\t\t\t$this->Listing->LogError($user_id, 60, $error);\n\t\t\t\t$this->set('response', json_encode(array('error' => \n\t\t\t\t\t'We had some problems loading your listing. Chat with us using the tab along the bottom of the screen ' .\n\t\t\t\t\t'or contact [email protected] if the error persists. Reference error code 60')));\n\t\t\t\treturn; \n\t\t}\n\n\t\t/* Fetch all listing data for this marker_id, user_id combo */\n\t\tif ($is_university_admin)\n\t\t\t$user_id = null;\n\t\t$listings = $this->Listing->GetListingsByMarkerId($marker_id, $user_id);\n\t\t$this->set('response', json_encode($listings));\n\t\treturn;\n\t}", "public abstract function get_lists();", "public function getLists()\n {\n return $this->makeRequest('contacts/list/segments');\n }", "public function listings()\n {\n return $this->belongsTo('App\\Listing');\n }", "public function getLists()\n\t{\n\n\t\t$command = \"Command=Subscriber.GetLists\";\n\t\t\n\t\t$apiPath = $command\n\t\t;\n\n\t\treturn SessionData::getSession()->getResponse($apiPath);\n\n\t}", "public function listings()\n {\n return $this->belongsToMany(\n 'App\\Listing', 'listing_coupons', 'listing_id', 'coupon_id'\n );\n }", "public function user_lists(){\n return get_instance()->ecl('Instance')->mod('lists', 'user_lists', [get_instance()->ecl('Instance')->user(),'email']);\n }", "public function getOwners()\n {\n if (array_key_exists(\"owners\", $this->_propDict)) {\n return $this->_propDict[\"owners\"];\n } else {\n return null;\n }\n }", "public function getInfoList() {\n return $this->_get(21);\n }", "public function getListing(){\n $BusInfo = $this->BusinessOwnerModel->getBusinessID();\n \n foreach($BusInfo as $row1){\n $busID = $row1->bid;\n }\n \n $query = $this->db->get_where('BusinessListing', array('bid' => $busID));\n \n if($query->num_rows() > 0){\n foreach($query->result() as $row){\n $data[] = $row;\n }\n return $data;\n }\n return false;\n }", "public function getOrderings() {}", "public function getList()\n {\n return $this->list;\n }", "public function getList()\n {\n return $this->list;\n }", "public function getList()\n {\n return $this->list;\n }", "public function listingsAction(Request $request)\n {\n\n ## 1. Initialization\n // Enable CORS in this API\n $response = CorsUtility::createCorsResponse();\n if (CorsUtility::requiresPreFlight($request)) {\n return $response;\n }\n\n ## 2. Validate request\n $api = new ApiUtility($request);\n\n $error = $api->validateRequest();\n\n // Return response\n if($error)\n {\n $response = $api->generateErrorResponse($error);\n return $response;\n }\n\n ## 3. Prepare information\n /* @var \\Doctrine\\ORM\\EntityRepository $repository */\n $repository = $this->getDoctrine()->getRepository('ManateeCoreBundle:Listing');\n\n if ($api->hasParameter('userId')) {\n $listings = $repository->findBy( array(\n 'userId' => $api->getParameter('userId')\n ));\n\n if(!is_array($listings)){\n $listings = array();\n }\n } else {\n $listings = $this->getUser()->getListings();\n }\n\n\n\n ## 4. Process info\n $displayParams = array('listingId', 'name', 'content', 'area',\n 'schedule', 'price', 'formattedTimestamp');\n\n $data = $api->generateData($listings, $displayParams);\n\n ## 5. Return payload\n $response = $api->generateResponse($data);\n return $response;\n }", "public function getPartinUsersList(){\n return $this->_get(2);\n }", "public function owners(){\n $users = User::with('potagers')\n ->owners()\n ->orderBy('updated_at', 'desc')\n ->paginate(100);\n\n return view('admin.users.owners', compact('users'));\n }", "public function getList() {\n return $this->list;\n }", "public function getLists(){\n\t\t\t\n\t\t\tif( $this->gateway )\t\n\t\t\t\treturn $this->gateway->call( 'lists/list' );\n\n\t\t\treturn false;\n\t\t}", "public function getList()\n {\n return $this->get(self::_LIST);\n }", "public function getLists()\n {\n try {\n $lists = $this->aweber->getAccount($this->access_token, $this->access_token_secret);\n return $this->response($lists);\n } catch (Exception $e) {\n throw new \\Exception($e->getMessage());\n }\n }", "public function lists()\n {\n return $this->statuses;\n }", "public function index()\n {\n return $this->toppings->getAll();\n }", "public function getOrderings();", "public function getList() {\n\t\treturn $this->find('list', array(\n\t\t\t'contain' => false,\n\t\t\t'cache' => $this->alias . '::' . __FUNCTION__\n\t\t));\n\t}", "public function getAll()\n {\n return $this->list;\n }", "function list_get($id) {\n\n //$id = $this->get('id');\n\n if (!$id) {\n\n $this->response(\"No item ID specified!\", 400);\n\n exit;\n }\n\n $list = $this->List_model->getListById($id);\n\n if ($list) {\n\n //$list = $this->appendItems($list);\n //Put owner's name instead of user ID\n //$list['owner'] = $this->User_model->getName($list['owner'])['name'];\n unset($list['owner']);\n\n $this->response($list, 200);\n\n exit;\n } else {\n\n $this->response(\"Invalid ID\", 404);\n\n exit;\n }\n }", "public function getInfoList() {\n return $this->_get(10);\n }", "public function getEntriesList(){\n return $this->_get(2);\n }", "public function getList()\n {\n return $this->_list;\n }", "public function getList()\n {\n return parent::getList();\n }", "public function getList ()\n {\n return $this->_list;\n }", "public function lists_for_feed_setting() {\n\t\t\t\t\n\t\t$lists = array();\n\t\t\n\t\t/* If iContact API credentials are invalid, return the lists array. */\n\t\tif ( ! $this->initialize_api() ) {\n\t\t\treturn $lists;\n\t\t}\n\n\t\t/* Get available iContact lists. */\n\t\t$icontact_lists = $this->api->get_lists();\n\n\t\tif ( is_wp_error( $icontact_lists ) ) {\n\t\t\t$this->log_error( __METHOD__ . '(): Unable to retrieve lists; ' . $icontact_lists->get_error_message() );\n\n\t\t\treturn $lists;\n\t\t}\n\n\t\tif ( is_array( $icontact_lists ) ) {\n\t\t\t/* Add iContact lists to array and return it. */\n\t\t\tforeach ( $icontact_lists as $list ) {\n\n\t\t\t\t$lists[] = array(\n\t\t\t\t\t'label' => $list['name'],\n\t\t\t\t\t'value' => $list['listId']\n\t\t\t\t);\n\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $lists;\n\t\t\n\t}", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function listings(){\n return $this->hasMany('App\\Models\\Listing', 'manufacturer_id');\n }", "public function listRooms()\n\t{\n\t\treturn $this->execute('roomlist', 'roomlist');\n\t}", "public function getList();", "public function getList();", "function _syndicated_content_listings_page()\n{\n}", "public function index()\n {\n\n\n if (Auth::user()) {\n $listings = Listing::where('user_id', Auth::user()->id)\n ->orderBy('name')\n ->get();\n\n return view('listings', [ 'listings' => $listings ]);\n }\n\n else {\n return back()->with('message', \"Please login to see your Listings\");\n }\n\n\n }", "public function getUserList()\n {\n return $this->userDao->getUserList();\n }", "function _find_list() {\n\t\treturn $this->Album->generatetreelist(null, null, null, '__');\n\t}", "function getPostingList() {\n return getAll(\"SELECT b.* \n FROM member_posting a \n INNER JOIN posting b \n ON a.posting_id = b.id \n WHERE a.member_id = ?\"\n , [getLogin()['mid']]);\n}", "public function getList()\n {\n $filter = $this->getEvent()->getRouteMatch()->getParam('filter', null);\n return $this->getService()\n ->getList($filter);\n }", "public function getOrderings()\n {\n return $this->orderings;\n }", "public function owners()\n {\n return view('front.owners');\n }", "public function getList() {\n\t\t$this->request = array('uri' => array('path' => 'users.json'));\n\n\t\treturn $this->find('all');\n\t}", "public function list() {\n /** @var \\Drupal\\Core\\Config\\ConfigFactory $configFactory */\n $configFactory = \\Drupal::service('config.factory');\n $activeSyncers = $configFactory->get('ymca_sync.settings')->get('active_syncers');\n $syncers = \\Drupal::service('ymca_sync.sync_repository')->getSyncers();\n $result = [];\n if (!$activeSyncers) {\n return new RowsOfFields($result);\n }\n foreach ($syncers as $syncer) {\n $result[] = [\n 'active' => in_array($syncer, $activeSyncers) ? 'active' : 'disabled',\n 'syncer' => $syncer,\n ];\n }\n return new RowsOfFields($result);\n }", "public function list()\n\t{\n\t\treturn $this->widgets()->orderBy('order')->get();\n\t}", "public function getList() {\n\t\treturn parent::get();\n\t}", "public function list();", "public function list();", "public function list();", "public function warehousesList()\n {\n if(Auth::user()->activities != '')\n {\n $warehouses = Auth::user()->warehouseList;\n\n return ($warehouses);\n }\n }", "public function memberList()\n {\n return User::where('status', 1)->where('role_id', 2)->get();\n }", "public function getCreated_byList() {\n if ($this->cached['Created_by']) return array_values($this->cache['Created_by']);\n return XPClass::forName('de.uska.db.Player')\n ->getMethod('getPeer')\n ->invoke()\n ->doSelect(new Criteria(\n array('player_id', $this->getCreated_by(), EQUAL)\n ));\n }", "public function listServiceOfferings() {\n\t\t$data = array (\n\t\t\t\t\"apiKey\" => $this->apiKey,\n\t\t\t\t\"command\" => \"listServiceOfferings\",\n\t\t\t\t\"response\" => \"json\"\n\t\t);\n\t\t$url = $this->getSignatureUrl ( $data );\n\t\treturn $this->curlGet ( $url );\n\t}", "public function listings(Request $request, $listings) {\n\t\tif($request->sortBy) {\n\t\t\tswitch($request->sortBy) {\n\t\t\t\tcase 'makeAsc':\n\t\t\t\t\t$listings = $listings->orderBy('manufacturer', 'ASC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'makeDesc':\n\t\t\t\t\t$listings = $listings->orderBy('manufacturer', 'DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'modelAsc':\n\t\t\t\t\t$listings = $listings->orderBy('model', 'ASC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'modelDesc':\n\t\t\t\t\t$listings = $listings->orderBy('model', 'DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'updateAsc':\n\t\t\t\t\t$listings = $listings->orderBy('updated_at', 'ASC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'updateDesc':\n\t\t\t\t\t$listings = $listings->orderBy('updated_at', 'DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'priceAsc':\n\t\t\t\t\t$listings = $listings->orderBy('price', 'ASC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'priceDesc':\n\t\t\t\t\t$listings = $listings->orderBy('price', 'DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ttAsc':\n\t\t\t\t\t$listings = $listings->orderBy('total_time', 'ASC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ttDesc':\n\t\t\t\t\t$listings = $listings->orderBy('total_time', 'DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'yearAsc':\n\t\t\t\t\t$listings = $listings->orderBy('year', 'ASC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'yearDesc':\n\t\t\t\t\t$listings = $listings->orderBy('year', 'DESC');\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'engineAsc':\n\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'engineDesc':\n\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif($request->pageSize) {\n\t\t\t$listings = $listings->paginate(intval($request->pageSize));\n\n\t\t} else {\n\t\t\t$listings = $listings->paginate(25);\n\t\t}\n\n\n\t\treturn view('listings.display', ['listings' => $listings]);\n\t}", "function getMembers() {\n\t\t$query = $this->createQuery();\n\t\t$query .= \"WHERE c2.status = '\" . KontakteData::$STATUS_MEMBER . \"'\";\n\t\t$query .= \" OR c2.status = '\" . KontakteData::$STATUS_ADMIN . \"' \";\n\t\t$query .= \"ORDER BY c2.name ASC\";\n\t\treturn $this->database->getSelection($query);\n\t}", "function retrieve_all_guest_lists(){\n\t\t\n\t\t$this->CI->load->model('model_guest_lists', 'guest_lists', true);\n\t\treturn $this->CI->guest_lists->retrieve_day_guest_lists($this->promoter->up_id, false, $this->promoter->t_fan_page_id);\n\t\t\n\t}", "public function index()\n {\n $bookings = Booking::all()->sortByDesc('created_at')->forPage(0, 20);\n return $bookings;\n }", "public function getBookmarkedUsers()\n {\n return Auth::user()->bookmarkedUsers()->simplePaginate(10);\n }", "private function getList()\n\t{\n\t\t// Get the correct billboards collection to display from the parameters\n\t\t$collection = (int) $this->params->get('collection', 1);\n\n\t\t// Grab all the buildboards associated with the selected collection\n\t\t// Make sure we only grab published billboards\n\t\t$rows = Billboard::whereEquals('published', 1)\n\t\t ->whereEquals('collection_id', $collection)\n\t\t ->order('ordering', 'asc')\n\t\t ->rows();\n\n\t\treturn $rows;\n\t}", "public function getInfoList() {\n return $this->_get(6);\n }", "public function getListingBooks()\n {\n return $this->listingBooks;\n }", "public function list(Request $request): \\Illuminate\\Http\\Resources\\Json\\AnonymousResourceCollection\n {\n $this->authorize('list', Poll::class);\n\n $this->validate($request, [\n 'page' => 'numeric',\n 'perPage' => 'numeric',\n 'with' => 'array',\n 'sort' => 'array',\n ]);\n\n $page = (int)$request->get('page', 1);\n $perPage = (int)$request->get('perPage', 10);\n\n $query = Poll::whereOwnerId($request->user()->id);\n\n if ($request->has('with')) {\n if (in_array('emailsList', $request->get('with', []))) {\n $query->with('emailsList');\n }\n }\n\n if ($request->has('sort')) {\n foreach ($request->get('sort') as $key => $direction) {\n $query->orderBy(Str::snake($key), $direction);\n }\n }\n\n $list = $query->paginate($perPage, ['*'], 'page', $page);\n\n return PollResource::collection($list->items())\n ->additional(['pagination' => [\n 'page' => $page,\n 'perPage' => $list->perPage(),\n 'lastPage' => $list->lastPage(),\n 'total' => $list->total(),\n ]]);\n }", "public function getBorrowings();", "public function getOfferListing($asin) {\n $url = $this->getOfferListingBaseURL() . $asin;\n \n return $this->getOfferListingByUrl($url);\n }", "public function getInfoList() {\n return $this->_get(11);\n }", "public function getSummariesList() {\n return $this->_get(1);\n }", "public function getSummariesList() {\n return $this->_get(1);\n }", "public function getSummariesList() {\n return $this->_get(1);\n }", "public function listAll()\n {\n return $this->contractor->all()->pluck('name', 'id')->all();\n }", "public function list()\n {\n return $this->repo->getAll();\n ;\n }", "public function getInfoList() {\n return $this->_get(3);\n }", "public function allUsers()\n {\n return $this->users->merge([$this->owner]);\n }", "public function getShareList($params, $context) {\n\t\t// Validate the RPC caller context.\n\t\t$this->validateMethodContext($context, [\n\t\t\t\"role\" => OMV_ROLE_ADMINISTRATOR\n\t\t]);\n\t\t// Validate the parameters of the RPC service method.\n\t\t$this->validateMethodParams($params, \"rpc.common.getlist\");\n\t\t// Get the configuration objects.\n\t\t$db = \\OMV\\Config\\Database::getInstance();\n\t\t$objects = $db->get(\"conf.service.ftp.share\");\n\t\t// Add additional share information.\n\t\t$objectsAssoc = [];\n\t\tforeach ($objects as $objectk => &$objectv) {\n\t\t\t// Add the new property 'sharedfoldername'.\n\t\t\t$objectv->add(\"sharedfoldername\", \"string\", gettext(\"n/a\"));\n\t\t\t// Get the shared folder configuration object.\n\t\t\t$sfObject = $db->get(\"conf.system.sharedfolder\",\n\t\t\t $objectv->get(\"sharedfolderref\"));\n\t\t\t// Update the 'sharedfoldername' property.\n\t\t\t$objectv->set(\"sharedfoldername\", $sfObject->get(\"name\"));\n\t\t\t$objectsAssoc[] = $objectv->getAssoc();\n\t\t}\n\t\t// Filter the result.\n\t\treturn $this->applyFilter($objectsAssoc, $params['start'],\n\t\t $params['limit'], $params['sortfield'], $params['sortdir']);\n\t}", "public function getUsersList()\n {\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function Callings()\n\t{\n\t\t$q = \"SELECT CallingID FROM MembersCallings WHERE MemberID='$this->ID' ORDER BY ID ASC\";\n\t\t$r = DB::Run($q);\n\n\t\t$callings = array();\n\n\t\twhile ($row = mysql_fetch_array($r))\n\t\t\t$callings[] = Calling::Load($row['CallingID']);\n\n\t\treturn $callings;\n\t}", "public function getList()\n {\n return $this->model\n ->orderBy(DB::raw('type = \"folder\"'), 'desc')\n ->orderBy('id', 'desc')\n ->get();\n }", "public function ownedTeams()\n {\n return $this->request('get', '/api/owned-teams');\n }", "public function listings(Request $request) {\n return redirect(route('home'));\n foreach($request->only(['lat', 'lng', 'bounds', 'location']) as $k => $v) {\n session([$k => $v]);\n }\n\n $data = $this->getListingData($request);\n if($request->get('ajax')) {\n return response()->json($data);\n }\n MetaTag::set('title', __(\"Browse listings\"));\n $reflFunc = new \\ReflectionFunction('active');\n $finder = $reflFunc->getFileName() . ':' .$reflFunc->getStartLine();\n //$data['finder'] = $finder;\n return view('scan.index', $data);\n }", "function listUsers() {\n return $this->users;\n }", "public function getOwnerFollows()\n {\n return $this->http->get('/users/%s/follows', 'self');\n }" ]
[ "0.7160915", "0.6681862", "0.6355202", "0.6309376", "0.62984455", "0.62033033", "0.6140931", "0.60837483", "0.60051763", "0.5975873", "0.59716", "0.5963204", "0.5962228", "0.593347", "0.5855118", "0.5818661", "0.5810291", "0.58078724", "0.5766747", "0.5759229", "0.57576823", "0.57399166", "0.5735284", "0.5720192", "0.57011247", "0.56850475", "0.5679579", "0.5679579", "0.5679579", "0.56707203", "0.5651635", "0.56442225", "0.5640422", "0.5627475", "0.5625126", "0.56128776", "0.5605153", "0.5586258", "0.5579602", "0.5573222", "0.55640644", "0.55636364", "0.5550819", "0.5550462", "0.5541141", "0.5535906", "0.55320346", "0.55255073", "0.5502384", "0.54961056", "0.54953784", "0.5491529", "0.5491529", "0.54897356", "0.54856414", "0.5485562", "0.54838866", "0.54830486", "0.5482417", "0.54806525", "0.54795164", "0.5477898", "0.5469999", "0.54695433", "0.54694825", "0.54667705", "0.54667705", "0.54667705", "0.54621184", "0.54492", "0.54454285", "0.54423654", "0.54321575", "0.54280597", "0.54255337", "0.5420137", "0.5418972", "0.54120976", "0.5409248", "0.54089785", "0.54076046", "0.5406077", "0.5405475", "0.5404409", "0.5404394", "0.5404394", "0.5404394", "0.5402439", "0.5401779", "0.53976256", "0.53940105", "0.53927815", "0.53924274", "0.5390006", "0.53886145", "0.53879875", "0.53874946", "0.5384449", "0.53761125", "0.5373826" ]
0.7713336
0
Display a listing of the resource.
public function index() { $institutes = $this->instituteRepository->index(); return view('Admin.Institute.institute_list', compact('institutes')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { $countries = $this->instituteRepository->countries(); return view('Admin.Institute.institute',compact('countries')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $result = $this->instituteRepository->store($request); return $this->instituteRepository->returnBack($result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Institute $institute) { return $this->instituteRepository->show($institute); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit(Institute $institute) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request, Institute $institute) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Institute $institute) { $this->instituteRepository->delete($institute); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1
/ Run the migrations.
public function up() { Schema::create('fruits', function (Blueprint $table) { $table->increments('id'); $table->string('type'); $table->string('taste'); $table->string('texture'); $table->string('season'); $table->timestamps(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function runAction():void{\n $currentVersion = Migration::getCurrentVersion();\n $migrations = glob($this->config->application->migrationsDir.'*.php');\n $version = count($migrations);\n if((int)$version === $currentVersion){\n Cli::error('Nothing to migrate');\n }\n for($i=($currentVersion+1); $i<=$version; $i++){\n $class= \"MigrationVersion\".$i; \n $migration = new $class();\n $this->executeQueries($migration->up());\n\n Migration::setCurrentVersion($i);\n }\n }", "public static function migrate()\n {\n\n // If there is not a declaration that migrations have been run'd\n if( ! isset($GLOBALS['migrated_test_database']))\n {\n // Run migrations\n require path('sys').'cli/dependencies'.EXT;\n\n $which_db = \\Config::get('database.default');\n $database = \\Config::get('database.connections.'.$which_db);\n\n $migration_table = null;\n if($which_db == 'mysql')\n {\n $query = \"SELECT COUNT(*) AS count FROM information_schema.tables WHERE table_schema = ? AND table_name = ?\";\n $migration_table = \\DB::query($query, array($database['database'], $database['prefix'].'laravel_migrations'));\n }\n\n // if($which_db == 'sqlite')\n // {\n // //$migration = \"SELECT * FROM {$database['database']}.sqlite_master WHERE type='table'\";\n // //sqlite3_exec(budb, \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\"\n // \\sqlite_open(\":memory:\", $database['database']);\n // $migration = \\sqlite_exec($database['database'], \"SELECT sql FROM sqlite_master WHERE sql NOT NULL\");\n // }\n\n if(isset($migration_table['0']->count) and $migration_table['0']->count == '0')\n {\n Command::run(array('migrate:install'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n else\n {\n Command::run(array('migrate:reset'));\n echo \"\\n\";\n Command::run(array('migrate'));\n }\n\n\n //Insert basic data\n\n // Declare that migrations have been run'd\n $GLOBALS['migrated_test_database'] = true;\n }\n }", "public function runDatabaseMigrations()\n {\n $this->parentRunDatabaseMigrations();\n\n $this->artisan('cms:migrate');\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('cms:migrate:rollback');\n });\n }", "public function migrate()\n {\n /**\n * @var $migrator Migrator\n */\n $migrator = $this->app->make('migrator');\n\n /**\n * @var $migratonRepository DatabaseMigrationRepository\n */\n $migratonRepository = $this->app->make('migration.repository');\n\n $migratonRepository->createRepository();\n\n $migrator->run([__DIR__ . \"/../database/migrations\"]);\n\n }", "public function runMigrations()\n {\n if (file_exists($this->baseSqlite())) {\n return;\n }\n\n config(['database.connections.sqlite.database' => $this->copySqlite()]);\n if (method_exists($this, 'withoutMockingConsoleOutput')) {\n $this->withoutMockingConsoleOutput()->artisan('migrate');\n } else {\n Artisan::call('migrate');\n }\n\n // Run Seeders\n copy($this->copySqlite(), $this->baseSqlite());\n return;\n }", "public function execute() {\n $oldMigrations = new Filesystem(\"App/system/databases/migrations\");\n $oldMigrations->addFilter(new MigrationFilter($this->model->getShortModelName()));\n\n\n //todo: write custom iterator\n $oldMigrations->customCallback([$this, \"applyOldMigrations\"]);\n //todo: get the current model and get the diffrences between that and the migration\n //todo: write a new migration.\n //\n // $this->buildChangeSet();\n //do stuff execute all the things\n $this->createNewMigration();\n\n }", "public function run(){\n return Artisan::call('migrate');\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n \t\n \tUser::truncate();\n \n Schema::enableForeignKeyConstraints();\n\n $usersToMigrate = Migrate::all();\n\n collect($usersToMigrate)->each(function($user) {\n \t$this->create($user);\n });\n\n $this->admin();\n }", "public function runDatabaseMigrations()\n {\n if (!$this->runMigrations) {\n return;\n }\n\n $this->artisan('migrate:fresh');\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n });\n }", "public function runDatabaseMigrations()\n {\n $this->artisan('migrate:fresh', $this->migrateFreshUsing());\n\n $this->app[Kernel::class]->setArtisan(null);\n\n $this->beforeApplicationDestroyed(function () {\n $this->artisan('migrate:rollback');\n\n RefreshDatabaseState::$migrated = false;\n });\n }", "public function callMigration()\n {\n Artisan::call('lucy:migration', $this->builder->getAttribute('migration'));\n\n Artisan::call('migrate');\n }", "public function run()\n {\n $this->call(UsersTableSeeder::class);\n $this->call(ConditionsTableSeeder::class);\n $this->call(DeliveriesTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(AdvertsTableSeeder::class);\n // plaats postcode import in eigen / aparte seeder class ==>> Made migration (else DB:rename doesn't work inside seeder, makes copy)\n }", "public function run()\n {\n Artisan::call('migrate:refresh');\n $this->populateUsers();\n $this->populatePosts();\n $this->populateComments();\n }", "public function migrate() {}", "public function run()\n {\n \t$this->cleanDatabase();\n\n $this->call(LessonsTableSeeder::class);\n $this->call(TagsTableSeeder::class);\n $this->call(LessonTagTableSeeder::class);\n }", "public function run(): void \n {\n // Ask for DB migration refresh, default is no \n if ($this->command->confirm('Do you wish to refresh migrations before seeding, it will clear all old data?')) {\n $this->command->call('migrate:refresh');\n $this->command->warn('Data cleared, starting from blank database.');\n }\n\n // Run other seeders in the system. \n $this->call(AclTableSeeder::class);\n $this->call(CityTableSeeder::class);\n $this->call(PageFragmentsSeeder::class);\n }", "public function run()\n {\n $this->runQueriesFromSqlFile('1.3.4.3');\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n\n $fileSystem->copy(\n __DIR__.'/../database/migrations/2018_06_29_032244_create_laravel_follow_tables.php',\n __DIR__.'/database/migrations/create_laravel_follow_tables.php'\n );\n\n foreach ($fileSystem->files(__DIR__.'/database/migrations') as $file) {\n $fileSystem->requireOnce($file);\n }\n\n (new \\CreateLaravelFollowTables())->up();\n (new \\CreateUsersTable())->up();\n (new \\CreateOthersTable())->up();\n }", "public static function dbMigrate(){\n\t\tif (App::runningUnitTests()) {\n\t\t\t//Migrate the database\n\t\t\tArtisan::call('migrate');\n\t\t}\n\t}", "function migrate_db() {\r\n \r\n // $migrater->create_migrations_table();\r\n // $migrater->build_schema();\r\n }", "public function migrate()\n {\n $fileSystem = new Filesystem();\n $classFinder = new ClassFinder();\n\n foreach ($fileSystem->files(__DIR__.'/../../../../tests/NilPortugues/App/Migrations') as $file) {\n $fileSystem->requireOnce($file);\n $migrationClass = $classFinder->findClass($file);\n (new $migrationClass())->down();\n (new $migrationClass())->up();\n }\n }", "public function run()\n {\n $clear = $this->command->confirm('Wil je de database leegmaken? (Dit haalt alle DATA weg)');\n\n if ($clear):\n $this->command->callSilent('migrate:refresh');\n $this->command->info('Database Cleared, starting seeding');\n endif;\n\n $this->call([\n SeedSeeder::class,\n RoleSeeder::class,\n UserSeeder::class,\n // BoardgameSeeder::class,\n BoardgamesTableSeeder::class,\n StatusSeeder::class,\n TournamentSeeder::class,\n AchievementsSeeder::class,\n TournamentUsersSeeder::class,\n ]);\n }", "public function run()\n {\n \t// Ask for db migration refresh, default is no\n if ($this->command->confirm('Do you wish to refresh migration before seeding, it will clear all old data ?')) {\n // Call the php artisan migrate:refresh\n $this->command->call('migrate:refresh');\n $this->command->warn(\"Data cleared, starting from blank database.\");\n }\n \n // $this->call(UsersTableSeeder::class);\n $this->call(PermissionSeed::class);\n $this->call(RoleSeed::class);\n $this->call(UserSeed::class);\n\n // Ask for adding test data, default is no\n if ($this->command->confirm('Do you wish to add test data ?')) {\n // test data seeder\n $this->call(SampleDataSeeder::class);\n }\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n\n $this->call(users::class);\n $this->call(affiliates::class);\n $this->call(productInfo::class);\n\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n if ($this->command->confirm('Do you want to fresh the database?',true)) {\n $this->command->call('migrate:fresh');\n $this->command->info('Database was freshed');\n }\n $this->call([\n UsersTableSeeder::class\n ]);\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('UserTableSeeder');\n\n\t\t$this->call('StaticDepartmentTableSeeder');\n $this->command->info('static_departments table seeded!');\n\n\t\t$this->call('StaticHostelTableSeeder');\n $this->command->info('static_hostels table seeded!');\n\n\t\t$this->call('StaticMinorTableSeeder');\n $this->command->info('static_minors table seeded!');\n\t}", "public function run()\n {\n // $this->call(UserSeeder::class);\n // $this->cleanDatabase();\n //DB::statement('SET FOREIGN_KEY_CHECKS = \"0\"');\n $this->call([\n HotelListsTableSeeder::class,\n UsersTableSeeder::class,\n RoomListsTableSeeder::class,\n BookingListsTableSeeder::class,\n QuestListsTableSeeder::class,\n\n ]);\n // DB::statement('SET FOREIGN_KEY_CHECKS = \"1\"');\n }", "public function run()\n {\n $this->call(PermissionsTable::class);\n $this->call(MarcaTableSeeder::class);\n $this->call(TipoDuenoTableSeeder::class);\n //$this->call(DuenoTableSeeder::class);\n //$this->call(VehiculosTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n //$this->call(RegistroTableSeeder::class);\n\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n DB::table('labor_unions')->truncate();\n\n LaborUnion::create([\n 'id' => 1,\n 'name' => 'Sindicato de Trabajadores San Bernardo Asociados',\n ]);\n\n LaborUnion::create([\n 'id' => 2,\n 'name' => 'Sindicato 1 Los Andes',\n ]);\n\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->command->info('User table seeded!');\n\t\t$this->call('PertaniansTableSeeder');\n\t\t$this->command->info('Pertanian table seeded!');\n\t\t$this->call('PeternakansTableSeeder');\n\t\t$this->command->info('Peternakan table seeded!');\n\t\t$this->call('TicsTableSeeder');\n\t\t$this->command->info('TIC table seeded!');\n\n\t}", "public function run()\n {\n //\n Schema::disableForeignKeyConstraints();\n User::truncate();\n\n $admin = User::create([\n 'name' => 'Admin User',\n 'email' => '[email protected]',\n 'password' => Hash::make('password'),\n \n ]);\n $admin->assignRole('admin');\n\n $tutor = User::create([\n 'name' => 'Tutor User',\n 'email' => '[email protected]',\n 'password' => Hash::make('password'),\n \n ]);\n $tutor->assignRole('tutor');\n\n $student = User::create([\n 'name' => 'Student User',\n 'email' => '[email protected]',\n 'password' => Hash::make('password'),\n 'course_id' => '1',\n 'tutor_id' => $tutor->id\n ]);\n $student->assignRole('student');\n \n Digitutor::create([\n 'user_id' => $student->id,\n ]);\n\n Schema::enableForeignKeyConstraints();\n\n }", "public function run(){\n \n //product\n if (!Schema::hasColumn('products', 'plus_option')) {\n Schema::table('products', function (Blueprint $table) {\n $table->boolean('plus_option')->default(true)->after('is_active');\n });\n }\n\n //coupons\n if (!Schema::hasColumn('coupons', 'times')) {\n Schema::table('coupons', function (Blueprint $table) {\n $table->integer('times')->default(0)->after('is_active');\n });\n }\n\n //option groups\n if (!Schema::hasColumn('option_groups', 'required')) {\n Schema::table('option_groups', function (Blueprint $table) {\n $table->boolean('required')->default(false)->after('multiple');\n });\n }\n\n //force migration for new tables\n if (!Schema::hasTable('coupon_user')) {\n Artisan::call('migrate --path=database/migrations/2021_08_07_124104_create_coupon_user_pivot_table.php --force');\n }\n\n //vendor min/max orders\n if (!Schema::hasColumn('vendor_types', 'color')) {\n Schema::table('vendor_types', function (Blueprint $table) {\n $table->string('color')->default(\"#000\")->after('name');\n });\n }\n\n //users\n if (!Schema::hasColumn('users', 'country_code')) {\n Schema::table('users', function (Blueprint $table) {\n $table->string('country_code')->nullable()->after('phone');\n });\n }\n\n }", "private function runTestMigrations()\n {\n $schema = $this->app['db']->connection()->getSchemaBuilder();\n\n if (! $schema->hasTable('users')) {\n $schema->create('users', function (Blueprint $table) {\n $table->increments('id');\n $table->string('name')->nullable();\n $table->string('role_label')->nullable();\n $table->timestamps();\n });\n }\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name'=>\"test\",\n 'password' => Hash::make('123'),\n 'email'=>'[email protected]'\n ]);\n DB::table('tags')->insert(['name'=>'tags']);\n $this->call(UserSeed::class);\n $this->call(CategoriesSeed::class);\n $this->call(TopicsSeed::class);\n $this->call(CommentariesSeed::class);\n // $this->call(UsersTableSeeder::class);\n }", "public function run() {\n Eloquent::unguard();\n\n $this->call('AccountsTableSeeder');\n $this->command->info('accounts table seeded!');\n \n $this->call('KeyringsTableSeeder');\n $this->command->info('keyrings table seeded!');\n }", "public function run()\n {\n /*app('db')\n ->table('users')\n ->insert([\n 'first_name' => 'test_first1',\n 'last_name' => 'test_last1',\n 'email' => '[email protected]',\n 'password' => 'test123'\n ]);*/ \n \n app('db')\n ->table('users')\n ->insert([\n 'first_name' => 'test_first2',\n 'last_name' => 'test_last2',\n 'email' => '[email protected]',\n 'password' => 'test12345'\n ]);\n }", "public function run()\n {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n // Delete all records.\n DB::table('users')->delete();\n // Reset AUTO_INCREMENT.\n DB::table('users')->truncate();\n\n // Dev user.\n App\\Models\\User::create([\n 'email' => '[email protected]',\n 'password' => '$2y$10$t6q81nz.XrMrh20NHDvxUu/szwHBwgzPd.01e8uuP0qVy0mPa6H/e',\n 'first_name' => 'L5',\n 'last_name' => 'App',\n 'username' => 'l5-app',\n 'is_email_verified' => 1,\n ]);\n\n // Dummy users.\n TestDummy::times(10)->create('App\\Models\\User');\n }", "public function run()\n {\n $this->call([UserDatabaseSeeder::class,Lab406DatabaseSeeder::class]);\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n DB::beginTransaction();\n try {\n $this->call([\n UsersTableSeeder::class,\n DominiosTableSeeder::class,\n TiposCobrancasTableseeder::class,\n CotacoesTablesSeeder::class\n ]);\n DB::commit();\n } catch(\\Exception $e){\n DB::rollback();\n dd($e->getMessage());\n }\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t$this->call('UsersTableSeeder');\n\t\t$this->command->info('users table seeded!');\n\n\t\t$this->call('BulbsTableSeeder');\n\t\t$this->command->info('bulbs table seeded!');\n\n\t\t$this->call('ClustersTableSeeder');\n\t\t$this->command->info('clusters table seeded!');\n\n\t\t$this->call('SchedulesTableSeeder');\n\t\t$this->command->info('schedules table seeded!');\n\n\t\t$this->call('ClusterScheduleTableSeeder');\n\t\t$this->command->info('cluster_schdedule table seeded!');\n\n\t\t$this->call('BulbClusterTableSeeder');\n\t\t$this->command->info('bulb_cluster table seeded!');\n\n\t\t$this->call('PoweranalyzerTableSeeder');\n\t\t$this->command->info('poweranalyzer table seeded!');\n\t}", "public function run()\n {\n $this->call(RolesAndPermissionsTableSeeder::class);\n $this->call(UsersTableSeeder::class);\n $this->call(ReadersTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(KeywordsTableSeeder::class);\n $this->call(ArticlesTableSeeder::class);\n $this->call(CommentsTableSeeder::class);\n $this->call(ConfigsTableSeeder::class);\n if (env('APP_ENV') == 'local') {\n $this->command->info('All table seeded successfully!');\n $this->command->info('username: [email protected] | password: owner');\n }\n }", "public function run()\n {\n\n Schema::disableForeignKeyConstraints(); //in order to execute truncate before seeding\n\n $this->call(UsersTableSeeder::class);\n $this->call(PostCategoriesSeeder::class);\n $this->call(TagsSeeder::class);\n $this->call(PostsSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n \\Illuminate\\Database\\Eloquent\\Model::unguard();\n\n $this->createAdmin();\n $this->generateAdminDevMenus();\n\n \\Illuminate\\Database\\Eloquent\\Model::reguard();\n }", "public function run()\n {\n DB::table('users')->insert([\n 'name' => 'Super Admin',\n 'email' => '[email protected]',\n 'phone' => '201002211824',\n 'password' => bcrypt('INNO_tour@2015'),\n 'confirmed'=>'1',\n 'active'=>'1'\n ]);\n\n DB::table('users_roles')->insert([\n 'role_id' => '3',\n 'user_id'=>'1'\n ]);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call(StartUpTableSeeder::class);\n $this->call(StartUpCategoryTableSeeder::class);\n $this->call(TechPostsTableSeeder::class);\n $this->call(TechCategoryTableSeeder::class);\n }", "public function run()\n {\n Schema::create('fileuploads', function (Blueprint $table) {\n $table->increments('id');\n $table->string('filename');\n $table->timestamps();\n });\n }", "public function run()\n {\n\n\n\n\n $this->call(RoleTableSeeder::class);\n\n $this->command->info('Roles sample created successfully');\n\n\n $this->call(PermissionTableSeeder::class);\n\n $this->command->info('Permissions sample created successfully');\n\n $this->call(UserTableSeeder::class);\n\n $this->command->info('Users sample created successfully');\n\n\n $this->call(ProjectTableSeeder::class);\n\n $this->command->info('Projects sample created successfully');\n\n\n $this->call(TaskTableSeeder::class);\n\n $this->command->info('Tasks sample created successfully');\n }", "public function migrate()\n {\n Artisan::call('migrate', [\n '--seed' => true\n ]);\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n\n $this->call(UsersTableSeeder::class);\n $this->call(CategoriesTableSeeder::class);\n $this->call(TagsTableSeeder::class);\n $this->call(PassportClientSeeder::class);\n $this->call(PlaylistsTableSeeder::class);\n\n\n Schema::enableForeignKeyConstraints();\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2014_10_12_000000_create_users_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2014_10_12_100000_create_password_resets_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_01_29_011038_create_categories_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_01_29_011130_create_items_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_01_29_011207_create_requests_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_01_29_011313_create_statuses_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_01_29_011320_create_roles_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_01_29_011330_create_userstatuses_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_01_29_023302_add_roleid_userstatusid_users',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_01_29_023330_add_categoryid_items',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_01_29_023409_add_userid_statusid_itemid_requests',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_01_29_042432_drop_contactnumber_users',\n 'batch' => 2,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_01_30_064421_add_statusid_items',\n 'batch' => 3,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_01_31_013147_rename_requests_to_laptoprequests',\n 'batch' => 4,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_01_31_014418_rename_laptoprequests',\n 'batch' => 5,\n ),\n ));\n \n \n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call('RoleTableSeeder');\n $this->call('PositionsTableSeeder');\n $this->call('EditionTypesTableSeeder');\n $this->call('StagesTableSeeder');\n $this->call('WorkType_PositionsTableSeeder');\n $this->call('WorkTypesTableSeeder');\n\n\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t$this->call('UserTableSeeder');\n $this->command->info('User table seeded!');\n\n $this->call('PlannerTableSeeder');\n $this->command->info('Planner table seeded!');\n\n $this->call('ProfileTableSeeder');\n $this->command->info('Profile table seeded!');\n\n $this->call('OrganisationTableSeeder');\n $this->command->info('Organisation table seeded!');\n\n $this->call('RoleTableSeeder');\n $this->command->info('Role table seeded!');\n\n $this->call('PermissionTableSeeder');\n $this->command->info('Permission table seeded!');\n\n $this->call('SubscriberTableSeeder');\n $this->command->info('Subscriber table seeded!');\n }", "public function run()\n {\n\t $this->call(CategoryTableSeed::class);\n\t $this->call(ProductTableSeed::class);\n\t $this->call(UserTableSeed::class);\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n App\\Role::truncate();\n\n $admin = new App\\Role;\n $admin->id = 1;\n $admin->name = 'Admin';\n $admin->machine_name = 'admin';\n $admin->save();\n\n $seller = new App\\Role;\n $seller->id = 2;\n $seller->name = 'Seller';\n $seller->machine_name = 'seller';\n $seller->save();\n\n $customer = new App\\Role;\n $customer->id = 3;\n $customer->name = 'Customer';\n $customer->machine_name = 'customer';\n $customer->save();\n\n Schema::enableForeignKeyConstraints();\n }", "public function run()\n\t{\n \n Eloquent::unguard();\n //DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\t\t$this->call('UserTableSeeder');\n\t $this->call('LayerTableSeeder');\n $this->call('UserLevelTableSeeder');\n $this->call('RoleUserTableSeeder');\n $this->call('RoleLayerTableSeeder');\n $this->call('BookmarkTableSeeder');\n \n //DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n\t}", "public function run()\n\t{\n\t\tModel::unguard();\n\n\t\t//$this->call('UserTableSeeder');\n //$this->command->info('User table seeded!');\n\t\t\n //$this->call('SupplierTableSeeder');\n //$this->command->info('Supplier table seeded!');\n\n //$this->call('CustomerTableSeeder');\n //$this->command->info('Customer table seeded!');\n\n\t\t$this->call('StatusTableSeeder');\n\t\t$this->command->info('Status table seeded!');\n\t}", "public function up(){\n $migration_files=dirToArray($this->migrations_dir);\n if(!sizeof($migration_files)){\n die('migration does not exist');\n }\n\n //check MIGRATION_TABLE_NAME\n $this->_check_table();\n\n //check run migrations\n $migration_files=$this->_check_run_migrations($migration_files);\n\n if(sizeof($migration_files)<=0){\n die('migration file does not exist');\n }\n\n $responses = [];\n foreach($migration_files as $file){\n $responses[] = $this->_run($file,'up');\n }\n return $responses;\n }", "public function run()\n {\n\n $this->call(RoleTableSeeder::class);\n $this->command->info('Role table seeded!');\n\n $this->call(UsersTableSeeder::class);\n $this->command->info('User table seeded!');\n\n $this->call(FollowersTableSeeder::class);\n $this->command->info('Follower table seeded!');\n\n $this->call(PostsTableSeeder::class);\n $this->command->info('Post table seeded!');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call([\n //PostsTableSeeder::class,\n MileBasicSettingsTableSeeder::class,\n ]);\n }", "public function run()\n {\n //$this->call(UsersTableSeeder::class);\n\n $this->call(PermissionsTableSeeder::class);\n $this->call(PermissionsTableSeeder2::class);\n $this->call(PermissionsTableSeeder3::class);\n $this->call(PermissionTableSeeder4::class);\n $this->call(UsersTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(NotificationTypeTableSeeder::class);\n $this->call(MissingTableSeeder::class);\n\n\n }", "public function run()\n {\n $this->call(PlantTableSeeder::class);\n $this->command->info('Таблица растений создана');\n\n $this->call(FamilyTableSeeder::class);\n $this->command->info('Таблица семейств создана');\n\n $this->call(CountryTableSeeder::class);\n $this->command->info('Таблица стран создана');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n\n $this->call([\n CgySeeder::class,\n //ProductSeeder::class,\n PaymentSeeder::class,\n ShippingSeeder::class,\n ]);\n DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n $this->truncteTables([\n 'users',\n 'products'\n ]);\n\n $this->call(UsersSeeder::class);\n $this->call(ProductsSeeder::class);\n\n }", "public function run()\n {\n \t$this->call(ActivitiesTableSeeder::class);\n $this->call(ApplicantsTableSeeder::class);\n $this->call(AttendanceTableSeeder::class);\n $this->call(BusTableSeeder::class);\n $this->call(HiredDriversTableSeeder::class);\n $this->call(LeavesTableSeeder::class);\n $this->call(QuestionTableSeeder::class);\n $this->call(UserTableSeeder::class);\n //$this->call(ApplicantsTableSeeder::class);\n \t\n }", "public function run()\n {\n //$this->call(UserSeeder::class);\n\n //$this->call(UsersTableSeeder::class); //2021-02-24 add, for sanctum\n //mark it, use command=> php artisan db:seed --class=UsersTableSeeder\n }", "public function run()\n {\n // $this->call(UserSeeder::class);\n $this->call(SeedFurnitureTable::class);\n $this->call(SeedCategoriesTable::class);\n $this->call(SeedUsersTable::class);\n $this->call(SeedMaterialsTable::class);\n $this->call(SeedOrdersTable::class);\n $this->call(SeedPromotionsTable::class);\n $this->call(SeedReviewsTable::class);\n $this->call(SeedTaxesTable::class);\n $this->call(SeedManufacturersTable::class);\n $this->call(SeedTransactionsTable::class);\n $this->call(SeedFurnitureOrderTable::class);\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n $this->call([\n UserSeeder::class,\n ProfileSeeder::class,\n AdminSeeder::class\n ]);\n\n DB::statement(\"ALTER SEQUENCE users_id_seq RESTART WITH 1001\");\n DB::statement(\"ALTER SEQUENCE profiles_id_seq RESTART WITH 1001\");\n\n }", "public function migrate()\n\t{\n\t}", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->command->info('Creating some Fake data');\n $this->call(CategoriesTableSeeder::class);\n $this->call(JobTypesTableSeeder::class);\n $this->call(JobsTableSeeder::class);\n }", "public function run()\n {\n //$this->call(UserTableSeeder::class);\n $this->call(PostTableSeeder::class);\n }", "function run()\n {\n if (count($this->args) <= 1) {\n $this->help();\n } else {\n switch ($this->args[1]) {\n case \"migrate\":\n $this->createMigrations();\n if (!isset($this->args[2]) || $this->args[2] != '--seed')\n break;\n case \"seed\":\n $this->createSeeds();\n break;\n case \"migrate:drop\":\n $this->dropMigrations();\n break;\n case \"seed:drop\":\n $this->dropSeeds();\n break;\n default:\n $this->help();\n break;\n }\n }\n }", "public function run()\n {\n if(config('database.default') !== 'sqlite'){\n DB::statement('SET FOREIGN_KEY_CHECKS=0');\n }\n\n \\App\\TradeType::truncate();\n $this->call(TradeTypesTableSeeder::class);\n\n \\App\\Kind::truncate();\n $this->call(KindsTableSeeder::class);\n\n \\App\\ItemType::truncate();\n $this->call(ItemTypesTableSeeder::class);\n\n \\App\\EtfType::truncate();\n $this->call(EtfTypesTableSeeder::class);\n\n\n\n if(config('database.default') !== 'sqlite'){\n DB::statement('SET FOREIGN_KEY_CHECKS=1');\n }\n\n }", "public function run()\n {\n Model::unguard();\n\n // $this->call(TodoTableSeeder::class);\n\n // $this->call(TimeEntriesTableSeeder::class);\n // $this->call(UsersTableSeeder::class);\n // $this->command->info('User and Time entry seeded');\n\n\n // $this->call(UserTableSeeder::class);\n // $this->call(CommentTableSeeder::class);\n\n // Comment::create([\n // 'author' => 'Chris Sevilleja',\n // 'text' => 'Look I am a test comment.'\n // ]);\n \n // Comment::create(array(\n // 'author' => 'Nick Cerminara',\n // 'text' => 'This is going to be super crazy.'\n // ));\n \n // Comment::create(array(\n // 'author' => 'Holly Lloyd',\n // 'text' => 'I am a master of Laravel and Angular.'\n // ));\n\n\n // $this->command->info('Comment table seeded.');\n\n Model::reguard();\n }", "public function run()\n {\n if (env('DB_DATABASE') == 'connection') {\n Connection::create([\n \"ruc\" => \"12312312312\",\n \"basedata\" => \"nbdata2018_1\",\n ]);\n \n Connection::create([\n \"ruc\" => \"12312312315\",\n \"basedata\" => \"nbdata2018_2\",\n ]);\n \n $this->call(ConnectionTableSeeder::class);\n } else {\n $this->call(AppSeeder::class);\n }\n }", "public function run()\n {\n \n\n \\DB::table('migrations')->delete();\n \n \\DB::table('migrations')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'migration' => '2019_03_13_181656_create_categories_table',\n 'batch' => 1,\n ),\n 1 => \n array (\n 'id' => 2,\n 'migration' => '2019_03_13_181656_create_failed_jobs_table',\n 'batch' => 1,\n ),\n 2 => \n array (\n 'id' => 3,\n 'migration' => '2019_03_13_181656_create_links_table',\n 'batch' => 1,\n ),\n 3 => \n array (\n 'id' => 4,\n 'migration' => '2019_03_13_181656_create_model_has_permissions_table',\n 'batch' => 1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'migration' => '2019_03_13_181656_create_model_has_roles_table',\n 'batch' => 1,\n ),\n 5 => \n array (\n 'id' => 6,\n 'migration' => '2019_03_13_181656_create_notifications_table',\n 'batch' => 1,\n ),\n 6 => \n array (\n 'id' => 7,\n 'migration' => '2019_03_13_181656_create_password_resets_table',\n 'batch' => 1,\n ),\n 7 => \n array (\n 'id' => 8,\n 'migration' => '2019_03_13_181656_create_permissions_table',\n 'batch' => 1,\n ),\n 8 => \n array (\n 'id' => 9,\n 'migration' => '2019_03_13_181656_create_replies_table',\n 'batch' => 1,\n ),\n 9 => \n array (\n 'id' => 10,\n 'migration' => '2019_03_13_181656_create_role_has_permissions_table',\n 'batch' => 1,\n ),\n 10 => \n array (\n 'id' => 11,\n 'migration' => '2019_03_13_181656_create_roles_table',\n 'batch' => 1,\n ),\n 11 => \n array (\n 'id' => 12,\n 'migration' => '2019_03_13_181656_create_topics_table',\n 'batch' => 1,\n ),\n 12 => \n array (\n 'id' => 13,\n 'migration' => '2019_03_13_181656_create_users_table',\n 'batch' => 1,\n ),\n 13 => \n array (\n 'id' => 14,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_permissions_table',\n 'batch' => 1,\n ),\n 14 => \n array (\n 'id' => 15,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_model_has_roles_table',\n 'batch' => 1,\n ),\n 15 => \n array (\n 'id' => 16,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_replies_table',\n 'batch' => 1,\n ),\n 16 => \n array (\n 'id' => 17,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_role_has_permissions_table',\n 'batch' => 1,\n ),\n 17 => \n array (\n 'id' => 18,\n 'migration' => '2019_03_13_181657_add_foreign_keys_to_topics_table',\n 'batch' => 1,\n ),\n ));\n \n \n }", "public function run()\n {\n $this->cleanDatabase();\n\n Model::unguard();\n\n $this->call('RolesTableSeeder');\n $this->call('SanghasTableSeeder');\n $this->call('UsersTableSeeder');\n $this->call('SanghaUserTableSeeder');\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t// $this->call('UserTableSeeder');\n\n\t\t// $this->call('ProjectAppTableSeeder');\n\t\t// $this->command->info('Project status table seeded!');\n\n\n\t\t// $this->call('AreaTableSeeder');\n\t\t// $this->command->info('Areas Table table seeded!');\n\n\t\t// $this->call('PhoneTypeTableSeeder');\n\t\t// $this->command->info('Phone Types table seeded!');\n\n\t\t// $this->call('ProjectClassificationSeeder');\n\t\t// $this->command->info('Project Classifications table seeded!');\n\n\t\t// $this->call('DepartmentTableSeeder');\n\t\t// $this->command->info('Department Table table seeded!');\n\n\t\t// $this->call('RoleTableSeeder');\n\t\t// $this->command->info('Role Table table seeded!');\n\n\t\t// $this->call('PermissionTableSeeder');\n\t\t// $this->command->info('Permission Table table seeded!');\n\n\t\t// $this->call('UserTableSeeder');\n\t\t// $this->command->info('Users Table table seeded!');\n\n\t\t// $this->call('ProjectContactStatusTableSeeder');\n\t\t// $this->command->info('Project contact status table seeded!');\n\n\n\t}", "public function run()\n {\n DB::table('finances')->insert([\n\n 'name' => 'Budžets',\n 'description' => 'Test1',\n 'sum' => ('300.40'),\n ]);\n DB::table('folders')->insert([\n 'name' => 'Finanses',\n 'description' => 'Test1',\n ]);\n DB::table('uploads')->insert([\n 'name' => 'budžets2018',\n 'folder_id'=>'1',\n 'description' => 'Test1',\n ]);\n DB::table('storages')->insert([\n 'name' => 'MT',\n ]);\n }", "public function run()\n {\n $this->call([UsersTableSeeder::class]);\n $this->call([ContratosTableSeeder::class]);\n $this->call([UsuariosTableSeeder::class]);\n $this->call([UnidadesTableSeeder::class]);\n $this->call([AtestadosTableSeeder::class]);\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->createDefaultPermissionSeeder(env('DB_CONNECTION', 'mysql'));\n }", "public function run()\n {\n $this->call([\n UserTableSeeder::class,\n AuthorsTableSeeder::class,\n JobsTableSeeder::class\n ]);\n }", "public function run()\n {\n /* $this->truncateTables([\n 'tipoPerfil',\n 'users'\n\n ]);*/\n\n $this->call([TipoPerfilSeeder::class]);\n $this->call([UsersTableSeeder::class]);\n $this->call([AreaConocimientoSeeder::class]);\n $this->call([EstudiantesTableSeeder::class]);\n $this->call([NivelSeeder::class]);\n $this->call([CapitulosSeeder::class]);\n $this->call([ProfesoresSeeder::class]);\n }", "public function run()\n {\n $this->call([\n UsersTableSeeder::class,\n CompaniesTableSeeder::class,\n JobsTableSeeder::class,\n CategoriesTableSeeder::class,\n ]);\n }", "public function run()\n {\n Model::unguard();\n\n if (env('DB_CONNECTION') == 'mysql') {\n DB::statement('SET FOREIGN_KEY_CHECKS=0;');\n }\n\n $this->call(AccessTableSeeder::class);\n\n if (env('DB_CONNECTION') == 'mysql') {\n \\Illuminate\\Support\\Facades\\DB::statement('SET FOREIGN_KEY_CHECKS=1;');\n }\n\n \\Illuminate\\Database\\Eloquent\\Model::reguard();\n }", "public function run()\n {\n //delete users table records\n DB::table('users')->delete();\n //insert some dummy records\n DB::table('users')->insert(array(\n array('name'=>'Mario','email'=>'[email protected]','password'=>Hash::make('123456'),'rol'=>'alumne'),\n array('name'=>'Admin','email'=>'[email protected]','password'=>Hash::make('123456'),'rol'=>'professor'),\n ));\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n\n $this->eliminarTablas([\n 'carreras',\n 'rfits',\n 'usuarios',\n ]);\n\n $this->call(carrerasSeeder::class);\n $this->call(r_fitsSeeder::class);\n $this->call(usuariosSeeder::class);\n }", "public function run()\n {\n\n $this->truncateTables([\n 'courses',\n 'roles',\n 'type_courses',\n 'unities',\n 'users',\n 'companies',\n 'permissions',\n 'Locations'\n ]);\n \n $this->call(UnityTableSeeder::class);\n $this->call(TypeCoursesTableSeeder::class);\n $this->call(CourseTableSeeder::class);\n $this->call(RoleTableSeeder::class);\n $this->call(PermissionTableSeeder::class);\n $this->call(CompanyTableSeeder::class);\n $this->call(UserTableSeeder::class);\n $this->call(LocationSeeder::class);\n\n\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n DB::table('users')->insert([\n \t'name' => 'Gerardo Steven',\n 'email' => '[email protected]',\n 'password' => Hash::make('root'),\n 'rol' => 0,\n ]);\n DB::table('users')->insert([\n \t'name' => 'Gerardo User',\n 'email' => '[email protected]',\n 'password' => Hash::make('root'),\n 'rol' => 1,\n ]);\n }", "public function run()\n {\n Eloquent::unguard();\n \n $this->call('AdminMemberTableSeeder');\n $this->call('BankInfoTableSeeder');\n $this->call('LocationLookUpTableSeeder');\n $this->call('OrderStatusTableSeeder');\n $this->call('AdminRoleTableSeeder');\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n // Para que no verifique el control de claves foráneas al hacer el truncate haremos:\n\t\tDB::statement('SET FOREIGN_KEY_CHECKS=0');\n\n\t\t// Primero hacemos un truncate de las tablas para que no se estén agregando datos\n\t\t// cada vez que ejecutamos el seeder.\n\t\t//Foto::truncate();\n\t\t//Album::truncate();\n\t\t//Usuario::truncate();\n DB::table('users')->delete();\n DB::table('ciudades')->delete();\n DB::table('tiendas')->delete();\n DB::table('ofertas')->delete();\n DB::table('ventas')->delete();\n\n\n\t\t// Es importante el orden de llamada.\n\t\t$this->call('UserSeeder');\n $this->call('CiudadSeeder');\n\t\t$this->call('TiendaSeeder');\n $this->call('OfertaSeeder');\n $this->call('VentaSeeder');\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n $this->call([\n UsersTableSeeder::class,\n ProductsTableSeeder::class,\n ]);\n }", "public function run()\n {\n Model::unguard();\n\n $this->call(FirstAdminSeed::class);\n $this->call(UserTableSeed::class);\n $this->call(UserProfileTableSeed::class);\n $this->call(ProductoTableSeed::class);\n $this->call(ContactenosTableSeed::class);\n\n Model::reguard();\n }", "public function run()\n {\n // \\App\\Models\\User::factory(10)->create();\n\n $this->call(LaRbacDatabaseSeeder::class);\n // User::truncate();\n // User::create([\n // 'name' => '',\n // 'email' => '[email protected]',\n // 'password' => Hash::make('mypassword'),\n // ]);\n }", "public function run()\n\t{\n\t\tEloquent::unguard();\n\n\t\t$this->call('RolesTableSeeder');\n\t\t$this->command->info('Roles table seeded!');\n\n\t\t$this->call('UsuariosTableSeeder');\n\t\t$this->command->info('Usuarios table seeded!');\n\n\t}", "public function run()\n {\n $this->call(PermissionTableSeeder::class);\n $this->call(SysAdminSeeder::class);\n $this->call(RolesSeeder::class);;\n }", "public function run()\n {\n Schema::disableForeignKeyConstraints();\n\n $this->call(UserSeeder::class);\n $this->call(TeamSeeder::class);\n $this->call(MatchSeeder::class);\n\n Schema::enableForeignKeyConstraints();\n }", "public function migrate()\n\t{ \n\t\t(new MigratorInterface)->migrate();\n\t}", "public function run()\n {\n// $this->call(PermissionTableSeeder::class); //moved to User..\n $this->call(UserTableSeeder::class);\n// $this->call(BlogCategoryTableSeeder::class);\n// $this->call(ServiceCategoryTableSeeder::class);\n// $this->call(BriefServiceTableSeeder::class);\n// $this->call(BriefAboutTableSeeder::class);\n $this->call(BlogTableSeeder::class);\n\n }", "public function run()\n {\n // $this->call(UsersTableSeeder::class);\n UsersLevel::create([\n 'name' => 'Administrator'\n ]);\n\n UsersLevel::create([\n 'name' => 'User'\n ]);\n\n User::create([\n 'username' => 'admin',\n 'password' => bcrypt('admin123'),\n 'level_id' => 1,\n 'fullname' => \"Super Admin\",\n 'email'=> \"[email protected]\"\n ]);\n\n\n \\App\\CategoryPosts::create([\n 'name' =>'Paket Trip'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' =>'Destinasi Kuliner'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Event'\n ]);\n\n \\App\\CategoryPosts::create([\n 'name' => 'Profil'\n ]);\n }", "public function run()\n {\n DB::table('roles')->insert([\n 'name' => 'test_role',\n ]);\n\n DB::table('users')->insert([\n 'name' => 'test_user',\n 'role_id' => 1,\n 'api_token' => 'A9QKUyb54amSM5EWj8wC9c6jmUKmaLjx',\n ]);\n\n DB::table('role_permissions')->insert([\n 'role_id' => 1,\n 'ability' => 'test_ability',\n ]);\n }" ]
[ "0.75275457", "0.7504146", "0.741662", "0.74043643", "0.731344", "0.7170822", "0.716727", "0.7116556", "0.71116215", "0.70874274", "0.7013769", "0.69981027", "0.699646", "0.69708437", "0.6958594", "0.6922959", "0.6914705", "0.688172", "0.6867588", "0.68307316", "0.6829838", "0.68269455", "0.6818932", "0.6805986", "0.6799486", "0.67791873", "0.67561585", "0.67456096", "0.6745378", "0.67359155", "0.67357135", "0.6734704", "0.6730107", "0.67193705", "0.67156243", "0.67067945", "0.6703216", "0.6703037", "0.6702218", "0.6701306", "0.66933453", "0.66877943", "0.6684172", "0.6681233", "0.6676173", "0.6673341", "0.66704386", "0.66701096", "0.66639274", "0.6663299", "0.66622293", "0.6661614", "0.6641884", "0.6641559", "0.664034", "0.6640291", "0.6637535", "0.66373837", "0.66366535", "0.6636062", "0.66305226", "0.6625524", "0.66254056", "0.66234833", "0.661911", "0.6612897", "0.66123164", "0.6607085", "0.6600514", "0.65999603", "0.6599955", "0.65947336", "0.6593761", "0.6589927", "0.65897554", "0.6584221", "0.6583191", "0.6578816", "0.65784585", "0.6577843", "0.6577843", "0.6575723", "0.6572466", "0.6571815", "0.65717024", "0.65700185", "0.6568778", "0.65684104", "0.6567687", "0.656637", "0.6564959", "0.6564406", "0.6564091", "0.65608627", "0.65534914", "0.6550801", "0.6549914", "0.6548176", "0.6546016", "0.6545911", "0.65442175" ]
0.0
-1
/ Reverse the migrations.
public function down() { Schema::dropIfExists('fruits'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function down()\n {\n //add your migration here \n }", "public function down()\n {\n //add your migration here\n }", "public function down()\n {\n Schema::dropIfExists('reunion');\n }", "public function down()\n {\n //Schema::dropIfExists('c');//回滚时执行\n\n }", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->renameColumn('first_name', 'name');\n $table->dropIndex('users_first_name_index');\n $table->dropIndex('users_created_at_index');\n $table->dropIndex('users_updated_at_index');\n $table->dropColumn(\"last_name\");\n $table->dropColumn(\"username\");\n $table->dropColumn(\"provider\");\n $table->dropColumn(\"provider_id\");\n $table->dropColumn(\"api_token\");\n $table->dropColumn(\"code\");\n $table->dropColumn(\"remember_token\");\n $table->dropColumn(\"role_id\");\n $table->dropColumn(\"last_login\");\n $table->dropColumn(\"status\");\n $table->dropColumn(\"root\");\n $table->dropColumn('backend');\n $table->dropColumn(\"photo_id\");\n $table->dropColumn(\"lang\");\n $table->dropColumn(\"color\");\n $table->dropColumn(\"about\");\n $table->dropColumn(\"facebook\");\n $table->dropColumn(\"twitter\");\n $table->dropColumn(\"linked_in\");\n $table->dropColumn(\"google_plus\");\n });\n }", "public function down()\n {\n\tSchema::drop('quizzes');\n }", "public function down(){\n\t\tSchema::dropIfExists('cargo');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('appeals');\n\t}", "public function down()\n {\n \t\n \t$this->createTable('os', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n \t$this->insert('os', ['id' => 1, 'name' => 'Any']);\n \t$this->insert('os', ['id' => 2, 'name' => 'CentOS']);\n \t$this->insert('os', ['id' => 3, 'name' => 'RHEL']);\n \t$this->insert('os', ['id' => 4, 'name' => 'Fedora']);\n \t \n \t$this->createTable('os_bit', [\n \t\t\t'id' => Schema::TYPE_PK,\n \t\t\t'name' => Schema::TYPE_STRING . ' NOT NULL',\n \t\t\t]);\n\n return false;\n }", "public function down()\n {\n Schema::dropIfExists('personas');\n }", "public function down()\n {\n\tSchema::drop('activities');\n }", "public function down()\n\t{\n\t\tSchema::drop('education');\n\t}", "public function down()\n {\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )->save();\n\n $this->table('users')\n ->removeIndexByName('FK_users_roles')\n ->update();\n\n $this->table('users')\n ->addColumn('can_edit', 'boolean', [\n 'after' => 'enabled',\n 'default' => '0',\n 'length' => null,\n 'null' => false,\n ])\n ->removeColumn('role_id')\n ->update();\n\n $this->table('stundenplan')\n ->changeColumn('note', 'string', [\n 'default' => null,\n 'length' => 255,\n 'null' => true,\n ])\n ->removeColumn('loggedInNote')\n ->update();\n\n $this->table('roles')->drop()->save();\n }", "public function down()\n {\n Schema::dropIfExists('hobby');\n }", "public function down()\n\t{\n\t\techo $this->migration('down');\n\n\t\tci('o_role_model')->migration_remove($this->hash());\n\t\t\n\t\treturn true;\n\t}", "public function down()\n {\n Schema::table('users', function (Blueprint $table) {\n $table->dropForeign('users_id_turma_foreign');\n });\n\n Schema::table('contato', function (Blueprint $table) {\n $table->dropForeign('contato_id_usuario_foreign');\n });\n\n Schema::table('monitores', function (Blueprint $table) {\n $table->dropForeign('monitores_id_turma_foreign');\n $table->dropForeign('monitores_id_usuario_foreign');\n });\n\n Schema::table('galeria_portifolio', function (Blueprint $table) {\n $table->dropForeign('galeria_portifolio_id_portifolio_foreign');\n });\n\n Schema::table('portifolio_alunos', function (Blueprint $table) {\n $table->dropForeign('portifolio_alunos_id_portifolio_foreign');\n $table->dropForeign('portifolio_alunos_id_usuario_foreign');\n });\n\n Schema::table('cobranca', function (Blueprint $table) {\n $table->dropForeign('cobranca_id_aluno_foreign');\n });\n\n Schema::table('lista_de_presenca', function (Blueprint $table) {\n $table->dropForeign('lista_de_presenca_id_usuario_foreign');\n });\n\n Schema::table('forum_da_turma', function (Blueprint $table) {\n $table->dropForeign('forum_da_turma_id_usuario_foreign');\n });\n\n Schema::table('posts_do_site', function (Blueprint $table) {\n $table->dropForeign('posts_do_site_id_usuario_foreign');\n });\n\n Schema::table('posts_do_forum', function (Blueprint $table) {\n $table->dropForeign('posts_do_forum_id_topico_foreign');\n $table->dropForeign('posts_do_forum_id_usuario_foreign');\n });\n }", "public function down()\n {\n $this->table('accounting_entries')\n ->dropForeignKey(\n 'accounting_entry_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('associations_events')\n ->dropForeignKey(\n 'event_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('events')\n ->dropForeignKey(\n 'event_type_id'\n )->save();\n\n $this->table('members')\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics')\n ->dropForeignKey(\n 'statistics_type_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('statistics_event')\n ->dropForeignKey(\n 'statistics_id'\n )\n ->dropForeignKey(\n 'event_id'\n )->save();\n\n $this->table('users')\n ->dropForeignKey(\n 'role_id'\n )\n ->dropForeignKey(\n 'association_id'\n )->save();\n\n $this->table('accounting_entries')->drop()->save();\n $this->table('accounting_entry_type')->drop()->save();\n $this->table('associations')->drop()->save();\n $this->table('associations_events')->drop()->save();\n $this->table('event_type')->drop()->save();\n $this->table('events')->drop()->save();\n $this->table('members')->drop()->save();\n $this->table('roles')->drop()->save();\n $this->table('statistics')->drop()->save();\n $this->table('statistics_event')->drop()->save();\n $this->table('statistics_type')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n\t{\n\t\tSchema::drop('student');\n\t\t//\n\t}", "public function down()\n\t{\n\t\tSchema::drop('step9');\n\t\tSchema::drop('step9_deudas');\n\t\tSchema::drop('step9_hijos');\n\t\tSchema::drop('step9_semanales');\n\t\tSchema::drop('step9_mensuales');\n\t\tSchema::drop('step9_gastos');\n\t\tSchema::drop('step9_otros_salud');\n\t}", "public function down()\n {\n //the list must be reverse from the order of the create schema\n Schema::drop('question_lines');\n Schema::drop('questions');\n Schema::drop('categories');\n Schema::drop('credit_investigations');\n Schema::drop('products_line');\n Schema::drop('purchase_orders');\n Schema::drop('companies');\n Schema::drop('la_requirements');\n Schema::drop('requirements');\n Schema::drop('note_to_loan_applications');\n Schema::drop('loan_applications');\n Schema::drop('itineraries_line');\n Schema::drop('itineraries');\n Schema::drop('existing_loans');\n Schema::drop('child_dependents');\n Schema::drop('personal_references');\n Schema::drop('note_to_customer_profiles'); \n Schema::drop('customers');\n Schema::drop('branches');\n Schema::drop('password_resets');\n Schema::drop('users');\n Schema::drop('text_messaging_contacts'); \n Schema::drop('preset_text_messages'); \n }", "public function down()\n{\n\nSchema::drop('event_user');\nSchema::drop('events');\nSchema::drop('file');\nSchema::drop('file_ref');\nSchema::drop('groups');\nSchema::drop('project_user');\nSchema::drop('projects');\nSchema::drop('quicknote');\nSchema::drop('subtasks');\nSchema::drop('task_user');\nSchema::drop('tasks');\nSchema::drop('throttle');\nSchema::drop('timesheet');\nSchema::drop('todos');\nSchema::drop('user_profile');\nSchema::drop('users');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\nSchema::drop('users_groups');\n\n}", "public function down()\n\t{\n\t\tSchema::drop('refs');\n\t}", "public function down()\n {\n // This migration was removed, but fails when uninstalling plugin\n }", "public function down(): bool {\n\t\t// Remove & add logic to revert the migration here.\n\t\techo \"M230123030315BaseTables cannot be rolled back.\\n\";\n\t\treturn false;\n\t}", "public function down()\n\t{\n\t\tSchema::table('tests', function($table) {\n\t\t\t// first drop new constraint\n\t\t\t$table->drop_foreign('tests_user_id_foreign');\n\t\t\t// then create new one without proper cascade behavior\n\t\t\t$table->foreign('user_id')->references('id')->on('users');\n\t\t});\n\n\t\tSchema::table('testlogs', function($table) {\n\t\t\t// first drop new constraint\n\t\t\t$table->drop_foreign('testlogs_test_id_foreign');\n\t\t\t// then create new one without proper cascade behavior\n\t\t\t$table->foreign('test_id')->references('id')->on('tests');\n\t\t});\n\t}", "public function down()\n {\n $this->table('articles')->drop()->save();\n $this->table('categories')->drop()->save();\n $this->table('football_ragistrations')->drop()->save();\n $this->table('friends')->drop()->save();\n $this->table('menus')->drop()->save();\n $this->table('picnic_ragistrations')->drop()->save();\n $this->table('products')->drop()->save();\n $this->table('profiles')->drop()->save();\n $this->table('skills')->drop()->save();\n $this->table('spouses')->drop()->save();\n $this->table('students')->drop()->save();\n $this->table('submenus')->drop()->save();\n $this->table('users')->drop()->save();\n }", "public function down()\n {\n Schema::dropIfExists('journeys');\n }", "public function down()\n {\n $this->dropForeignKey(\n 'fk-users-created-by',\n 'users'\n );\n\n // drops foreign key for table `user`\n $this->dropForeignKey(\n 'fk-users-modified-by',\n 'users'\n );\n\n\n // drops index for column `author_id`\n $this->dropIndex(\n 'idx-users-username',\n 'users'\n );\n\n }", "public function down()\n\t{\n\t\tSchema::table('officers', function($t){\n\t\t\t$t->drop_column('role');\n\t\t});\n\t}", "public function down()\n\t{\n Schema::drop('users');\n }", "public function down()\n\t{\n\t\tSchema::drop('users');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('users');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('l_biblioteca_modulos');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n<<<<<<< HEAD\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCF082E755');\n $this->addSql('ALTER TABLE affaire DROP FOREIGN KEY FK_9C3F18EFED813170');\n=======\n $this->addSql('ALTER TABLE liste_affaire_affaire DROP FOREIGN KEY FK_CA81ADF3F082E755');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152EBF396750');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E65450D2529');\n $this->addSql('ALTER TABLE enfant_sejour DROP FOREIGN KEY FK_159E7E6584CF0CF');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2463CD7C3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA25D493FF4');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA2FF631228');\n $this->addSql('ALTER TABLE affaire_liste_affaire DROP FOREIGN KEY FK_80DBABFCE2687AC3');\n $this->addSql('ALTER TABLE sejour DROP FOREIGN KEY FK_96F52028E2687AC3');\n $this->addSql('ALTER TABLE enfant DROP FOREIGN KEY FK_34B70CA246135043');\n $this->addSql('ALTER TABLE correspondant_administratif DROP FOREIGN KEY FK_E1E7152E46135043');\n $this->addSql('DROP TABLE affaire');\n<<<<<<< HEAD\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n<<<<<<< HEAD:src/Migrations/Version20200418121015.php\n $this->addSql('DROP TABLE affaire_liste_affaire');\n $this->addSql('DROP TABLE type_affaire');\n=======\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE responsable_legal');\n>>>>>>> e1e13eb645b79ada7517f9d2be860dc1655c42db:src/Migrations/Version20200318150734.php\n>>>>>>> 0c1c04bb7c2bbee076bc5fdb1e2456d1af817866\n $this->addSql('DROP TABLE enfant');\n $this->addSql('DROP TABLE enfant_sejour');\n $this->addSql('DROP TABLE sejour');\n $this->addSql('DROP TABLE centre');\n $this->addSql('DROP TABLE correspondant_administratif');\n $this->addSql('DROP TABLE etablissement');\n $this->addSql('DROP TABLE liste_affaire');\n $this->addSql('DROP TABLE responsable_legal');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('l_wardrobe_table');\n\t}", "public function down()\n\t{\n $this->dropColumn('producto','fecha');\n\n //add column fecha in producto\n $this->addColumn('calculo','fecha','date');\n\t}", "public function down(){\n $this->dropTable('users');\n }", "public function down()\n\t{\n\t\tSchema::dropIfExists('ProjectInspection');\n\t}", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('users');\t\t\t\n\t}", "public function down()\n {\n $this->dropForeignKey(\n 'fk-video-blog_id',\n 'video'\n );\n\n\n echo \"m160820_150846_video_create reverted.\\n\";\n\n }", "public function down()\n {\n Schema::dropIfExists('order_tb');\n }", "public function down()\n\t{\n\t\t// Remove data from committee_members\n\t\tDB::table('committee_members')->where('id', '<', 3)->delete();\t\n\t}", "public function down()\n {\n $this->dbforge->drop_column('user', 'created_at');\n }", "public function down()\n\t{\n\t\tSchema::drop('flows_steps');\n\t}", "public function down()\n {\n $this->output->writeln('Down migration is not available.');\n }", "public function down()\n\t{\n\t\tSchema::drop('entries');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('movies');\n\t}", "public function down()\n\t{\n\t\tSchema::create('jobs',function($table){$table->increments('id');});\n\t\tSchema::create('job_location',function($table){$table->increments('id');});\n\t\tSchema::create('job_skill',function($table){$table->increments('id');});\n\t\tSchema::create('locations',function($table){$table->increments('id');});\n\t\tSchema::create('location_program',function($table){$table->increments('id');});\n\t\tSchema::create('location_scholarship',function($table){$table->increments('id');});\n\t\tSchema::create('positions',function($table){$table->increments('id');});\n\t\tSchema::create('programs',function($table){$table->increments('id');});\n\t\tSchema::create('program_subject',function($table){$table->increments('id');});\n\t\tSchema::create('scholarships',function($table){$table->increments('id');});\n\t\tSchema::create('scholarship_subject',function($table){$table->increments('id');});\n\t\tSchema::create('skills',function($table){$table->increments('id');});\n\t\tSchema::create('subjects',function($table){$table->increments('id');});\n\t}", "public function down()\n\t{\n\t\t//\n\t\tSchema::drop('options');\n\t}", "public static function down()\n {\n Schema::dropIfExists(static::getTableName());\n }", "public function down() {\n $this->dbforge->drop_column('timesheets_items', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_items', 'reason_desc', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'orgID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'brandID', TRUE);\n $this->dbforge->drop_column('timesheets_expenses', 'reason_desc', TRUE);\n\n // change reason to note\n $fields = array(\n 'reason' => array(\n 'name' => 'note',\n 'type' => \"VARCHAR\",\n 'constraint' => 200,\n 'null' => TRUE\n )\n );\n $this->dbforge->modify_column('timesheets_items', $fields);\n $this->dbforge->modify_column('timesheets_expenses', $fields);\n }", "public function down()\n {\n Schema::dropIfExists('records');\n }", "public function down()\n\t{\n\t\t//\n Schema::drop('satellites');\n\t}", "public function down()\n {\n $this->dbforge->drop_table('lecturer', true);\n }", "public function down()\n {\n Schema::dropIfExists('cmd_daarticles');\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE `equipment_reservations` DROP FOREIGN KEY FK_A52655A6517FE9FE');\n $this->addSql('ALTER TABLE `tour_equipments` DROP FOREIGN KEY FK_89B033DB517FE9FE');\n $this->addSql('ALTER TABLE `tour_equipments` DROP FOREIGN KEY FK_89B033DB15ED8D43');\n $this->addSql('ALTER TABLE `tour_reservations` DROP FOREIGN KEY FK_240676115ED8D43');\n $this->addSql('ALTER TABLE `tours` DROP FOREIGN KEY FK_2F0AC70E34ECB4E6');\n $this->addSql('ALTER TABLE `route_photo_albums` DROP FOREIGN KEY FK_CBD3709534ECB4E6');\n $this->addSql('ALTER TABLE `route_points` DROP FOREIGN KEY FK_16497FF434ECB4E6');\n $this->addSql('ALTER TABLE `routes` DROP FOREIGN KEY FK_32D5C2B3C54C8C93');\n $this->addSql('ALTER TABLE `equipment_reservations` DROP FOREIGN KEY FK_A52655A6727836C6');\n $this->addSql('ALTER TABLE `tours` DROP FOREIGN KEY FK_2F0AC70E8C4FC193');\n $this->addSql('ALTER TABLE `tour_reservations` DROP FOREIGN KEY FK_2406761A76ED395');\n $this->addSql('DROP TABLE `equipments`');\n $this->addSql('DROP TABLE `equipment_reservations`');\n $this->addSql('DROP TABLE `tours`');\n $this->addSql('DROP TABLE `tour_equipments`');\n $this->addSql('DROP TABLE `routes`');\n $this->addSql('DROP TABLE `route_photo_albums`');\n $this->addSql('DROP TABLE `route_points`');\n $this->addSql('DROP TABLE `route_types`');\n $this->addSql('DROP TABLE `tour_reservations`');\n $this->addSql('DROP TABLE `users`');\n }", "public function down()\n {\n $this->table('contents')->drop()->save();\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE blog_tag DROP FOREIGN KEY FK_6EC3989DAE07E97');\n $this->addSql('ALTER TABLE blog_sources DROP FOREIGN KEY FK_3EABD871DAE07E97');\n $this->addSql('ALTER TABLE collection_point_category DROP FOREIGN KEY FK_9F29BD6812469DE2');\n $this->addSql('ALTER TABLE objet DROP FOREIGN KEY FK_46CD4C38E3D2B46D');\n $this->addSql('ALTER TABLE collection_point_material DROP FOREIGN KEY FK_E5DBD13C31A80092');\n $this->addSql('ALTER TABLE collection_point_objet DROP FOREIGN KEY FK_7952502A31A80092');\n $this->addSql('ALTER TABLE collection_point_category DROP FOREIGN KEY FK_9F29BD6831A80092');\n $this->addSql('ALTER TABLE category DROP FOREIGN KEY FK_64C19C1A9B99F90');\n $this->addSql('ALTER TABLE collection_point DROP FOREIGN KEY FK_F05D4B77A9B99F90');\n $this->addSql('ALTER TABLE material DROP FOREIGN KEY FK_7CBE7595A9B99F90');\n $this->addSql('ALTER TABLE collection_point_material DROP FOREIGN KEY FK_E5DBD13CE308AC6F');\n $this->addSql('ALTER TABLE objet DROP FOREIGN KEY FK_46CD4C3829A33219');\n $this->addSql('ALTER TABLE collection_point_objet DROP FOREIGN KEY FK_7952502AF520CF5A');\n $this->addSql('ALTER TABLE blog_sources DROP FOREIGN KEY FK_3EABD871DD51D0F7');\n $this->addSql('ALTER TABLE blog_tag DROP FOREIGN KEY FK_6EC3989BAD26311');\n $this->addSql('DROP TABLE blog');\n $this->addSql('DROP TABLE blog_tag');\n $this->addSql('DROP TABLE blog_sources');\n $this->addSql('DROP TABLE category');\n $this->addSql('DROP TABLE collection_point');\n $this->addSql('DROP TABLE collection_point_material');\n $this->addSql('DROP TABLE collection_point_objet');\n $this->addSql('DROP TABLE collection_point_category');\n $this->addSql('DROP TABLE collection_point_type');\n $this->addSql('DROP TABLE material');\n $this->addSql('DROP TABLE objet');\n $this->addSql('DROP TABLE page');\n $this->addSql('DROP TABLE sources');\n $this->addSql('DROP TABLE tag');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n {\n Schema::dropIfExists('numbers');\n }", "public function down()\n{\nSchema::drop('statustype');\nSchema::drop('area');\nSchema::drop('region');\nSchema::drop('territory');\nSchema::drop('trackedevent');\nSchema::drop('zip_territory');\nSchema::drop('messagetype');\nSchema::drop('optintype');\nSchema::drop('representative');\nSchema::drop('pediatrician');\nSchema::drop('application_messagestatus');\nSchema::drop('application_optin');\nSchema::drop('application_trackedevent');\nSchema::drop('application');\n}", "public function down() {\n Schema::create('unit_office_secondaries');\n }", "public function down()\n {\n Schema::drop('challenge_user');\n }", "public function down()\n\t{\n\t\tSchema::drop('themes');\n\t}", "public function down()\n\t{\nDB::query(\n\"drop table haal;\");\nDB::query(\n\"drop table kandidaat;\");\nDB::query(\n\"drop table haaletaja;\");\nDB::query(\n\"drop table partei;\");\nDB::query(\n\"drop table valimisringkond;\");\n\t}", "public function down()\n\t{\n\t\t//Schema::drop('purchase_orders');\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE composant_type_tab DROP FOREIGN KEY FK_C3DBCCDB7F3310E7');\n $this->addSql('ALTER TABLE liste_compo_composant DROP FOREIGN KEY FK_7F1FCF467F3310E7');\n $this->addSql('ALTER TABLE liste_compo DROP FOREIGN KEY FK_D63394375121283C');\n $this->addSql('ALTER TABLE composant DROP FOREIGN KEY FK_EC8486C9E85441D8');\n $this->addSql('ALTER TABLE liste_compo_composant DROP FOREIGN KEY FK_7F1FCF46ED9818FB');\n $this->addSql('ALTER TABLE liste_compo DROP FOREIGN KEY FK_D6339437A0905086');\n $this->addSql('ALTER TABLE user DROP FOREIGN KEY FK_8D93D649A0905086');\n $this->addSql('ALTER TABLE composant DROP FOREIGN KEY FK_EC8486C9B062D5BC');\n $this->addSql('ALTER TABLE composant_type_tab DROP FOREIGN KEY FK_C3DBCCDBAEDBF81B');\n $this->addSql('ALTER TABLE liste_compo DROP FOREIGN KEY FK_D6339437AEDBF81B');\n $this->addSql('ALTER TABLE tableau DROP FOREIGN KEY FK_C6744DB1AEDBF81B');\n $this->addSql('ALTER TABLE composant DROP FOREIGN KEY FK_EC8486C97E5A734A');\n $this->addSql('DROP TABLE composant');\n $this->addSql('DROP TABLE composant_type_tab');\n $this->addSql('DROP TABLE droit_accee');\n $this->addSql('DROP TABLE liste');\n $this->addSql('DROP TABLE liste_compo');\n $this->addSql('DROP TABLE liste_compo_composant');\n $this->addSql('DROP TABLE poste');\n $this->addSql('DROP TABLE tableat');\n $this->addSql('DROP TABLE tableau');\n $this->addSql('DROP TABLE type_tab');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\tSchema::drop('pages');\n\t}", "public function down()\n\t{\n//\t\t$this->dbforge->drop_table('blog');\n\n//\t\t// Dropping a Column From a Table\n\t\t$this->dbforge->drop_column('categories', 'icon');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('products');\n\t}", "public function down()\n\t{\n\t\tSchema::drop('applications');\n\t}", "public function down()\n {\n Schema::dropIfExists('meetings');\n }", "public function down()\n\t{\n\t\t// Drop Table\n\t\tSchema::drop('activities_types');\n\t}", "public function down()\n\t{\n\t\t//Schema::drop('purchase_order_details');\n\t}", "public function down()\n {\n Schema::dropIfExists('data');\n }", "public function down(): void\n {\n $this->table('services')\n ->dropForeignKey(\n ['currency_id','billing_period_id']\n )->save();\n $this->execute('DELETE FROM currencies');\n $this->execute('DELETE FROM billing_periods');\n $this->table('services')->drop()->save();\n $this->table('currencies')->drop()->save();\n $this->table('billing_periods')->drop()->save();\n }", "public function down()\r\n\t{\r\n\t\t//\r\n\t\t\\Laravel\\Database\\Schema::drop('products');\r\n\t}", "public function down() {\n if ($this->db->field_exists('addon_timesheets', 'accounts')) {\n $this->dbforge->drop_column('accounts', 'addon_timesheets');\n }\n\n // remove timesheets items table, if exists\n $this->dbforge->drop_table('timesheets_items', TRUE);\n\n // remove timesheets table, if exists\n $this->dbforge->drop_table('timesheets', TRUE);\n }", "public function down()\n\t{\n\t\tSchema::table('precios_aterrizajes_despegues', function(Blueprint $table)\n\t\t{\n\t\t\t//\n\t\t});\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE to_do_lists DROP FOREIGN KEY FK_B2F8011012469DE2');\n $this->addSql('ALTER TABLE list_elements DROP FOREIGN KEY FK_3A27343D6BF700BD');\n $this->addSql('ALTER TABLE to_do_lists DROP FOREIGN KEY FK_B2F801106BF700BD');\n $this->addSql('ALTER TABLE to_do_list_list_tag DROP FOREIGN KEY FK_3FC5A0862302A13F');\n $this->addSql('ALTER TABLE note_note_tag DROP FOREIGN KEY FK_63214BFD26ED0855');\n $this->addSql('ALTER TABLE notes DROP FOREIGN KEY FK_11BA68C12469DE2');\n $this->addSql('ALTER TABLE note_note_tag DROP FOREIGN KEY FK_63214BFDA20034C5');\n $this->addSql('ALTER TABLE list_comments DROP FOREIGN KEY FK_21F3A54AB3AB48EB');\n $this->addSql('ALTER TABLE list_elements DROP FOREIGN KEY FK_3A27343DB3AB48EB');\n $this->addSql('ALTER TABLE to_do_list_list_tag DROP FOREIGN KEY FK_3FC5A086B3AB48EB');\n $this->addSql('ALTER TABLE notes DROP FOREIGN KEY FK_11BA68CF675F31B');\n $this->addSql('ALTER TABLE to_do_lists DROP FOREIGN KEY FK_B2F80110F675F31B');\n $this->addSql('DROP TABLE list_categories');\n $this->addSql('DROP TABLE list_comments');\n $this->addSql('DROP TABLE list_elements');\n $this->addSql('DROP TABLE list_element_status');\n $this->addSql('DROP TABLE list_status');\n $this->addSql('DROP TABLE list_tags');\n $this->addSql('DROP TABLE notes');\n $this->addSql('DROP TABLE note_note_tag');\n $this->addSql('DROP TABLE note_categories');\n $this->addSql('DROP TABLE note_tags');\n $this->addSql('DROP TABLE to_do_lists');\n $this->addSql('DROP TABLE to_do_list_list_tag');\n $this->addSql('DROP TABLE users');\n }", "public function down()\n\t{\n\t\tSchema::table('dependencies', function($table)\n\t\t{\n\t\t\t$table->drop();\n\t\t});\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE `like` DROP FOREIGN KEY FK_AC6340B3315B405');\n $this->addSql('ALTER TABLE view DROP FOREIGN KEY FK_FEFDAB8E315B405');\n $this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526C315B405');\n $this->addSql('ALTER TABLE support DROP FOREIGN KEY FK_8004EBA5F639F774');\n $this->addSql('ALTER TABLE campaign_user DROP FOREIGN KEY FK_8C74EDABF639F774');\n $this->addSql('ALTER TABLE article_tag DROP FOREIGN KEY FK_919694F9BAD26311');\n $this->addSql('ALTER TABLE campaign_user DROP FOREIGN KEY FK_8C74EDABA76ED395');\n $this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3A76ED395');\n $this->addSql('ALTER TABLE article_user DROP FOREIGN KEY FK_3DD15148A76ED395');\n $this->addSql('ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3D60322AC');\n $this->addSql('ALTER TABLE commentary DROP FOREIGN KEY FK_1CAC12CA7294869C');\n $this->addSql('ALTER TABLE article_tag DROP FOREIGN KEY FK_919694F97294869C');\n $this->addSql('ALTER TABLE article_user DROP FOREIGN KEY FK_3DD151487294869C');\n $this->addSql('DROP TABLE support');\n $this->addSql('DROP TABLE campaign');\n $this->addSql('DROP TABLE campaign_user');\n $this->addSql('DROP TABLE tag');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE user_role');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE `like`');\n $this->addSql('DROP TABLE view');\n $this->addSql('DROP TABLE comment');\n $this->addSql('DROP TABLE commentary');\n $this->addSql('DROP TABLE article');\n $this->addSql('DROP TABLE article_tag');\n $this->addSql('DROP TABLE article_user');\n }", "protected function tearDown(): void {\n $migration = include __DIR__.'/../database/migrations/create_all_visitors_tables.php.stub';\n $migration->down();\n\n $migrationTest = include __DIR__.'/Support/migrations/2023_01_12_000000_create_test_models_table.php';\n $migrationTest->down();\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE payment DROP FOREIGN KEY FK_6D28840D53C674EE');\n $this->addSql('ALTER TABLE media DROP FOREIGN KEY FK_6A2CA10C4B89032C');\n $this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8D3B91B7B5');\n $this->addSql('ALTER TABLE post_vote DROP FOREIGN KEY FK_9345E26F4B89032C');\n $this->addSql('ALTER TABLE role_user DROP FOREIGN KEY FK_332CA4DDD60322AC');\n $this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8DE2904019');\n $this->addSql('ALTER TABLE media DROP FOREIGN KEY FK_6A2CA10CA76ED395');\n $this->addSql('ALTER TABLE payment DROP FOREIGN KEY FK_6D28840DA76ED395');\n $this->addSql('ALTER TABLE post DROP FOREIGN KEY FK_5A8A6C8DF675F31B');\n $this->addSql('ALTER TABLE post_vote DROP FOREIGN KEY FK_9345E26FA76ED395');\n $this->addSql('ALTER TABLE role_user DROP FOREIGN KEY FK_332CA4DDA76ED395');\n $this->addSql('DROP TABLE media');\n $this->addSql('DROP TABLE offers');\n $this->addSql('DROP TABLE payment');\n $this->addSql('DROP TABLE post');\n $this->addSql('DROP TABLE post_vote');\n $this->addSql('DROP TABLE role');\n $this->addSql('DROP TABLE role_user');\n $this->addSql('DROP TABLE thread');\n $this->addSql('DROP TABLE user');\n }", "public function down()\n\t{\n\t\t//\n\t\tDB::query('TRUNCATE TABLE app_user_apps_publishes CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_fbapps CASCADE');\n\t\tDB::query('TRUNCATE TABLE app_apps_applications CASCADE');\n\t}", "public function down()\n {\n $this->dropForeignKey(\n 'fk-views-news_id',\n 'views'\n \n );\n\n // drops index for column `author_id`\n $this->dropIndex(\n 'idx-views-news_id',\n 'views'\n );\n }", "public function down()\n {\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=0');\n\n $this->executeSQL('DROP TABLE link');\n $this->executeSQL('DROP TABLE link_category');\n\n $this->executeSQL('SET FOREIGN_KEY_CHECKS=1');\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE subscriber DROP FOREIGN KEY FK_AD005B6944F5D008');\n $this->addSql('ALTER TABLE car DROP FOREIGN KEY FK_773DE69D44F5D008');\n $this->addSql('ALTER TABLE model DROP FOREIGN KEY FK_D79572D944F5D008');\n $this->addSql('ALTER TABLE car DROP FOREIGN KEY FK_773DE69DA76ED395');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDE67B3B43D');\n $this->addSql('ALTER TABLE renting DROP FOREIGN KEY FK_13533C0FC3C6F69F');\n $this->addSql('ALTER TABLE comment DROP FOREIGN KEY FK_9474526CC3C6F69F');\n $this->addSql('ALTER TABLE image DROP FOREIGN KEY FK_C53D045FC3C6F69F');\n $this->addSql('ALTER TABLE booking DROP FOREIGN KEY FK_E00CEDDEC3C6F69F');\n $this->addSql('ALTER TABLE subscriber DROP FOREIGN KEY FK_AD005B698BAC62AF');\n $this->addSql('ALTER TABLE car DROP FOREIGN KEY FK_773DE69D8BAC62AF');\n $this->addSql('ALTER TABLE subscriber DROP FOREIGN KEY FK_AD005B697975B7E7');\n $this->addSql('ALTER TABLE car DROP FOREIGN KEY FK_773DE69D7975B7E7');\n $this->addSql('DROP TABLE brand');\n $this->addSql('DROP TABLE subscriber');\n $this->addSql('DROP TABLE renting');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE car');\n $this->addSql('DROP TABLE city');\n $this->addSql('DROP TABLE comment');\n $this->addSql('DROP TABLE image');\n $this->addSql('DROP TABLE booking');\n $this->addSql('DROP TABLE model');\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE gallery DROP FOREIGN KEY FK_472B783A3B6CA980');\n $this->addSql('ALTER TABLE transport DROP FOREIGN KEY FK_66AB212EA4A739AF');\n $this->addSql('ALTER TABLE vcar DROP FOREIGN KEY FK_E76C1FD33B6CA980');\n $this->addSql('ALTER TABLE map DROP FOREIGN KEY FK_93ADAABBA4A739AF');\n $this->addSql('ALTER TABLE transport DROP FOREIGN KEY FK_66AB212E2F2B2F8F');\n $this->addSql('ALTER TABLE ameublement DROP FOREIGN KEY FK_350B9302A4A739AF');\n $this->addSql('ALTER TABLE couchage DROP FOREIGN KEY FK_6326C39EA4A739AF');\n $this->addSql('ALTER TABLE vcar DROP FOREIGN KEY FK_E76C1FD32F2B2F8F');\n $this->addSql('ALTER TABLE equipement DROP FOREIGN KEY FK_B8B4C6F3A4A739AF');\n $this->addSql('ALTER TABLE cuisine DROP FOREIGN KEY FK_10D52C6BA4A739AF');\n $this->addSql('ALTER TABLE map DROP FOREIGN KEY FK_93ADAABB2F2B2F8F');\n $this->addSql('ALTER TABLE transport DROP FOREIGN KEY FK_66AB212EB52753FC');\n $this->addSql('ALTER TABLE vcar DROP FOREIGN KEY FK_E76C1FD3B52753FC');\n $this->addSql('ALTER TABLE map DROP FOREIGN KEY FK_93ADAABBB52753FC');\n $this->addSql('DROP TABLE gallery');\n $this->addSql('DROP TABLE to_buy');\n $this->addSql('DROP TABLE localisation');\n $this->addSql('DROP TABLE front');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE transport');\n $this->addSql('DROP TABLE ameublement');\n $this->addSql('DROP TABLE couchage');\n $this->addSql('DROP TABLE for_rent_m');\n $this->addSql('DROP TABLE for_rent');\n $this->addSql('DROP TABLE vcar');\n $this->addSql('DROP TABLE equipement');\n $this->addSql('DROP TABLE newsletter');\n $this->addSql('DROP TABLE cuisine');\n $this->addSql('DROP TABLE map');\n $this->addSql('DROP TABLE contact');\n }", "public static function down() {\n\t\tSchema::dropTable(\"match\");\n\t}", "public function down()\r\n {\r\n $this->dbforge->drop_table('users');\r\n }", "public function down(Schema $schema)\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE orders DROP FOREIGN KEY FK_E52FFDEE4402854A');\n $this->addSql('ALTER TABLE cells DROP FOREIGN KEY FK_55C1CBD84402854A');\n $this->addSql('ALTER TABLE indicators DROP FOREIGN KEY FK_49B719A0F92F3E70');\n $this->addSql('ALTER TABLE user_country DROP FOREIGN KEY FK_B7ED76CF92F3E70');\n $this->addSql('ALTER TABLE cells DROP FOREIGN KEY FK_55C1CBD8F92F3E70');\n $this->addSql('ALTER TABLE user_country DROP FOREIGN KEY FK_B7ED76CA76ED395');\n $this->addSql('ALTER TABLE indicators DROP FOREIGN KEY FK_49B719A04235D463');\n $this->addSql('ALTER TABLE orders DROP FOREIGN KEY FK_E52FFDEE4235D463');\n $this->addSql('ALTER TABLE cells DROP FOREIGN KEY FK_55C1CBD84235D463');\n $this->addSql('ALTER TABLE indicators DROP FOREIGN KEY FK_49B719A0DB296AAD');\n $this->addSql('ALTER TABLE cells DROP FOREIGN KEY FK_55C1CBD8DB296AAD');\n $this->addSql('ALTER TABLE cell_errors DROP FOREIGN KEY FK_F0622245CB39D93A');\n $this->addSql('ALTER TABLE countries DROP FOREIGN KEY FK_5D66EBAD98260155');\n $this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9FE54D947');\n $this->addSql('DROP TABLE indicators');\n $this->addSql('DROP TABLE countries');\n $this->addSql('DROP TABLE users');\n $this->addSql('DROP TABLE user_country');\n $this->addSql('DROP TABLE orders');\n $this->addSql('DROP TABLE technologies');\n $this->addSql('DROP TABLE segments');\n $this->addSql('DROP TABLE cells');\n $this->addSql('DROP TABLE regions');\n $this->addSql('DROP TABLE groups');\n $this->addSql('DROP TABLE cell_errors');\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE voyage DROP FOREIGN KEY FK_3F9D895512469DE2');\n $this->addSql('ALTER TABLE tag_voyage DROP FOREIGN KEY FK_D6DCC079BAD26311');\n $this->addSql('ALTER TABLE identity_user DROP FOREIGN KEY FK_39E1FCDA76ED395');\n $this->addSql('ALTER TABLE voyage DROP FOREIGN KEY FK_3F9D8955A76ED395');\n $this->addSql('ALTER TABLE commentaire DROP FOREIGN KEY FK_67F068BC68C9E5AF');\n $this->addSql('ALTER TABLE tag_voyage DROP FOREIGN KEY FK_D6DCC07968C9E5AF');\n $this->addSql('DROP TABLE category');\n $this->addSql('DROP TABLE commentaire');\n $this->addSql('DROP TABLE identity_user');\n $this->addSql('DROP TABLE tag');\n $this->addSql('DROP TABLE tag_voyage');\n $this->addSql('DROP TABLE app_user');\n $this->addSql('DROP TABLE voyage');\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE patient_informations DROP FOREIGN KEY FK_89C53BB7B0A76B7D');\n $this->addSql('ALTER TABLE current_disease DROP FOREIGN KEY FK_A536EF44DF7CB678');\n $this->addSql('ALTER TABLE current_treatments DROP FOREIGN KEY FK_95F3077FDF7CB678');\n $this->addSql('ALTER TABLE previous_medical_operation DROP FOREIGN KEY FK_ED67C1E6DF7CB678');\n $this->addSql('ALTER TABLE patient_informations DROP FOREIGN KEY FK_89C53BB7217F2928');\n $this->addSql('ALTER TABLE medical_files DROP FOREIGN KEY FK_33D31B09DE04DCEA');\n $this->addSql('ALTER TABLE patient_informations DROP FOREIGN KEY FK_89C53BB7AD5873E3');\n $this->addSql('ALTER TABLE tourisme_region DROP FOREIGN KEY FK_86EDC08ACDAE8261');\n $this->addSql('ALTER TABLE medical_files DROP FOREIGN KEY FK_33D31B098101B95A');\n $this->addSql('ALTER TABLE patient_informations DROP FOREIGN KEY FK_89C53BB75627D44C');\n $this->addSql('ALTER TABLE users DROP FOREIGN KEY FK_1483A5E9AA8FA4FB');\n $this->addSql('ALTER TABLE patient_informations DROP FOREIGN KEY FK_89C53BB79FA2126B');\n $this->addSql('DROP TABLE patient_informations');\n $this->addSql('DROP TABLE medical_files');\n $this->addSql('DROP TABLE users');\n $this->addSql('DROP TABLE alcohol_qte');\n $this->addSql('DROP TABLE current_disease');\n $this->addSql('DROP TABLE current_treatments');\n $this->addSql('DROP TABLE housing');\n $this->addSql('DROP TABLE medical_city');\n $this->addSql('DROP TABLE previous_medical_operation');\n $this->addSql('DROP TABLE smoking_qte');\n $this->addSql('DROP TABLE specialisation');\n $this->addSql('DROP TABLE tourisme_region');\n }", "public function down()\n {\n Schema::drop('posts_meta');\n }", "public function down()\n\t{\n\t\tSchema::drop('settings');\n\t}", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE cahier_texte DROP FOREIGN KEY FK_B554C618FB88E14F');\n $this->addSql('DROP INDEX IDX_B554C618FB88E14F ON cahier_texte');\n $this->addSql('ALTER TABLE cahier_texte DROP utilisateur_id');\n $this->addSql('ALTER TABLE classe DROP FOREIGN KEY FK_8F87BF96FB88E14F');\n $this->addSql('DROP INDEX IDX_8F87BF96FB88E14F ON classe');\n $this->addSql('ALTER TABLE classe DROP utilisateur_id');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9CFB88E14F');\n $this->addSql('ALTER TABLE cours DROP FOREIGN KEY FK_FDCA8C9C8F5EA509');\n $this->addSql('DROP INDEX IDX_FDCA8C9CFB88E14F ON cours');\n $this->addSql('DROP INDEX IDX_FDCA8C9C8F5EA509 ON cours');\n $this->addSql('ALTER TABLE cours DROP utilisateur_id, DROP classe_id');\n $this->addSql('ALTER TABLE note DROP FOREIGN KEY FK_CFBDFA14FB88E14F');\n $this->addSql('DROP INDEX IDX_CFBDFA14FB88E14F ON note');\n $this->addSql('ALTER TABLE note DROP utilisateur_id');\n $this->addSql('ALTER TABLE payement DROP FOREIGN KEY FK_B20A7885FB88E14F');\n $this->addSql('DROP INDEX IDX_B20A7885FB88E14F ON payement');\n $this->addSql('ALTER TABLE payement DROP utilisateur_id');\n $this->addSql('ALTER TABLE utilisateur DROP FOREIGN KEY FK_1D1C63B339B8E743');\n $this->addSql('DROP INDEX IDX_1D1C63B339B8E743 ON utilisateur');\n $this->addSql('ALTER TABLE utilisateur DROP administration_id');\n }", "public function down()\n {\n Schema::drop('warehouses');\n }", "public function down()\n {\n Schema::dropIfExists('series');\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE voyage DROP FOREIGN KEY FK_3F9D8955BC0ADC46');\n $this->addSql('ALTER TABLE destination DROP FOREIGN KEY FK_3EC63EAA7879EB34');\n $this->addSql('ALTER TABLE portfolio DROP FOREIGN KEY FK_A9ED1062E8FC5988');\n $this->addSql('DROP TABLE destination');\n $this->addSql('DROP TABLE pays');\n $this->addSql('DROP TABLE portfolio');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE voyage');\n }", "public function down(Schema $schema) : void\n {\n $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \\'mysql\\'.');\n\n $this->addSql('ALTER TABLE etape DROP FOREIGN KEY FK_285F75DD75D4A2B8');\n $this->addSql('ALTER TABLE commentaires DROP FOREIGN KEY FK_D9BEC0C475D4A2B8');\n $this->addSql('ALTER TABLE user_voyage DROP FOREIGN KEY FK_5ACF926868C9E5AF');\n $this->addSql('ALTER TABLE activite DROP FOREIGN KEY FK_B8755515CFDE1A29');\n $this->addSql('ALTER TABLE voyage DROP FOREIGN KEY FK_3F9D89559D86650F');\n $this->addSql('ALTER TABLE commentaires DROP FOREIGN KEY FK_D9BEC0C49D86650F');\n $this->addSql('ALTER TABLE user_user DROP FOREIGN KEY FK_F7129A803AD8644E');\n $this->addSql('ALTER TABLE user_user DROP FOREIGN KEY FK_F7129A80233D34C1');\n $this->addSql('ALTER TABLE user_voyage DROP FOREIGN KEY FK_5ACF9268A76ED395');\n $this->addSql('DROP TABLE voyage');\n $this->addSql('DROP TABLE etape');\n $this->addSql('DROP TABLE commentaires');\n $this->addSql('DROP TABLE user');\n $this->addSql('DROP TABLE user_user');\n $this->addSql('DROP TABLE user_voyage');\n $this->addSql('DROP TABLE activite');\n }" ]
[ "0.7547356", "0.74523526", "0.73072034", "0.7082641", "0.7067668", "0.7064703", "0.7047196", "0.69690806", "0.69575274", "0.6953028", "0.6943268", "0.6940584", "0.69317234", "0.6919529", "0.6882202", "0.68721837", "0.6862158", "0.6825824", "0.6824019", "0.68235826", "0.68144274", "0.6807594", "0.6806019", "0.6799238", "0.67982286", "0.6789592", "0.67876536", "0.67668855", "0.6761086", "0.67462724", "0.6744464", "0.6744464", "0.6741951", "0.67315125", "0.6724813", "0.6720424", "0.6718653", "0.67130303", "0.6705377", "0.6702364", "0.67011344", "0.6699888", "0.6680553", "0.6680006", "0.66693366", "0.66667736", "0.666598", "0.6653945", "0.66536325", "0.6651868", "0.6630644", "0.6618923", "0.6617545", "0.66131496", "0.6604452", "0.660283", "0.6602194", "0.65992165", "0.6598039", "0.6588019", "0.65876144", "0.65873927", "0.6584183", "0.65837425", "0.658072", "0.6577351", "0.6572651", "0.6569459", "0.65663195", "0.6566218", "0.6561624", "0.6560664", "0.6557738", "0.65567434", "0.6556505", "0.65393454", "0.65301955", "0.6518425", "0.65151745", "0.651489", "0.6514889", "0.6514795", "0.6501875", "0.6501165", "0.65011644", "0.6494176", "0.64935625", "0.6492748", "0.649272", "0.6491208", "0.6490781", "0.6488764", "0.64869136", "0.6477448", "0.6477404", "0.64697516", "0.64694446", "0.64665157", "0.64622766", "0.64610696" ]
0.6877479
15
By default it will use our APP_ENV
public function testResolveEnvironment() { $this->assertEquals('testing', EnvSecurity::resolveEnvironment()); EnvSecurity::resolveEnvironmentUsing(function() { return "heya"; }); $this->assertEquals('heya', EnvSecurity::resolveEnvironment()); EnvSecurity::setEnvironment("override"); $this->assertEquals('override', EnvSecurity::resolveEnvironment()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function initEnvironment() {\n\t\t$env = getenv('APP_ENV');\n\n\t\t$this->_env = ($env !== FALSE) ? $env : 'development';\n\t}", "function get_environment(): string {\n return getenv('APP_ENV') ?\n getenv('APP_ENV') : 'default';\n}", "public static function environment(){\n return \\Illuminate\\Foundation\\Application::environment();\n }", "public function environment()\n {\n return \\Config::get('app')['env'];\n }", "function getEnvironment(){ return $_ENV['CURRENT_ENVIRONMENT']; }", "public function env()\n {\n // TODO: Implement env() method.\n }", "public function get_env()\n {\n return $this->env;\n }", "public function init()\n {\n// echo APPLICATION_ENV;\n }", "public function getEnv() {\n\t\treturn APPLICATION_ENV;\n\t}", "public function getAppEnvironment()\n {\n return $this->appEnvironment;\n }", "public static function get()\n\t{\n\t\t// then return content of APPLICATION_ENV\n\t\t// else return \"development\"\n\t\treturn (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : \"development\");\n\t}", "protected function getEnvironmentSetUp($app)\n {\n\n }", "protected static function loadEnv()\n\t{\n\t\tif (! getenv('APP_ENV')) {\n\t\t\t// Load Dotenv if in a dev environment (no environment vars loaded)\n\t\t\t(new Dotenv(__DIR__ . '/../'))->load();\n\t\t}\n\t}", "public function add_app_env_to_context( array $context ) {\n\t\t$context['APP_ENV'] = getenv( 'APP_ENV' );\n\t\treturn $context;\n\t}", "public static function env()\n {\n return self::context()->env();\n }", "public function environment()\n {\n return $this->env;\n }", "function switchToDev(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_DEV; }", "public function environment()\n {\n return 'local';\n }", "public function __construct()\n {\n //.env に APP_ENV=local (ローカル環境) または APP_ENV=testing (テスト環境) と書いてある場合\n if ( app()->isLocal() || app()->runningUnitTests() ) { \n // テスト環境, ローカル環境用の記述\n //テスト的に認証なしでも機能を使用する\n }\n //.env に APP_ENV=production (本番環境) などと書いてあった場合\n else { \n // 本番環境用の記述\n $this->middleware('auth');\n }\n }", "public function __construct()\n {\n //.env に APP_ENV=local (ローカル環境) または APP_ENV=testing (テスト環境) と書いてある場合\n if ( app()->isLocal() || app()->runningUnitTests() ) { \n // テスト環境, ローカル環境用の記述\n //テスト的に認証なしでも機能を使用する\n }\n //.env に APP_ENV=production (本番環境) などと書いてあった場合\n else { \n // 本番環境用の記述\n $this->middleware('auth');\n }\n }", "public function __construct()\n {\n //.env に APP_ENV=local (ローカル環境) または APP_ENV=testing (テスト環境) と書いてある場合\n if ( app()->isLocal() || app()->runningUnitTests() ) { \n // テスト環境, ローカル環境用の記述\n //テスト的に認証なしでも機能を使用する\n }\n //.env に APP_ENV=production (本番環境) などと書いてあった場合\n else { \n // 本番環境用の記述\n $this->middleware('auth');\n }\n }", "protected function setupEnvironment()\n {\n Dotenv::create(project_root())->load();\n\n if (!in_array($_SERVER['APP_ENV'], [self::ENV_DEV, self::ENV_PRODUCTION, self::ENV_STAGING, self::ENV_TEST])) {\n throw new RuntimeException(\"Unrecognized application environment\");\n }\n\n $this->debug = (bool) (\n $_SERVER['APP_DEBUG']\n ?? $_SERVER['APP_ENV'] == self::ENV_DEV\n );\n }", "function setEnvironment($value){ $_ENV['CURRENT_ENVIRONMENT'] = $value; }", "public static function environmentFile(){\n return \\Illuminate\\Foundation\\Application::environmentFile();\n }", "function isDev(){ return $_ENV['CURRENT_ENVIRONMENT'] == ENVIRONMENT_DEV; }", "public function setEnvironment();", "private function set_environment() {\n $pedestal_env = 'live';\n if ( defined( 'WP_ENV' ) && 'development' == WP_ENV ) {\n $pedestal_env = 'dev';\n } elseif ( isset( $_ENV['PANTHEON_ENVIRONMENT'] ) ) {\n $pedestal_env = $_ENV['PANTHEON_ENVIRONMENT'];\n }\n if ( ! defined( 'PEDESTAL_ENV' ) ) {\n define( 'PEDESTAL_ENV', $pedestal_env );\n }\n }", "protected function verifyEnvironment()\n {\n $environment = null;\n if (strstr(__DIR__, '/media/sf_code/')) {\n $environment = ENVIRONMENT_DEV;\n } elseif (getenv('IS_TEST_ENVIRONMENT')) {\n $environment = ENVIRONMENT_TEST;\n } else {\n $environment = ENVIRONMENT_PRODUCTION;\n }\n\n define('ENVIRONMENT', $environment);\n }", "function env() {\n if (defined('WP_ENV')) {\n return WP_ENV;\n } else {\n define('WP_ENV', getenv('WP_ENV') ?? 'production');\n }\n return WP_ENV;\n}", "public function testGetAppEnvironmentAsLocal(): void\n {\n $this->var('APP_ENV', Env::LOCAL);\n $this->assertSame(Env::LOCAL, Env::getAppEnvironment());\n }", "protected function getEnvironmentSetUp($app)\n {\n //sqlite\n $app['config']->set('database.default', 'sqlite');\n $app['config']->set('database.connections.sqlite', [\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n 'prefix' => '',\n ]);\n \n //mysql\n \n // $app['config']->set('database.default','mysql');\n // $app['config']->set('database.connections.mysql', [\n // 'driver' => 'mysql',\n // 'host' => '127.0.0.1',\n // 'port' => '3306',\n // 'database' => 'area',\n // 'username' => 'root',\n // 'password' => 'root',\n // 'unix_socket' => env('DB_SOCKET', ''),\n // 'charset' => 'utf8mb4',\n // 'collation' => 'utf8mb4_unicode_ci',\n // 'prefix' => '',\n // 'prefix_indexes' => true,\n // 'strict' => true,\n // 'engine' => null,\n // ]);\n \n }", "function getEnvironment() {\n return Environment::env();\n}", "public function __construct()\n {\n $this->app_name = env('APP_NAME','sziveslatas.hu');\n }", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "public function getEnvironment();", "function is_dev()\n{\n return env('APP_ENV') === 'local' ? true : false;\n}", "public function getDefaultEnvironment();", "protected function applyEnvironmentContext(): void\n {\n if (! $context = ($_SERVER['APP_ENV'] ?? null)) {\n return;\n }\n\n $this->setEnvironmentFile(\n $this->environment, $context\n );\n }", "public function getEnvironment() {\n return $this->environment; \n }", "public function getEnv()\n {\n return self::$environment;\n }", "public function getEnv()\n {\n return $this->env;\n }", "public function getEnv()\n {\n return $this->env;\n }", "private function setupApplicationEnvironment(){\n\n // TODO: MAKE MORE EFFICENT WITH CACHING\n if($this->version == null)\n $this->version = env('PAYPAL_VERSION', 'dev-2.0-beta');\n\n if($this->endpoint == null)\n $this->endpoint = env('PAYPAL_ENDPOINT');\n \n if($this->username == null)\n $this->username = env('PAYPAL_USERNAME');\n\n if($this->password == null)\n $this->password = env('PAYPAL_PASSWORD');\n\n if($this->signature == null)\n $this->signature = env('PAYPAL_SIGNATURE');\n\n if($this->isDirect == null)\n $this->isDirect = env('PAYPAL_DIRECT', true);\n\n if($this->payment_method == null) \n $this->payment_method = ($this->isDirect) ? Objects::CREDIT_CARD : env('PAYMENT_METHOD');\n\n // Set our enviornment based on production or development\n $this->environment = (!$this->isDevelopment) ? new ProductionEnvironment() : new SandboxEnvironment();\n\n $this->client = new PayPalHttpClient($this->environment);\n\n }", "protected function getEnvironmentMode() {}", "function mapPlatformShEnvironment() : void\n{\n // If this env var is not set then we're not on a Platform.sh\n // environment or in the build hook, so don't try to do anything.\n if (!getenv('PLATFORM_APPLICATION')) {\n return;\n }\n\n // Set the application secret if it's not already set.\n if (!isset($_SERVER['APP_SECRET']) && getenv('PLATFORM_PROJECT_ENTROPY')) {\n $_SERVER['APP_SECRET'] = getenv('PLATFORM_PROJECT_ENTROPY');\n }\n\n // Default to production. You can override this value by setting\n // `env:APP_ENV` as a project variable, or by adding it to the\n // .platform.app.yaml variables block.\n $_SERVER['APP_ENV'] = $_SERVER['APP_ENV'] ?? (getenv('APP_ENV') ?: null) ?? 'prod';\n\n if (!isset($_SERVER['DATABASE_URL'])) {\n mapPlatformShDatabase();\n }\n}", "protected function getEnvironmentSetUp($app)\n {\n config(['sendinblue.apikey' => 'test_apikey']);\n config(['sendinblue.partnerkey' => 'test_partnerkey']);\n }", "public function environment()\n {\n $envConfig = $this->EnvironmentManager->getEnvContent();\n //Sets the default values of the .env file!\n $APP_ENV = 'local';\n $APP_DEBUG = 'true';\n $APP_KEY = '4958763498756837942368weufgsdgw3';\n $DB_HOST = 'localhost';\n $DB_DATABASE = 'database';\n $DB_USERNAME = 'Username';\n $DB_PASSWORD = 'Password';\n \n $CACHE_DRIVER = 'file';\n $SESSION_DRIVER = 'file';\n $QUEUE_DRIVER = 'sync';\n $MAIL_DRIVER = 'smtp';\n $MAIL_HOST = 'mailtrap.io';\n $MAIL_PORT= 2525;\n $MAIL_USERNAME = 'null';\n $MAIL_PASSWORD = 'null';\n $MAIL_ENCRYPTION= 'null';\n return view('vendor.installer.environment', \n [\n 'APP_ENV' => $APP_ENV,\n 'APP_DEBUG' => $APP_DEBUG,\n 'APP_KEY' => $APP_KEY,\n 'DB_HOST' => $DB_HOST,\n 'DB_DATABASE' => $DB_DATABASE,\n 'DB_USERNAME' => $DB_USERNAME,\n 'DB_PASSWORD' => $DB_PASSWORD,\n 'CACHE_DRIVER' => $CACHE_DRIVER,\n 'SESSION_DRIVER' => $SESSION_DRIVER,\n 'QUEUE_DRIVER' => $QUEUE_DRIVER,\n 'MAIL_DRIVER' => $MAIL_DRIVER,\n 'MAIL_HOST' => $MAIL_HOST,\n 'MAIL_PORT' => $MAIL_PORT,\n 'MAIL_USERNAME' => $MAIL_USERNAME,\n 'MAIL_PASSWORD' => $MAIL_PASSWORD,\n 'MAIL_ENCRYPTION' => $MAIL_ENCRYPTION,\n ]\n );\n }", "protected function getEnvironmentSetUp($app)\n {\n $app['config']->set('database.default', 'sqlite');\n $app['config']->set('database.connections.sqlite', [\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n 'prefix' => '',\n ]);\n }", "protected function getEnvironmentSetUp($app)\n {\n $app['config']->set('database.default', 'sqlite');\n $app['config']->set('database.connections.sqlite', [\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n 'prefix' => '',\n ]);\n }", "protected function get_environment()\n\t{\n\t\treturn $this->environment ?: PHPBB_ENVIRONMENT;\n\t}", "public static function setEnvironnement()\n\t{\n\t\tUz_Autoloader::init(array(static::$framework_namespace=>$framework_path, static::$application_namespace=>static::$application_path),static::$framework_namespace,array());\n\t\t//On construit la session\n\t\tUz_Service_HTTP_Session::build();\n\t\t//On recupere la requete dans cet objet\n\t\tUz_Service_HTTP_Request::build();\n\t\tUz_Controller_Dispatcher::init(static::$application_namespace);\n\t\tUz_Mapper_Generic::init(static::configureDb());\n\t\t\n\t}", "public function getEnvironment()\n {\n return $this->config['environment'];\n }", "protected function getEnvironmentSetUp($app)\n {\n $app['config']->set('database.default', 'sqlite');\n $app['config']->set('database.connections.sqlite', [\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n 'prefix' => '',\n ]);\n\n $app['config']->set('app.key', env('APP_KEY'));\n }", "function detectEnvironment($env = 'local') {\n\treturn (env('APP_ENV', 'production') == $env) ? true : false;\n}", "public function __construct()\n {\n $this->envPath = base_path('.env');\n $this->envExamplePath = base_path('.env.example');\n }", "protected function getEnvironmentSetUp($app)\n {\n $app['config']->set('app.debug', true);\n $app['config']->set('database.default', 'sqlite');\n $app['config']->set('database.connections.sqlite', [\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n 'prefix' => '',\n ]);\n }", "protected function getEnvironmentSetUp($app)\n {\n $app['config']->set('app.debug', true);\n $app['config']->set('database.default', 'sqlite');\n $app['config']->set('database.connections.sqlite', [\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n 'prefix' => '',\n ]);\n }", "public static function setEnv()\n {\n // We are on bluemix\n if (self::onBluemix()) {\n // Copy Env values\n self::copyEnv();\n\n // Set services credentials\n self::setServiceCredentials();\n }\n }", "function switchToSandbox(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_SANDBOX; }", "protected function getEnvironmentSetUp($app) {\r\n $config = $app['config']; \r\n\r\n $config->set('app.debug', 'true');\r\n $config->set('database.default', 'testbench');\r\n $config->set('database.connections.testbench', [\r\n 'driver' => 'mysql',\r\n 'host' => getenv('DB_HOST'),\r\n 'username' => getenv('DB_USER'),\r\n 'password' => getenv('DB_PASS'),\r\n 'database' => getenv('DB_DATABASE'),\r\n 'port' => env('DB_PORT', '3306'),\r\n 'charset' => 'utf8mb4',\r\n 'collation' => 'utf8mb4_unicode_ci',\r\n 'prefix' => '',\r\n 'strict' => env('DB_STRICT', false),\r\n 'engine' => null,\r\n ]);\r\n\r\n $this->pdo = $app['db']->connection()->getPdo();\r\n }", "public static function mode() {\n\t\treturn env('APP_MODE', 'development');\n\t}", "public static function environment() {\n return self::$environment;\n }", "public function testGetAppEnvironmentNotSet(): void\n {\n $this->var('APP_ENV', null);\n $this->assertSame(Env::PRODUCTION, Env::getAppEnvironment());\n }", "protected function setUp () : void {\n\n $_ENV['foo'] = \"bar\";\n $_SERVER['foo'] = \"baz\";\n\n $_ENV['bar'] = \"lorem\";\n $_SERVER['baz'] = \"ipsum\";\n\n // And quux isn't defined.\n }", "public function testGetAppEnvironmentAsProduction(): void\n {\n $this->var('APP_ENV', Env::PRODUCTION);\n $this->assertSame(Env::PRODUCTION, Env::getAppEnvironment());\n }", "public static function setEnvironment($prm_env)\n\t{\n global $application_is_published;\n \n switch ($prm_env) {\n case 'development':\n //Set environment for development;\n error_reporting(E_ALL);\n $application_is_published = false;\n break;\n\t\t\t\t\n case 'publish':\n //set environment for publish;\n error_reporting(0);\n $application_is_published = true;\n break;\n\n case 'default':\n //do not set;\n break;\n\t\t\t\t\n\n default:\n //Set environment for development;\n break;\n }\n\t}", "public function getEnvironment() { return $this->environment; }", "private function getEnvironmentMode() {\n return $this->config->get('api.mode') === 'live' ? 'prod' : 'dev';\n }", "function init_env() {\n $envs_filename = base_path().DIRECTORY_SEPARATOR.'.env';\n $envs = $envs_array = [];\n \n if ($ressources = fopen($envs_filename, 'r')) {\n while (!feof($ressources)) {\n $element = fgets($ressources);\n\n if (!empty(trim($element))) {\n $element_array = explode('=', $element);\n $envs_array[$element_array[0]] = $element_array[1];\n }\n\n $envs[] = $element;\n }\n\n fclose($ressources);\n }\n\n $_ENV = array_merge($envs_array, $_ENV);\n }", "protected function getEnvironmentSetUp($app)\n {\n $app['config']->set('services.pushmix.key', 'subscription_id');\n }", "protected function deriveEnvironment()\n {\n $confDir = $this->getAppConfigDir();\n\n if (file_exists($confDir . 'development.php')) {\n return 'development';\n } elseif (file_exists($confDir . 'testing.php')) {\n return 'testing';\n } elseif (file_exists($confDir . 'production.php')) {\n return 'production';\n } else {\n throw new \\RuntimeException(\n 'Environment Not Specified And Unable To Derive',\n 500\n );\n }\n }", "public function getEnvironment()\n {\n return $this->environment;\n }", "private static function loadEnvSettings()\n {\n require_once self::$envPath;\n return $env;\n }", "function confprod()\n{\n global $app, $appname, $appversion;\n $app->config([\n 'debug' => false,\n 'cookies.lifetime' => '1 day',\n 'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',\n\n ]);\n $app->getLog()->setEnabled(true);\n $app->getLog()->setLevel(\\Slim\\Log::WARN);\n $app->getLog()->info($appname . ' ' . $appversion . ': Running in production mode.');\n $app->getLog()->info('Running on PHP: ' . PHP_VERSION);\n error_reporting(E_ALL ^ (E_DEPRECATED | E_USER_DEPRECATED));\n}", "function switchToLive(){ $_ENV['CURRENT_ENVIRONMENT'] = ENVIRONMENT_LIVE; }", "protected function setupEnvironment($app)\n {\n if (env('USE_LIVE_API')) {\n $app['config']->set('zoom.client_key');\n $app['config']->set('zoom.client_secret');\n } else {\n }\n }", "private function loadEnvironment () : void {\n $env = new Dotenv(__DIR__);\n if (file_exists(__DIR__ . '/.env')) {\n $env->load();\n }\n $env->required('SERVERS_LOG_FILE');\n }", "function is_dev(){\n return ENVIRONMENT == 'development';\n}", "protected function getEnvironmentSetUp($app)\n {\n $app['config']->set('database.default', 'betterdelete');\n $app['config']->set('database.connections.betterdelete', [\n 'driver' => 'sqlite',\n 'database' => ':memory:',\n 'prefix' => '',\n ]);\n }", "protected function getEnvironmentSetUp($app)\n\t{\n\t\tView::addLocation(__DIR__.'/../src/Views');\n\n\t $app['config']->set('database.default', 'testbench');\n\n\t $app['config']->set('database.connections.testbench', [\n\t 'driver' => 'mysql',\n\t 'database' => 'testbench',\n\t 'host' => '127.0.0.1',\n\t 'port' => '3306',\n\t 'username' => '',\n\t 'password' => ''\n\t ]);\n\n\t $app['config']->set('coinpayments', [\n\t 'cp_merchant' => env('CP_API_KEY', ''),\n\t 'cp_ipn_secret' => env('CP_IPN_SECRET', ''),\n\t 'cp_public_key' => '',\n\t 'cp_private_key' => '',\n\t ]);\n\n\t $app['config']->set('mail', [\n\t 'driver' => 'smtp',\n\t 'host' => 'smtp.mailtrap.io',\n\t 'port' => '2525',\n\t 'username' => '',\n\t 'password' => ''\n\t ]);\n\n\t $app['config']->set('mail.from', [\n\t \t'address' => '',\n\t \t'name' => ''\n\t ]);\n\n\n\t}", "function confdev()\n{\n global $app, $appname, $appversion;\n $app->config([\n 'debug' => true,\n 'cookies.lifetime' => '5 minutes',\n 'cookies.secret_key' => 'b4924c3579e2850a6fad8597da7ad24bf43ab78e',\n\n ]);\n $app->getLog()->setEnabled(true);\n $app->getLog()->setLevel(\\Slim\\Log::DEBUG);\n $app->getLog()->info($appname . ' ' . $appversion . ': Running in development mode.');\n $app->getLog()->info('Running on PHP: ' . PHP_VERSION);\n}", "function initializer() {\n init_env();\n }", "public function getEnv():string\n {\n return $this->env;\n }", "protected function getEnvironmentSetUp($app)\n {\n parent::getEnvironmentSetUp($app);\n\n $app->config->set('database.redis.client', 'predis');\n }", "public function testGetAppEnvironmentAsTesting(): void\n {\n $this->var('APP_ENV', Env::TESTING);\n $this->assertSame(Env::TESTING, Env::getAppEnvironment());\n }", "public static function isDev(){\n if (isset($_GET['env']))\n return false;\n return (env('APP_ENV') == 'dev');\n }", "public function getEnvironment()\n {\n return $this->getConfig('environment');\n }", "public static function environmentPath(){\n return \\Illuminate\\Foundation\\Application::environmentPath();\n }", "function env($name)\n{\n return Env::get($name);\n}", "public static function setup()\n {\n try {\n $env = \\Dotenv\\Dotenv::create(__DIR__ . '/../../private/');\n $env->load();\n $env->required([\n 'ENVIRONMENT',\n ]);\n } catch (\\Exception $e) {\n echo $e;\n }\n }", "public static function getEnv()\n {\n //($s = yaml_parse_file(\"/var/www/app.env\")) || die(\"YAML file not found\");\n //var_dump($s);\n //$thing = file_get_contents(\"/var/www/app.env\");\n //$data = Spyc::YAMLLoad('../spyc-0.6.1/spyc.yaml');\n return yaml_parse_file(\"/var/www/app.env\");\n }", "public function getEnvironment()\n {\n return self::$_environment;\n }", "public function useDevelopmentMode();", "public function setUp()\n {\n putenv(\"{$this->name}={$this->value}\");\n \n return;\n }", "public function getEnvironment()\n {\n return $this->getConfigData('environment');\n }", "protected function getEnvironmentSetUp($app)\n {\n $app->useEnvironmentPath(__DIR__ . '/..');\n $app->bootstrapWith([LoadEnvironmentVariables::class]);\n parent::getEnvironmentSetUp($app);\n }", "public function getEnvironment() {\n\t\treturn $this->getKernel()->getEnvironment();\n\t}" ]
[ "0.791438", "0.77103543", "0.72682166", "0.7253278", "0.71557975", "0.70835245", "0.7077431", "0.70227665", "0.7013368", "0.6996586", "0.6993136", "0.6955319", "0.6909131", "0.6834243", "0.68088853", "0.67953044", "0.6791777", "0.6754335", "0.6726715", "0.6726715", "0.6726715", "0.67198986", "0.6714854", "0.6697105", "0.66661316", "0.66579264", "0.66481775", "0.6646749", "0.664042", "0.6633586", "0.66059226", "0.6593754", "0.657139", "0.65462536", "0.65462536", "0.65462536", "0.65462536", "0.65462536", "0.65462536", "0.6505525", "0.6500793", "0.65003544", "0.64933777", "0.6479537", "0.6473559", "0.6473559", "0.6473077", "0.6460304", "0.6441175", "0.6416666", "0.6415841", "0.64143735", "0.64112175", "0.640974", "0.6398426", "0.6397356", "0.638869", "0.6387753", "0.6385806", "0.6382943", "0.6382943", "0.6380751", "0.63634044", "0.6351637", "0.63433653", "0.63346463", "0.63314205", "0.63308215", "0.632364", "0.63153696", "0.6314559", "0.63105416", "0.629765", "0.62812024", "0.6254639", "0.62491244", "0.62444574", "0.6238486", "0.6224634", "0.6217164", "0.6212267", "0.62105095", "0.61929345", "0.6190473", "0.61891794", "0.617456", "0.61721116", "0.61708754", "0.61606205", "0.61508626", "0.61499006", "0.61490065", "0.6137408", "0.6132635", "0.6132095", "0.6127515", "0.6127427", "0.6110823", "0.6091759", "0.6074636", "0.6072697" ]
0.0
-1
By default it will be null
public function testResolveKey() { $this->assertNull(EnvSecurity::resolveKey()); EnvSecurity::resolveKeyUsing(function($environment) { return "alias/myapp-$environment"; }); $this->assertEquals("alias/myapp-testing", EnvSecurity::resolveKey()); $this->assertEquals("alias/myapp-newenv", EnvSecurity::setEnvironment('newenv')->resolveKey()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __return_null()\n {\n }", "public function __default()\n\t{\n\n\t}", "protected function __init__() { }", "public function __init(){}", "public function __construct() {\n\t\t// Intentionally left empty.\n\t}", "public function __construct()\n\t{\n\t\t// nothing to do\t\n\t}", "public function __construct()\n\t\t{\t\t\t\n\t\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "public function __construct() {\n\t\t\n\t}", "private function __() {\n }", "private function __construct()\t{}", "public function init(){\n\t\t\t\t}", "private function __construct()\r\n {\r\n }", "private function __construct()\r\n {\r\n }", "public function __construct() {\n \t\t \t\n\t\t}", "public function __construct() {\r\n\r\n\t\t}", "public function init()\n {\t\t\t\n }", "public function init()\n {\t\t\t\n }", "public function __construct()\r\n\t\t{\r\n\t\t}", "final private function __construct(){\r\r\n\t}", "public function init() {\t\t\n\n }", "public function __construct() {\r\n\t\t//\r\n\t}", "public function __construct()\n\t\t{\n\t\t\t//\n\t\t}", "private function __construct() {\r\n\t\r\n\t}", "public function __construct() {\r\n\r\n\t}", "public function __invoke()\n {\n return null;\n }", "public function __invoke()\n {\n return null;\n }", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct() {\n\t\t//\n\t}", "public function __construct()\n\t\t{\n\t\t\t\n\t\t}", "private function __construct() {\r\n\t\t\r\n\t}", "public function __construct(){\n\t\t\n\t}", "public function __construct(){\n\t\t\n\t}", "public function init()\n {\n \treturn;\n }", "public function init() {\n\t\t// use this method to initialize default values.\n\t}", "public function __construct()\n\t{}", "public function __construct()\n {\n\t;\n }", "function __construct (){\n\t\t}", "function __construct() {\n\t\t\t\n\t\t\t/* Do nothing here */\n\t\t\t\n\t\t}", "public function __construct() {\r\n\t}", "public function __construct() {\r\n\t}", "public function __construct () {\n\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct()\r\n\t{\r\n\t}", "public function __construct(){\n\t\t//\n\t}", "public function __construct(){\n\t\t//\n\t}", "public function __construct() { \n\t\t\n\n\t\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct()\n\t{\n\t\t//\n\t}", "public function __construct() {\n \n }", "public function __construct () {\n\t}", "protected function __construct () {}", "public function __construct() {\r\n\t\t\r\n\t}", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "private function __construct() {\n \n }", "public function set_to_default()\n\t{\n\t\t// SimpleDB requires a value for every attribue...\n\t\t$this->_name = NULL;\n\t\t$this->_contextid = NULL;\n\t\t$this->_userid = NULL;\n $this->_deleted = 0;\n\t\t$this->_lastmodified = 0;\t\n\t}", "public function setDefaultValues()\n\t{\t\t\n\t\t\t \n\t}", "public static function null();", "public function nullberry(): void\n\t{\n\t}", "private function __construct () {}", "public function __construct()\n\t{\n\t\t// TODO Auto-generated constructor\n\t}", "private function __construct()\r\r\n\t{\r\r\n\t}", "private function __construct()\r\n\t{\r\n\t\r\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n\t{\n\t\t\n\t}", "public function __construct()\n {\n }", "private function __construct()\r\n\t{\r\n\t}", "private function __construct () \n\t{\n\t}" ]
[ "0.67244875", "0.6646183", "0.6552279", "0.64766324", "0.63672394", "0.63626754", "0.6340255", "0.63153034", "0.63153034", "0.63153034", "0.63153034", "0.63153034", "0.62998855", "0.62978727", "0.629776", "0.6292766", "0.6292766", "0.6289175", "0.6279521", "0.6271484", "0.6271484", "0.6270283", "0.6254485", "0.6251185", "0.62494606", "0.6238679", "0.6234583", "0.6217301", "0.6217273", "0.6217273", "0.621726", "0.621726", "0.621726", "0.62155265", "0.62155265", "0.62155265", "0.62155265", "0.6215375", "0.6214995", "0.62133515", "0.62133515", "0.62094367", "0.6205836", "0.6201803", "0.61990994", "0.61990887", "0.6197911", "0.61954284", "0.61954284", "0.6194632", "0.61901", "0.61901", "0.61901", "0.61901", "0.61901", "0.61870474", "0.61870474", "0.6183675", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61814183", "0.61789143", "0.6177755", "0.61725676", "0.61653465", "0.6162008", "0.6162008", "0.6162008", "0.61605495", "0.61591095", "0.6158939", "0.6158544", "0.6150508", "0.61500776", "0.6147384", "0.61388415", "0.61348075", "0.61348075", "0.61348075", "0.61348075", "0.61348075", "0.61348075", "0.61348075", "0.61348075", "0.61348075", "0.61348075", "0.6129822", "0.6128945", "0.61289024" ]
0.0
-1
Create a new message instance.
public function __construct(Contact $contact) { $this->contact = $contact; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createMessage()\n {\n $message = new Message(new Swift_Message);\n\n\n // If a global from address has been specified we will set it on every message\n // instances so the developer does not have to repeat themselves every time\n // they create a new message. We will just go ahead and push the address.\n if (isset($this->from['address'])) {\n $message->from($this->from['address'], $this->from['name']);\n }\n\n return $message;\n }", "protected function createMessage() {\n $config = $this->messageConfig;\n if (!array_key_exists('class', $config)) {\n $config['class'] = $this->messageClass;\n }\n $config['smser'] = $this;\n return Yii::createObject($config);\n }", "protected static function newMessage()\n {\n self::$message = \\Swift_Message::newInstance();\n }", "public function create()\n {\n //\n $this->message->sendMessage();\n }", "private function newMessage()\n {\n /* @var $config ModuleOptions */\n $config = $this->serviceLocator->get('EscoMail\\Options');\n\n $this->message = new Message();\n $this->message->setFrom($config->getMailSendFrom(), $config->getMailSendFromName());\n\n return $this->message;\n }", "protected function createMessage()\n\t{\n\t\t$config = $this->messageConfig;\n\t\tif (!array_key_exists('class', $config)) {\n\t\t\t$config['class'] = $this->messageClass;\n\t\t}\n\t\t$config['mailer'] = $this;\n\n\t\treturn Yii::createObject($config);\n\t}", "public function createMessage(): MessageInterface;", "public function create(string $message = ''): BusMessageInterface;", "public function createInstance()\n {\n $mock = $this->mock(static::TEST_SUBJECT_CLASSNAME)\n ->getMessage();\n\n return $mock->new();\n }", "public static function createInstance()\n {\n return new MailMessage('[email protected]');\n }", "public static function init( $_id )\n {\n $message = new Message();\n $message->get( $_id );\n return $message;\n }", "public function createMessage(string $typeName): MessageInterface;", "public function createMailMessage();", "static public function factory($messageType = 3) {\n\t\treturn new self($messageType);\n\t}", "public function createMessage(array $parameters = []);", "public function user_message_create() {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\tif ($this->valide_userid () == false) {\n\t\t\treturn $this;\n\t\t}\n\t\t$message_created = $this->getObjetO365Wsclient ()\n\t\t\t->jsonPostMethod ( '/users/' . $this->getUserId () . '/messages', $this->getEmailContent () );\n\t\t$this->onDebug ( $message_created, 2 );\n\t\tif (isset ( $message_created->id ) && ! empty ( $message_created->id )) {\n\t\t\treturn $this->setO356MessageRef ( $message_created )\n\t\t\t\t->setMessageId ( $message_created->id );\n\t\t}\n\t\treturn $this->onError ( 'Pas d\\'ID durant la creation du message de O365', $message_created, 1 );\n\t}", "private function newMessage(array $data)\n {\n\n $message = Message::create([\n 'channel_id' => $data['channel_id'],\n 'user_id' => Auth::guard()->user()->id,\n 'message' => $data['message']\n ]);\n if ($message) {\n $this->notifyChannelUsers($data['channel_id']);\n }\n return $message;\n }", "public function initMessage() {}", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "public function __construct(Message $message)\n {\n $this->message = $message;\n }", "private function createMessageObject(string $type, string $message): Notification\n {\n $msg = new Notification();\n\n $msg->setType($type);\n $msg->setMessage($message);\n\n $this->handler->add($msg);\n\n return $msg;\n }", "protected static function newFactory()\n {\n return MessageFactory::new();\n }", "public function message(mixed $data = null)\n {\n $message = new Message((string) $data);\n\n return $message;\n }", "public static function createFromString($raw)\n {\n $message = new self(array('raw' => $raw));\n return $message;\n }", "public static function create(string $text = null): GoogleChatMessage\n {\n $message = new static;\n\n if ($text) {\n $message->text($text);\n }\n\n return $message;\n }", "public function create() {\n\t\t$user = $this->current_user();\n\t\t$message = $this->discussion->create_message($this->message_data() + ['creator' => ['id' => $user->_id, 'name' => $user->name]]);\n\n\t\tif ($this->discussion->push_message($message)) {\n\t\t\treturn $this->redirect(['Discussions::show', 'id' => $this->discussion->_id, 'project_id' => $this->discussion->project_id]);\n\t\t}\n\n\t\treturn compact('message');\n\t}", "public static function createFromArray($fields) \n\t{\n\t\t$message = new Message();\n\t\tself::populate($message,$fields);\n\t\treturn $message;\n\t}", "public function addMessage()\n {\n if(null === $this->obj_message) {\n $this->obj_message = new Message();\n }\n return $this->obj_message;\n }", "public function createMimeMessage();", "public function testCreateMethodReturnsNewInstance(): void\n {\n $message = DiscordMessage::create();\n $this->assertInstanceOf(DiscordMessage::class, $message);\n }", "function createMessage($email) {\n $message = new Google_Service_Gmail_Message();\n $message->setRaw(base64_encode($email));\n return $message;\n}", "protected function createMessage(Swift_Message $message)\n {\n $mimeEntity = new Swift_Message('', $message->getBody(), $message->getContentType(), $message->getCharset());\n $mimeEntity->setChildren($message->getChildren());\n\n $messageHeaders = $mimeEntity->getHeaders();\n $messageHeaders->remove('Message-ID');\n $messageHeaders->remove('Date');\n $messageHeaders->remove('Subject');\n $messageHeaders->remove('MIME-Version');\n $messageHeaders->remove('To');\n $messageHeaders->remove('From');\n\n return $mimeEntity;\n }", "public function __construct($message)\n {\n // $this->message = $message;\n }", "function createMessage($object) {\n\tglobal $USER;\n\t\n\t$message = new \\core\\message\\message();\n\t$message->component = 'local_littlehelpers';\n\t$message->name = 'paragraph52notification';\n\t$message->userfrom = $USER;\n\t\n\t// Get user\n\t$message->userto = core_user::get_user($object->useridto);\n\t\n\t// force email sending\n\t$message->userto->emailstop = 0;\n\t\n\t$message->subject = $object->subject;\n\t$message->fullmessage = $object->fullmessage;\n\t$message->fullmessageformat = FORMAT_MARKDOWN;\n\t$message->fullmessagehtml = $object->fullmessagehtml;\n\t$message->smallmessage = $object->smallmessage;\n\t$message->notification = '0';\n\t\n\t$message->contexturl = 'https://moodle.tu-darmstadt.de/local/littlehelpers/paragraph52';\n\t$message->contexturlname = 'Paragraph52';\n\t$message->replyto = \"[email protected]\";\n\n\treturn $message;\n}", "public function __construct($message)\r\n {\r\n $this->message = $message;\r\n\r\n }", "public function createMessage($content, $options = array('content_type' => 'application/json', 'delivery_mode' => 2))\n {\n if (!empty($options['content_type']) && $options['content_type'] == 'application/json')\n $content = json_encode($content);\n return new AMQPMessage($content, $options);\n }", "public function __construct($message) {\n $this->message= $message;\n }", "public function __construct($msg)\n {\n $this->message = $msg;\n }", "public function __construct(Message $message)\n {\n parent::__construct($message);\n }", "public function __construct($messageDefinition)\n {\n $this->messageDefintion = $messageDefinition;\n }", "public function testCreateMessage()\n {\n $config = new Configuration();\n// $config->setHost(\"http://127.0.0.1:8080\");\n $apiInstance = new DaDaPushMessageApi(\n // If you want use custom http client, pass your client which implements `GuzzleHttp\\ClientInterface`.\n // This is optional, `GuzzleHttp\\Client` will be used as default.\n new \\GuzzleHttp\\Client(),\n $config\n );\n\n $actions = [\n new Action($data = array(\"name\" => \"view\", \"url\" => \"https://www.dadapush.com/\", \"type\" => \"link\"))\n ];\n\n $body = new MessagePushRequest($data = array(\"title\" => \"Good News!\",\n \"content\" => \"Good News! DaDaPush releasing new version\",\n \"need_push\" => true,\n \"actions\" => $actions\n ));\n\n $channel_token = 'ctb3lwO6AeiZOwqZgp8BE8980FdNgp0cp6MCf';\n\n $result = $apiInstance->createMessage($body, $channel_token);\n print_r($result);\n self::assertTrue($result->getCode()==0);\n }", "public static function create( $msg, $code = null, array $data = null ) {\n\t\tif ( $msg instanceof IApiMessage ) {\n\t\t\treturn $msg;\n\t\t} elseif ( $msg instanceof RawMessage ) {\n\t\t\treturn new ApiRawMessage( $msg, $code, $data );\n\t\t} else {\n\t\t\treturn new ApiMessage( $msg, $code, $data );\n\t\t}\n\t}", "public static function create($message, $type = '', $title = '', $icon = '')\n {\n return new self($message, $type, $title, $icon);\n }", "public function newEntity(array $attributes = [])\n {\n return new MessageContent($attributes);\n }", "public function create()\n {\n return view('materialadmin::message.create');\n }", "public static function factory($raw_message = null, $class_name = null) {}", "public function __construct($message = null) {}", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public function __construct($message)\n {\n $this->message = $message;\n }", "public static function createFromFile($filename)\n {\n $message = new self(array('file' => $filename));\n\n return $message;\n }", "public function create()\n\t{\n\t\treturn View::make('messages.create');\n\t}", "public function actionCreate()\n {\n $model = new Message();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "private function createMessage(InputInterface $input)\n {\n $message = new \\Swift_Message(\n $input->getOption('subject'),\n $input->getOption('body'),\n $input->getOption('content-type'),\n $input->getOption('charset')\n );\n $message->setFrom($input->getOption('from'));\n $message->setTo($input->getOption('to'));\n\n return $message;\n }", "public function test_message_can_be_created() {\n\n $this->assertInstanceOf(Message::class, $this->message);\n $this->assertDatabaseHasMessageWithPublicId($this->message->getPublicId());\n\n }", "protected function getMessage()\n {\n //return new \\Swift_Message('Test subject', 'Test body.');\n }", "public function testConstructorAndGetters() \r\n \t{\r\n \t\t// create a message with complete constructor args\r\n \t\t$message = new Message( Message::NORMAL, \r\n \t\t\t\t\t\t\t\t(object)array( 'testProp' => 'testval' ),\r\n \t\t\t\t\t\t\t\tsimplexml_load_string('<testMessage testAtt=\"Hello\" testAtt2=\"world\"/>'),\r\n \t\t\t\t\t\t\t\tMessage::PRIORITY_HIGH);\r\n \t\t\r\n \t\t// test assertions\r\n \t\t$this->assertTrue( $message instanceof Message, \"Expecting \\$message is Message\" );\r\n \t\t$this->assertTrue( $message->getType() == Message::NORMAL, \"Expecting \\$message->getType() == Message::NORMAL\" );\r\n \t\t$this->assertTrue( $message->getHeader()->testProp == 'testval', \"Expecting \\$message->getHeader()->testProp == 'testval'\" );\r\n \t\t$this->assertTrue( $message->getBody()->attributes()->testAtt == 'Hello', \"Expecting \\$message->getBody()->attributes()->testAtt == 'Hello'\" );\r\n \t\t$this->assertTrue( $message->getPriority() == Message::PRIORITY_HIGH, \"Expecting \\$message->getPriority() == Message::PRIORITY_HIGH\" );\r\n \t\t\r\n \t}", "public function __construct($data)\n {\n $this->message = $data;\n }", "public function __construct($data)\n {\n $this->message = $data;\n }", "public static function getInstance($messageClass = '\\PEIP\\Message\\GenericMessage')\n {\n return new self($messageClass);\n }", "public function __construct(NewMessageEvent $event)\n {\n $this->event = $event;\n }", "public static function createFromFile(string $path) : CommitMessage\n {\n if (!file_exists($path)) {\n throw new \\RuntimeException('Commit message file not found');\n }\n return new CommitMessage(file_get_contents($path));\n }", "public function testCreateWithoutId()\n {\n $faker = Factory::create();\n $messageAttributes = [\n 'body' => $faker->sentence(15),\n 'subject' => $faker->sentence(5),\n 'name' => $faker->name(),\n 'email' => $faker->email(),\n 'custom_info' => $faker->sentence(3)\n\n ];\n $response = $this->client->messages()->create($messageAttributes);\n $this->assertEquals($messageAttributes['body'], $response['message']['body']);\n $this->assertEquals($messageAttributes['subject'], $response['message']['subject']);\n\n return $response;\n }", "public function create(Message $message): void\n {\n $this->items[$message->getEventName()][$message->getId()] = $message;\n }", "public function __construct($message, $type)\n\t{\n\t\t$this->message = $message;\n\t\t$this->type = $type;\n\t}", "public function __construct(MimeMessage $message = null) {\n $this->htmlBody = new MimePart();\n $this->htmlBody->type = Mime::TYPE_HTML;\n $this->htmlBody->charset = 'utf-8';\n $this->htmlBody->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n\n $this->textBody = new MimePart();\n $this->textBody->type = Mime::TYPE_TEXT;\n $this->textBody->charset = 'utf-8';\n $this->textBody->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n }", "public function create(){}", "public function actionCreate() {\n if (isset($_POST['Message'])) {\n $resp = array(\n 'color' => '#FF6600',\n 'background_color' => '#FFFFCC',\n 'position' => 'top',\n 'removebutton' => 0,\n 'translation' => $_POST['Message']['translation']\n );\n $model = new Message();\n $model->setAttributes($_POST['Message']);\n if ($model->save()) {\n $resp['message'] = Yii::t('translate', 'Message successfully saved');\n $resp['id'] = $model->id;\n } else {\n $errors = $this->errors($model);\n $resp['message'] = Yii::t('translate', '<p>Unable to save the message. Something went wrong!<p/>' . implode('<br/>', $errors));\n }\n echo $this->je($resp);\n Yii::app()->end();\n }\n $id = (int)Yii::app()->request->getParam('id');\n $lang = Yii::app()->request->getParam('lang');\n if ($id && $lang) {\n $model = MessageSource::model()->findByPk($id);\n if ($model) {\n $message = $model->loadMessage();\n $message->id = $model->id;\n $message->language = $lang;\n $this->renderPartial('form', array(\n 'model' => $message\n ));\n } else throw new CHttpException(400);\n } else throw new CHttpException(404, 'The requested page does not exist.');\n }", "public static function create() {}", "public static function create() {}", "public static function create() {}", "protected static function newFactory(): Factory\n {\n return MessageFactory::new();\n }", "public function __construct(string $message)\n {\n $this->message = $message;\n }", "public function create()\n {\n return view('message');\n }", "public function newAction()\n {\n $entity = new Message();\n $form = $this->createForm(new MessageType(), $entity);\n\n return $this->render('CoreMarketingBundle:Message:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "protected function createDocument(\\TYPO3\\Jobqueue\\Common\\Queue\\Message $message) {\n\t\t$properties = ObjectAccess::getGettableProperties($message);\n\t\t$messageDocument = new Message($message->getPayload(), $message->getIdentifier());\n\n\t\tforeach ($properties as $propertyName => $propertyValue) {\n\t\t\tObjectAccess::setProperty($messageDocument, $propertyName, $propertyValue);\n\t\t}\n\n\t\treturn $messageDocument;\n\t}", "public function __construct($message = '', $type = 'info') {\n $this->message = $message;\n }", "protected function render(): Message\n {\n $headers = '';\n foreach ($this->buildHeaders() as $header => $value) {\n $headers .= \"{$header}: {$value}\" . self::CRLF;\n }\n $message = implode(self::CRLF, $this->buildMessage());\n\n return new Message($headers, $message);\n }", "public function create()\n\t{\n\t\t$form = \\View::make('message.form');\n\t\t$form->project_id = \\Session::get('active_project');\n\t\t$form->action = array('action' => 'Toomdrix\\Pm\\MessageController@store', 'class'=>'form-signup');\n\t\treturn $form;\n\t}", "public static function getInstance($context=null) {\n return new Messages($context);\n }", "public function create_post() {\n\t\t$data['uid'] = $this->input->get('uid');\n\t\t$data['to'] = $this->input->get('to');\n\t\t$data['text'] = $this->input->get('text');\n\t\t$data['ts'] = now();\n\n\t\t$this->Messages_model->create($data);\n\t}", "public function getGeneratedMessage()\n {\n # Force the template to render\n (string) $this->prepareTemplate();\n\n $m = $this->template->__message;\n\n if (!$m->getFrom()) {\n trigger_error(\"You should add 'from' information.\", E_USER_WARNING);\n }\n\n if (!$m->getSubject()) {\n trigger_error(\"You should add 'subject'.\", E_USER_WARNING);\n }\n\n if (!$m->getHeader('To')) {\n trigger_error(\"You should add recipients.\", E_USER_WARNING);\n }\n\n foreach ($this->attachments as $attachment) {\n list($filename, $content, $type) = $attachment;\n $m->addAttachment($filename, $content, $type);\n }\n\n return $m;\n }", "public function __construct($message='1111222333',$type='2222')\n {\n $this->type = $type;\n $this->message = $message;\n }", "public static function new()\n {\n if ( ! empty($_REQUEST['mgb_rating_message']) ) Database::insert([\n 'message' => $_REQUEST['mgb_rating_message'],\n 'author' => self::author(),\n 'state' => (!json_decode($_REQUEST['mgb_rating_moderation'])) ? true : false\n ]);\n }", "public function create() {}", "public function compose() {\n return $this->createMessage();\n }", "public function create()\n {\n // die('here');\n return view('message.create');\n }", "public function create()\n {\n return view('messages.create');\n }", "public function create()\n {\n return view('messages.create');\n }", "public function actionCreate()\n {\n $model = new Message();\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->save())\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model\n ]);\n }\n }", "public static function getInstanceFromMessage(\\PEIP\\INF\\Message\\Message $message)\n {\n return new self(get_class($message));\n }", "public function store(Request $request)\n {\n $this->validate($request, [\n 'body' => 'required|max:5000',\n 'user_id' => ['required', new NotSelfId(), 'exists:users,id'],\n ]);\n\n $message = Auth::user()->messages()->create([\n 'data' => [\n 'text' => request('body'),\n ],\n ]);\n\n Auth::user()->conversations()->attach($message, [\n 'contact_id' => $request->user_id,\n ]);\n\n if (!$this->isAuthUserBlockedToContact($request->user_id, Auth::user()->id)) {\n User::find($request->user_id)->conversations()->attach($message, [\n 'contact_id' => Auth::id(),\n ]);\n\n // broadcast the message to the other person\n event(new MessageCreated($message, $request->user_id, Auth::user()->id));\n }\n\n $message->owner = Auth::user();\n\n return new MessageResource($message);\n }", "public function create()\n {\n return view('admin.messages.create');\n }", "public function __construct($message) {\r\n parent::__construct($message);\r\n }", "public function __construct($messageData)\n {\n $this->messageData = $messageData;\n }" ]
[ "0.81376195", "0.7959614", "0.77619994", "0.7713793", "0.76559645", "0.7553059", "0.7458076", "0.71510184", "0.6852663", "0.68347865", "0.67154217", "0.6689976", "0.6683088", "0.6644564", "0.6628052", "0.6549025", "0.6514292", "0.6501647", "0.645071", "0.645071", "0.645071", "0.645071", "0.645071", "0.64457685", "0.63510966", "0.6340597", "0.633213", "0.6326836", "0.6310014", "0.6258695", "0.6234698", "0.62195796", "0.62077796", "0.620518", "0.6204953", "0.6198459", "0.6177945", "0.61717975", "0.617064", "0.6150332", "0.61301666", "0.6109668", "0.61057645", "0.60924155", "0.6081678", "0.60787344", "0.60670817", "0.6049224", "0.60457045", "0.60438704", "0.6036989", "0.6036989", "0.6036989", "0.6036989", "0.6036989", "0.6036989", "0.6026595", "0.6025895", "0.6022185", "0.6005734", "0.6002389", "0.6000802", "0.59941816", "0.59808266", "0.59808266", "0.59678143", "0.5966462", "0.59593695", "0.594777", "0.5938714", "0.5910345", "0.5893692", "0.5880708", "0.5878038", "0.58748907", "0.58748907", "0.58748907", "0.5873998", "0.5869665", "0.5864223", "0.5860705", "0.5858159", "0.5854505", "0.5845474", "0.5842933", "0.58327615", "0.58256036", "0.58199257", "0.58134514", "0.57909477", "0.5787155", "0.57835746", "0.5783115", "0.57801926", "0.57801926", "0.5779767", "0.57784975", "0.57596684", "0.5748547", "0.5746673", "0.57461363" ]
0.0
-1
Display a listing of the Specification_type.
public function index(Request $request) { $specificationTypes = $this->specificationTypeRepository->all(); return view('specification_types.index') ->with('specificationTypes', $specificationTypes); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function index() {\n $specs = Specification::paginate(config('globalSettings.entries-per-page'));\n return view('admin.specs.specs',\n [\n 'specs' => $specs\n ]\n );\n }", "public function specializations_list()\n {\n $data['specializations'] = Specialization::all();\n return view('admin.specializations',$data);\n }", "public function list_of($type)\n {\n }", "public function displaySpecsAction(Request $request) {\n $session = $request->getSession();\n $session->clear();\n $specs = $this->getSpecificationsDoctrine();\n return $this->render('MercedesVStoreBundle:Default:spec.html.twig', array(\"specification\" => $specs, \"activeMenuItem\" => \"spec\"));\n }", "public function index()\n {\n $specifications=Specification::paginate(10);\n return view('specifications.index')->with('specifications',$specifications);\n }", "public function index()\n\t{\n\t\t//\n\t\t$productSpecs = CepSpecificationProducts::all();\n\t\treturn view(\"product_specifications.index\",compact('productSpecs'));\n\t}", "public function index()\n {\n $specifications = Specifications::all();\n return view('specifications.index', compact('specifications'));\n }", "protected function list($type = null)\n {\n $documents = $this->repository\n ->pushCriteria(app('Litepie\\Repository\\Criteria\\RequestCriteria'))\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n\n return $this->response->title(trans('$document::$document.names'))\n ->view('$document::public.document.index')\n ->data(compact('$documents'))\n ->output();\n }", "public function index()\n {\n $productType = $this->productTypeService->productTypeRepository->getPaginated();\n\n return view('admin.product_type.list', compact('productType'));\n }", "public function indexByTypeAction($type)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('StriideInventoryBundle:Item')->findByType($type);\n\n return $this->render('StriideInventoryBundle:Item:indexByType.html.twig', array(\n 'entities' => $entities,\n 'type' => $type\n ));\n }", "public function index()\n {\n $types = Type::all();\n return $this->showAll($types);\n }", "public function index()\n {\n $types = Type::all();\n\n return $this->showAll($types);\n }", "public function show(Specialization $specialization)\n {\n //\n }", "public function create()\n {\n $specification = Specification::all();\n return view('specification_types.create')->with(compact('specification'));\n }", "protected function list($type = null)\n {\n $faqs = $this->repository\n ->pushCriteria(app('Litepie\\Repository\\Criteria\\RequestCriteria'))\n ->scopeQuery(function($query){\n return $query->orderBy('id','DESC');\n })->paginate();\n\n\n return $this->response->title(trans('faq::faq.names'))\n ->view('faq::public.faq.index')\n ->data(compact('faqs'))\n ->output();\n }", "public function show(ComputerType $computerType)\n {\n //\n }", "public function index()\n\t{\n\t\t// $product_types = $this->product_type->all();\n\t\t$product_types = ProductType::paginate(50);\n\n\t\treturn View::make('scaffolds.product_types.index', compact('product_types'));\n\t}", "public function index()\n\t{\n\t\tif (!Auth::instance()->authorized_for('system_information')) {\n\t\t\treturn url::redirect('extinfo/unauthorized/0');\n\t\t}\n\n\t\t$this->type = isset($_GET['type']) ? $_GET['type'] : $this->type;\n\t\t$items_per_page = $this->input->get('items_per_page', config::get('pagination.default.items_per_page'));\n\t\t$pagination = new CountlessPagination(array('items_per_page' => $items_per_page));\n\n\t\t$filter = $this->input->get('filterbox', null);\n\n\t\t// Object types used on this page paired with their columns for filter\n\t\t// matching.\n\t\t$obj_types = array(\n\t\t\t\"hosts\" => array(\"name\"),\n\t\t\t\"hostgroups\" => array(\"name\"),\n\t\t\t\"services\" => array(\"description\", \"host.name\"),\n\t\t\t\"servicegroups\" => array(\"name\"),\n\t\t\t\"contacts\" => array(\"name\"),\n\t\t\t\"contactgroups\" => array(\"name\"),\n\t\t\t\"timeperiods\" => array(\"name\"),\n\t\t\t\"commands\" => array(\"name\", \"line\")\n\t\t);\n\n\t\t$pool = ObjectPool_Model::pool($this->type);\n\t\tif ($pool !== false) {\n\t\t\t// Find filter matches in all given columns for the current object\n\t\t\t// type, and merge the result to $set.\n\t\t\t$set = $pool->none();\n\t\t\t$columns = $obj_types[$this->type];\n\t\t\tforeach ($columns as $column) {\n\t\t\t\t$set = $set->union($pool->all()->reduce_by(\n\t\t\t\t\t$column, $filter, \"~~\"\n\t\t\t\t));\n\t\t\t}\n\n\t\t\tif (!$this->mayi->run($set->mayi_resource().\":read.list.config\", array(), $messages)) {\n\t\t\t\t$set = $pool->none();\n\t\t\t}\n\t\t\tforeach ($messages as $m) {\n\t\t\t\t$this->notices[] = new ErrorNotice_Model($m);\n\t\t\t}\n\t\t\ttry {\n\t\t\t\t$data = $set->it(\n\t\t\t\t\tfalse, array(), $pagination->items_per_page,\n\t\t\t\t\t($pagination->current_page-1)*$pagination->items_per_page\n\t\t\t\t);\n\t\t\t} catch(ORMException $e) {\n\t\t\t\t$this->notices[] = new ErrorNotice_Model($e->getMessage());\n\t\t\t\t$data = array();\n\t\t\t}\n\n\t\t\t$i = 0;\n\t\t\t$result=array();\n\t\t\tswitch ($this->type) {\n\t\t\t\tcase 'hosts': // *****************************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Host Name'),\n\t\t\t\t\t\t_('Alias/Description'),\n\t\t\t\t\t\t_('Display Name'),\n\t\t\t\t\t\t_('Address'),\n\t\t\t\t\t\t_('Parent Hosts'),\n\t\t\t\t\t\t_('Max. Check Attempts'),\n\t\t\t\t\t\t_('Check Interval'),\n\t\t\t\t\t\t_('Retry Interval'),\n\t\t\t\t\t\t_('Host Check Command'),\n\t\t\t\t\t\t_('Check Period'),\n\t\t\t\t\t\t_('Obsess Over'),\n\t\t\t\t\t\t_('Enable Active Checks'),\n\t\t\t\t\t\t_('Enable Passive Checks'),\n\t\t\t\t\t\t_('Check Freshness'),\n\t\t\t\t\t\t//_('Freshness Threshold'),\n\t\t\t\t\t\t_('Default Contact Groups'),\n\t\t\t\t\t\t_('Notification Interval'),\n\t\t\t\t\t\t_('First Notification Delay'),\n\t\t\t\t\t\t//_('Notification Options'),\n\t\t\t\t\t\t_('Notification Period'),\n\t\t\t\t\t\t_('Event Handler'),\n\t\t\t\t\t\t_('Enable Event Handler'),\n\t\t\t\t\t\t//_('Stalking Options'),\n\t\t\t\t\t\t_('Enable Flap Detection'),\n\t\t\t\t\t\t_('Low Flap Threshold'),\n\t\t\t\t\t\t_('High Flap Threshold'),\n\t\t\t\t\t\t_('Process Performance Data'),\n\t\t\t\t\t\t//_('Enable Failure Prediction'),\n\t\t\t\t\t\t//_('Failure Prediction Options'),\n\t\t\t\t\t\t_('Notes'),\n\t\t\t\t\t\t_('Notes URL'),\n\t\t\t\t\t\t_('Action URL'),\n\t\t\t\t\t\t_('Icon image'),\n\t\t\t\t\t\t_('Icon image alt'),\n\t\t\t\t\t\t//_('Retention Options')\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$row = (object) $row;\n\t\t\t\t\t\t$result[$i][]= '<a name=\"'.$row->get_name().'\"></a>'.$row->get_name();\n\t\t\t\t\t\t$result[$i][]= $row->get_alias();\n\t\t\t\t\t\t$result[$i][]= $row->get_display_name();\n\t\t\t\t\t\t$result[$i][]= $row->get_address();\n\t\t\t\t\t\t$tmp = array();\n\t\t\t\t\t\tforeach ($row->get_parents() as $parent) {\n\t\t\t\t\t\t\t$tmp[] = html::anchor(Router::$controller.'/?type=hosts#'.$parent, $parent);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result[$i][] = implode(', ',$tmp);\n\t\t\t\t\t\t$result[$i][]= $row->get_max_check_attempts();\n\t\t\t\t\t\t$result[$i][]= time::to_string($row->get_check_interval()*60);\n\t\t\t\t\t\t$result[$i][]= time::to_string($row->get_retry_interval()*60);\n\t\t\t\t\t\t$result[$i][]= html::anchor(Router::$controller.'/?type=commands#'.$row->get_check_command(), $row->get_check_command());\n\t\t\t\t\t\t$result[$i][]= html::anchor(Router::$controller.'/?type=timeperiods#'.$row->get_check_period(), $row->get_check_period());\n\t\t\t\t\t\t$result[$i][]= $row->get_obsess() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_active_checks_enabled() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_accept_passive_checks() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_check_freshness() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t//$result[$i][]= $row->get_freshness_threshold() == 0 ? _('Auto-determined value') : $row->get_freshness_threshold().' '._('seconds');\n\t\t\t\t\t\t$c_link = array();\n\t\t\t\t\t\tforeach($row->get_contact_groups() as $cg){\n\t\t\t\t\t\t\t$c_link[] = html::anchor(Router::$controller.'/?type=contactgroups#'.$cg, $cg);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($row->get_contacts() as $c){\n\t\t\t\t\t\t\t$c_link[] = html::anchor(Router::$controller.'/?type=contacts#'.$c, $c);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result[$i][] = implode(', ', $c_link);\n\n\t\t\t\t\t\t$result[$i][]= $row->get_notification_interval() == 0 ? _('No Re-notification') : $row->get_notification_interval();\n\t\t\t\t\t\t$result[$i][]= time::to_string($row->get_first_notification_delay());\n\t\t\t\t\t\t$result[$i][]= html::anchor(Router::$controller.'/?type=timeperiods#'.$row->get_notification_period(), $row->get_notification_period());\n\t\t\t\t\t\t$result[$i][]= $row->get_event_handler() == 0 ? '&nbsp;' : $row->get_event_handler();\n\t\t\t\t\t\t$result[$i][]= $row->get_event_handler_enabled() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_flap_detection_enabled() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_low_flap_threshold() == 0.0 ? _('Program-wide value') : $row->get_low_flap_threshold();\n\t\t\t\t\t\t$result[$i][]= $row->get_high_flap_threshold() == 0.0 ? _('Program-wide value') : $row->get_high_flap_threshold();\n\t\t\t\t\t\t$result[$i][]= $row->get_process_performance_data() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_notes();\n\t\t\t\t\t\t$result[$i][]= $row->get_notes_url();\n\t\t\t\t\t\t$result[$i][]= $row->get_action_url();\n\t\t\t\t\t\t$result[$i][]= $row->get_icon_image();\n\t\t\t\t\t\t$result[$i][]= $row->get_icon_image_alt();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'services': // **************************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Host'),\n\t\t\t\t\t\t_('Service Description'),\n\t\t\t\t\t\t_('Max. Check Attempts'),\n\t\t\t\t\t\t_('Normal Check Interval'),\n\t\t\t\t\t\t_('Retry Check Interval'),\n\t\t\t\t\t\t_('Check Command'),\n\t\t\t\t\t\t_('Check Period'),\n\t\t\t\t\t\t//_('Parallelize'),\n\t\t\t\t\t\t//_('Volatile'),\n\t\t\t\t\t\t_('Obsess Over'),\n\t\t\t\t\t\t_('Enable Active Checks'),\n\t\t\t\t\t\t_('Enable Passive Checks'),\n\t\t\t\t\t\t_('Check Freshness'),\n\t\t\t\t\t\t//_('Freshness Threshold'),\n\t\t\t\t\t\t_('Default Contact Groups'),\n\t\t\t\t\t\t_('Enable Notifications'),\n\t\t\t\t\t\t_('Notification Interval'),\n\t\t\t\t\t\t_('First Notification Delay'),\n\t\t\t\t\t\t//_('Notification Options'),\n\t\t\t\t\t\t_('Notification Period'),\n\t\t\t\t\t\t_('Event Handler'),\n\t\t\t\t\t\t_('Enable Event Handler'),\n\t\t\t\t\t\t//_('Stalking Options'),\n\t\t\t\t\t\t_('Enable Flap Detection'),\n\t\t\t\t\t\t_('Low Flap Threshold'),\n\t\t\t\t\t\t_('High Flap Threshold'),\n\t\t\t\t\t\t_('Process Performance Data'),\n\t\t\t\t\t\t//_('Enable Failure Prediction'),\n\t\t\t\t\t\t//_('Failure Prediction Options'),\n\t\t\t\t\t\t_('Notes'),\n\t\t\t\t\t\t_('Notes URL'),\n\t\t\t\t\t\t_('Action URL'),\n\t\t\t\t\t\t_('Icon image'),\n\t\t\t\t\t\t_('Icon image alt'),\n\t\t\t\t\t\t//_('Retention Options'),\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$row = (object) $row;\n\n\t\t\t\t\t\t$result[$i][]= '<a name=\"'.$row->get_host()->get_name().'\"></a>'.$row->get_host()->get_name();\n\t\t\t\t\t\t$result[$i][]= '<a name=\"'.$row->get_description().'\"></a>'.$row->get_description();\n\t\t\t\t\t\t$result[$i][]= $row->get_max_check_attempts();\n\t\t\t\t\t\t$result[$i][]= time::to_string($row->get_check_interval()*60);\n\t\t\t\t\t\t$result[$i][]= time::to_string($row->get_retry_interval()*60);\n\t\t\t\t\t\t$result[$i][]= $row->get_check_command();\n\t\t\t\t\t\t$result[$i][]= html::anchor(Router::$controller.'/?type=timeperiods#'.$row->get_check_period(), $row->get_check_period());\n\t\t\t\t\t\t$result[$i][]= $row->get_obsess() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_active_checks_enabled() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_accept_passive_checks() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_check_freshness() == 1 ? _('Yes') : _('No');\n\n\t\t\t\t\t\t$c_link = array();\n\t\t\t\t\t\tforeach($row->get_contact_groups() as $cg){\n\t\t\t\t\t\t\t$c_link[] = html::anchor(Router::$controller.'/?type=contactgroups#'.$cg, $cg);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforeach($row->get_contacts() as $c){\n\t\t\t\t\t\t\t$c_link[] = html::anchor(Router::$controller.'/?type=contacts#'.$c, $c);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result[$i][] = implode(', ', $c_link);\n\n\t\t\t\t\t\t$result[$i][]= $row->get_notifications_enabled() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_notification_interval() == 0 ? _('No Re-notification') : $row->get_notification_interval();\n\t\t\t\t\t\t$result[$i][]= time::to_string($row->get_first_notification_delay());\n\t\t\t\t\t\t$result[$i][]= html::anchor(Router::$controller.'/?type=timeperiods#'.$row->get_notification_period(), $row->get_notification_period());\n\t\t\t\t\t\t$result[$i][]= $row->get_event_handler() == 0 ? '&nbsp;' : $row->get_event_handler();\n\t\t\t\t\t\t$result[$i][]= $row->get_event_handler_enabled() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_flap_detection_enabled() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_low_flap_threshold() == 0.0 ? _('Program-wide value') : $row->get_low_flap_threshold();\n\t\t\t\t\t\t$result[$i][]= $row->get_high_flap_threshold() == 0.0 ? _('Program-wide value') : $row->get_high_flap_threshold();\n\t\t\t\t\t\t$result[$i][]= $row->get_process_performance_data() == 1 ? _('Yes') : _('No');\n\t\t\t\t\t\t$result[$i][]= $row->get_notes();\n\t\t\t\t\t\t$result[$i][]= $row->get_notes_url();\n\t\t\t\t\t\t$result[$i][]= $row->get_action_url();\n\t\t\t\t\t\t$result[$i][]= $row->get_icon_image();\n\t\t\t\t\t\t$result[$i][]= $row->get_icon_image_alt();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tcase 'contacts': // **************************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Contact Name'),\n\t\t\t\t\t\t_('Alias'),\n\t\t\t\t\t\t_('Email Address'),\n\t\t\t\t\t\t_('Pager Address/Number'),\n\t\t\t\t\t\t//_('Service Notification Options'),\n\t\t\t\t\t\t//_('Host Notification Options'),\n\t\t\t\t\t\t_('Service Notification Period'),\n\t\t\t\t\t\t_('Host Notification Period'),\n\t\t\t\t\t\t//_('Service Notification Commands'),\n\t\t\t\t\t\t//_('Host Notification Commands'),\n\t\t\t\t\t\t//_('Retention Options'),\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$row = (object) $row;\n\t\t\t\t\t\t$result[$i][]= '<a name=\"'.$row->get_name().'\"></a>'.$row->get_name();\n\t\t\t\t\t\t$result[$i][]= $row->get_alias();\n\t\t\t\t\t\t$result[$i][]= '<a href=\"mailto:'.$row->get_email().'\">'.$row->get_email().'</a>';\n\t\t\t\t\t\t$result[$i][]= $row->get_pager();\n\n\t\t\t\t\t\t$result[$i][]= html::anchor(Router::$controller.'/?type=timeperiods#'.$row->get_host_notification_period(), $row->get_service_notification_period());\n\t\t\t\t\t\t$result[$i][]= html::anchor(Router::$controller.'/?type=timeperiods#'.$row->get_host_notification_period(), $row->get_host_notification_period());\n\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'contactgroups': // ********************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Group Name'),\n\t\t\t\t\t\t_('Description'),\n\t\t\t\t\t\t_('Contact Members'),\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$row = (object) $row;\n\n\t\t\t\t\t\t$result[$i][]= '<a name=\"'.$row->get_name().'\"></a>'.$row->get_name();\n\t\t\t\t\t\t$result[$i][]= $row->get_alias();\n\n\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\tforeach ($row->get_members() as $trip) {\n\t\t\t\t\t\t\t$temp[] = html::anchor(Router::$controller.'/?type=contacts#'.$trip, $trip);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($temp) {\n\t\t\t\t\t\t\t$result[$i][]= implode(', ',$temp);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$result[$i][]= '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'timeperiods': // ***********************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Name'),\n\t\t\t\t\t\t_('Alias/Description'),\n\t\t\t\t\t\t_('In effect?'),\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$result[$i][] = $row->get_name();\n\t\t\t\t\t\t$result[$i][] = $row->get_alias();\n\t\t\t\t\t\t$result[$i][] = $row->get_in() ? _('Yes') : _('No');\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'commands': // **************************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Command Name'),\n\t\t\t\t\t\t_('Command Line')\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$result[$i][] = $row->get_name();\n\t\t\t\t\t\t$result[$i][] = $row->get_line();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hostgroups': // ***********************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Group Name'),\n\t\t\t\t\t\t_('Description'),\n\t\t\t\t\t\t_('Host Members'),\n\t\t\t\t\t\t_('Notes'),\n\t\t\t\t\t\t_('Notes URL'),\n\t\t\t\t\t\t_('Action URL'),\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$row = (object) $row;\n\t\t\t\t\t\t$result[$i][]= '<a name=\"'.$row->get_name().'\"></a>'.$row->get_name();\n\t\t\t\t\t\t$result[$i][]= $row->get_alias();\n\n\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\tforeach ($row->get_members() as $trip) {\n\t\t\t\t\t\t\t$temp[] = html::anchor(Router::$controller.'/?type=hosts#'.$trip, $trip);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$result[$i][]= implode(', ',$temp);\n\n\t\t\t\t\t\t$result[$i][]= $row->get_notes();\n\t\t\t\t\t\t$result[$i][]= $row->get_notes_url();\n\t\t\t\t\t\t$result[$i][]= $row->get_action_url();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tunset($travel);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'servicegroups': // ********************************************************************\n\t\t\t\t\t$header = array(\n\t\t\t\t\t\t_('Group Name'),\n\t\t\t\t\t\t_('Description'),\n\t\t\t\t\t\t_('Service Members'),\n\t\t\t\t\t\t_('Notes'),\n\t\t\t\t\t\t_('Notes URL'),\n\t\t\t\t\t\t_('Action URL'),\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach($data as $row) {\n\t\t\t\t\t\t$row = (object) $row;\n\t\t\t\t\t\t$result[$i][]= '<a name=\"'.$row->get_name().'\"></a>'.$row->get_name();\n\t\t\t\t\t\t$result[$i][]= $row->get_alias();\n\n\t\t\t\t\t\t$temp = array();\n\t\t\t\t\t\tforeach ($row->get_members() as $host_service) {\n\t\t\t\t\t\t\t$temp[] = html::anchor(Router::$controller.'/?type=hosts#'.$host_service[0], $host_service[0]).' / '.html::anchor(Router::$controller.'/?type=services#'.$host_service[1], $host_service[1]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif($temp) {\n\t\t\t\t\t\t\t$result[$i][]= implode(', ',$temp);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$result[$i][]= '';\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$result[$i][]= $row->get_notes();\n\t\t\t\t\t\t$result[$i][]= $row->get_notes_url();\n\t\t\t\t\t\t$result[$i][]= $row->get_action_url();\n\t\t\t\t\t\t$i++;\n\t\t\t\t\t\tunset($travel);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\t$result = false;\n\t\t\t$header = false;\n\t\t}\n\t\t$this->template->title = _('Configuration').' » '._('View config');\n\t\t$this->template->content = $this->add_view('config/index');\n\n\t\t$this->template->js_strings = $this->js_strings;\n\t\t$this->template->content->header = $header;\n\t\t$this->template->content->data = $result;\n\t\tif(!$result || count($result) < $pagination->items_per_page) {\n\t\t\t$pagination->hide_next = true;\n\t\t}\n\t\t$this->template->content->pagination = $pagination;\n\t\t$filter_string = $this->input->get('filterbox');\n\t\t$this->template->content->filter_string = $filter_string;\n\n\t\t$this->template->content->type = $this->type;\n\t\t$this->template->toolbar = new Toolbar_Controller( _( \"View Config\" ), _('Object type') );\n\n\t\t$obj_form = '<form method=\"get\" action=\"\">';\n\t\t$obj_form .= ' <select class=\"auto\" name=\"type\" onchange=\"submit()\">';\n\n\t\tforeach ($obj_types as $t => $columns) {\n\t\t\tif ( $t === $this->type ) {\n\t\t\t\t$obj_form .= '<option value=\"' . $t . '\" selected=\"selected\">' . $t . '</option>';\n\t\t\t} else {\n\t\t\t\t$obj_form .= '<option value=\"' . $t . '\">' . $t . '</option>';\n\t\t\t}\n\t\t}\n\n\t\tob_start();\n\t\t?>\n\t\t</select>\n\t\t <input type=\"text\" id=\"filterbox\" name=\"filterbox\" placeholder=\n\t\t \"<?php echo html::specialchars(_('Enter text to filter')); ?> \"\n\t\t value=\"<?php echo html::specialchars($filter_string); ?>\" />\n\t\t <input type=\"submit\" value=\"<?php echo _(\"Filter\"); ?>\" />\n\t\t</form>\n\t\t<?php\n\t\t$obj_form .= ob_get_clean();\n\n\t\t$this->template->toolbar->info( $obj_form );\n\t}", "public function show(Type $type)\n {\n //\n }", "public function show(Type $type)\n {\n //\n }", "public function show(Type $type)\n {\n //\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t list($total, $suppliers) = Fanli_Service_Ptype::getList($page, $perpage);\n\t\t$this->assign('suppliers', $suppliers);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'] . '?'));\n\t}", "public function show(SpecSuggestions $specSuggestions)\n {\n //\n }", "public function index()\n {\n $cardtypes = CardType::all()->sortByDesc(\"id\");\n return view('backend.card_type.list',compact('cardtypes'));\n }", "function display_ad_specification_listing( $title_dev_ad_specification_listing_records, $page, $page_no )\n\t{\n\t\tif( $title_dev_ad_specification_listing_records != false )\n\t\t{\n\n\t\t\t$start = $page_no * RECORDS_PER_PAGE - RECORDS_PER_PAGE + 1;\n\t\t\tfor( $i = 0; $i < count( $title_dev_ad_specification_listing_records ); $i++ )\n\t\t\t{\n\t\t\t\t$specification_id = $title_dev_ad_specification_listing_records[$i]['specification_id'];\n\t\t\t\t$category_id = $title_dev_ad_specification_listing_records[$i]['category_id'];\n\t\t\t\t$parent_cate_title\t=\t$this-> getParentCategoryTitleById($category_id);\n\t\t\t\t$sub_cate_id = $title_dev_ad_specification_listing_records[$i]['sub_cate_id'];\n\t\t\t\t$child_cate_title\t=\t$this-> getChildCategoryTitleById($sub_cate_id);\n\t\t\t\t$specification_title = $title_dev_ad_specification_listing_records[$i]['specification_title'];\n\t\t\t\t$specification_sort_order = $title_dev_ad_specification_listing_records[$i]['specification_sort_order'];\n\t\t\t\t\n\t\t\t\tif(isset($_POST['sub_cate_id'])){\n\t\t\t\t\t$sub_cate_id\t=\t$_POST['sub_cate_id'];\n\t\t\t\t}else if(isset($_REQUEST['sub_cate_id']) == \"\"){\n\t\t\t\t\t$sub_cate_id\t=\t\"flag\";\t\n\t\t\t\t}else{\n\t\t\t\t\t$sub_cate_id\t=\t$_REQUEST['sub_cate_id'];\t\n\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t$specification_status = $title_dev_ad_specification_listing_records[$i]['specification_status'] == 1 ? \"<a href='\".$page.\"&amp;specification_id=\".$specification_id.\"&amp;action=change_status' title='In Active'><span class='active'><img src='images/active.png' alt='Active' border='0'></span></a>\" : \"<a class='inactive' href='\".$page.\"&amp;specification_id=\".$specification_id.\"&amp;action=change_status' title='Active'><span class='inactive'><img src='images/inactive.png' alt='Inactive' border='0'></span></a>\";\n\t\t\t\n\t\t\t$edit = \"<a class='misadvertisment' href='index.php?module_name=category_management&amp;file_name=add_ad_specification&amp;tab=category&amp;sub_cate_id=\".$sub_cate_id.\"&amp;specification_id=\".$specification_id.\"' title='Edit'><img src='images/edit.png' alt='Edit' border='0'></a>\";\n\t\t\t\t\n\t\t\t$delete = \"<a title='Delete' class='misadvertisment' href='javascript:void(0);' onclick='javascript: if( confirm(\\\"Are you sure to delete this Record?\\\") ) { window.location= \\\"\".$page.\"&amp;action=delete&amp;sub_cate_id=\".$sub_cate_id.\"\\\";}'><img src='images/delete.png' alt='Delete' border='0'></a>\";\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t$class = $i % 2 == 0 ? \"class='even_row'\" : \"class='odd_row'\";\n\t\t\t\t\n\t\t\t\t$title_dev_advertisment_listing .= '<tr '.$class.'>\n\t\t\t\t\t\t\t\t\t<td align=\"center\">'.$start.'</td>\n\t\t\t\t\t\t\t\t\t<td align=\"center\">'.$parent_cate_title.'</td>\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<td align=\"center\">'.$child_cate_title.'</td>\n\t\t\t\t\t\t\t\t\t<td align=\"center\">'.$specification_title.'</td>\n\t\t\t\t\t\t\t\t\t<td align=\"center\">'.$specification_status.'</td>\n\t\t\t\t\t\t\t\t\t<td align=\"center\">'.$edit.'</td>\n\t\t\t\t\t\t\t\t\t<td align=\"center\">'.$delete.'</td>\n\t\t\t\t\t\t\t\t</tr>';\n\t\t\t\t$start++;\n\t\t\t}\t//\tEnd of For Loooooooooop\n\t\t}\t//\tEnd of if( $title_dev_ad_specification_listing_records != false )\n\t\telse\n\t\t{\n\t\t\t$title_dev_advertisment_listing = '<tr>\n\t\t\t\t\t\t\t\t\t<td colspan=\"7\" class=\"bad-msg\" align=\"center\">No Specification Found.</td>\n\t\t\t\t\t\t\t\t</tr>';\n\t\t}\n\t\treturn $title_dev_advertisment_listing;\n\t}", "public function actionserviceTypeListing()\n\t{\n ob_start();\n Yii::app()->theme='back'; \n $res=ServiceTypes::model()->findAll();\n //echo \"<pre>\";print_r($res);die;\n $this->render('servicetypelisting',array('list'=>$res));\n\t}", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => ProductType::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $types = $em->getRepository('SandraPokemonBundle:Types')->findAll();\n\n return $this->render('types/index.html.twig', array(\n 'types' => $types,\n ));\n }", "public function index()\n {\n $types = $this->allResources($this->typeRepository);\n\n return TypeResource::collection($types);\n }", "public function index()\n {\n $types = RequestType::orderBy('id', 'desc')->paginate(10);\n return view('request.type.index', compact('types'));\n }", "public function index()\n {\n $types = $this->typeRepository->all();\n return view('types.index', compact('types'));\n }", "public function actionIndex()\n {\n $searchModel = new ProductTypeSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination->pageSize = (empty($searchModel->pagesize) ? 20 : $searchModel->pagesize);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listing($entity_type) {\n\n $templates_ids = $this->entityTypeManager->getStorage('cohesion_content_templates')->getQuery()->execute();\n\n if ($templates_ids) {\n $candidate_template_storage = $this->entityTypeManager->getStorage('cohesion_content_templates');\n $candidate_templates = $candidate_template_storage->loadMultiple($templates_ids);\n $bundles = [];\n foreach ($candidate_templates as $entity) {\n if (!isset($bundles[$entity->get('entity_type')])) {\n $bundles[$entity->get('entity_type')] = $entity->get('entity_type');\n }\n }\n\n $entity_types = $this->entityTypeManager->getDefinitions();\n foreach ($bundles as $entity_type_name) {\n $entity_type = $entity_types[$entity_type_name];\n $types[$entity_type_name] = [\n 'label' => ($entity_type->get('bundle_label')) ? $entity_type->get('bundle_label') : $entity_type->get('label'),\n 'description' => t('Manage your @settings_label templates', ['@settings_label' => strtolower($entity_type->getLabel())]),\n 'add_link' => Link::createFromRoute($entity_type->getLabel(), 'entity.cohesion_content_templates.collection', ['content_entity_type' => $entity_type_name]),\n ];\n }\n\n $build = [\n '#theme' => 'entity_add_list',\n '#bundles' => $types,\n '#add_bundle_message' => t('There are no available content templates. Go to the batch import page to import the list of content templates.'),\n '#cache' => [\n 'contexts' => $this->entityTypeDefinition->getListCacheContexts(),\n 'tags' => $this->entityTypeDefinition->getListCacheTags(),\n ],\n ];\n\n return $build;\n }\n else {\n throw new NotFoundHttpException();\n }\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $typeproduits = $em->getRepository('AppBundle:Typeproduit')->findAll();\n\n return $this->render('typeproduit/index.html.twig', array(\n 'typeproduits' => $typeproduits,\n ));\n }", "public function actionProducttype() {\n $data['type'] = ProductType::model()->findAll(\"\");\n $this->render('producttype',$data);\n }", "public function index()\n {\n return view('admin.product_types.index', ['types' => ProductType::all()]);\n }", "public function index()\n {\n $cabinSpecifications = JetCabin::all();\n\n return view('admin.cabinSpecifications.index', compact('cabinSpecifications'));\n }", "public function actionIndex($type)\n {\n if($this->isAuthenticate())\n {\n $searchModel = new SecurityEntitiesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $type);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'type' => $type,\n ]);\n }\n }", "public function index()\n {\n return ClaimTypeResource::collection(ClaimType::orderBy('Claim_Type_Code','ASC'));\n }", "public function show(TypesConges $typesConges)\n {\n //\n }", "public function listAction ($type, $code = null, $page = 1)\n {\n $response = new Response();\n $response->setPublic();\n $response->setMaxAge($this->container->getParameter('short_cache'));\n \n $limit = 30;\n if ($page < 1)\n $page = 1;\n $start = ($page - 1) * $limit;\n \n $pagetitle = \"Decklists\";\n \n switch ($type) {\n case 'recent':\n $result = $this->recent($start, $limit);\n $pagetitle = \"Recent Decklists\";\n break;\n case 'halloffame':\n $result = $this->halloffame($start, $limit);\n $pagetitle = \"Hall of Fame\";\n break;\n case 'hottopics':\n $result = $this->hottopics($start, $limit);\n $pagetitle = \"Hot Topics\";\n break;\n case 'favorites':\n $response->setPrivate();\n $result = $this->favorites($start, $limit);\n $pagetitle = \"Favorite Decklists\";\n break;\n case 'mine':\n $response->setPrivate();\n if (! $this->getUser())\n {\n $result = array('decklists' => array(), 'count' => 0);\n }\n else\n {\n $result = $this->by_author($this->getUser()->getId(), $start, $limit);\n }\n $pagetitle = \"My Decklists\";\n break;\n case 'find':\n $result = $this->find($start, $limit);\n $pagetitle = \"Decklist search results\";\n break;\n case 'popular':\n default:\n $result = $this->popular($start, $limit);\n $pagetitle = \"Popular Decklists\";\n break;\n }\n \n $decklists = $result['decklists'];\n $maxcount = $result['count'];\n $count = count($decklists);\n \n $dbh = $this->get('doctrine')->getConnection();\n $factions = $dbh->executeQuery(\n \"SELECT\n\t\t\t\tf.name\" . ($this->getRequest()\n ->getLocale() == \"en\" ? '' : '_' . $this->getRequest()\n ->getLocale()) . \" name,\n\t\t\t\tf.code\n\t\t\t\tfrom faction f\n\t\t\t\torder by f.side_id asc, f.name asc\")\n ->fetchAll();\n \n $packs = $dbh->executeQuery(\n \"SELECT\n\t\t\t\tp.name\" . ($this->getRequest()\n ->getLocale() == \"en\" ? '' : '_' . $this->getRequest()\n ->getLocale()) . \" name,\n\t\t\t\tp.code\n\t\t\t\tfrom pack p\n\t\t\t\twhere p.released is not null\n\t\t\t\torder by p.released desc\n\t\t\t\tlimit 0,5\")\n ->fetchAll();\n \n // pagination : calcul de nbpages // currpage // prevpage // nextpage\n // à partir de $start, $limit, $count, $maxcount, $page\n \n $currpage = $page;\n $prevpage = max(1, $currpage - 1);\n $nbpages = min(10, ceil($maxcount / $limit));\n $nextpage = min($nbpages, $currpage + 1);\n \n $route = $this->getRequest()->get('_route');\n \n $params = $this->getRequest()->query->all();\n $params['type'] = $type;\n $params['code'] = $code;\n \n $pages = array();\n for ($page = 1; $page <= $nbpages; $page ++) {\n $pages[] = array(\n \"numero\" => $page,\n \"url\" => $this->generateUrl($route, $params + array(\n \"page\" => $page\n )),\n \"current\" => $page == $currpage\n );\n }\n \n return $this->render('NetrunnerdbBuilderBundle:Decklist:decklists.html.twig',\n array(\n 'pagetitle' => $pagetitle,\n 'locales' => $this->renderView('NetrunnerdbCardsBundle:Default:langs.html.twig'),\n 'decklists' => $decklists,\n 'packs' => $packs,\n 'factions' => $factions,\n 'url' => $this->getRequest()\n ->getRequestUri(),\n 'route' => $route,\n 'pages' => $pages,\n 'prevurl' => $currpage == 1 ? null : $this->generateUrl($route, $params + array(\n \"page\" => $prevpage\n )),\n 'nexturl' => $currpage == $nbpages ? null : $this->generateUrl($route, $params + array(\n \"page\" => $nextpage\n ))\n ), $response);\n \n }", "public function show(types $types)\n {\n //\n }", "public function index()\n {\n return view('equipmentType.index', ['equipmentTypes' => EquipmentType::orderBy('name')->where('parent_id', null)->where('folder', 1)->get()]);\n }", "public function show(Companytype $companytype)\n {\n //\n }", "public function typeRequest()\n {\n $select = [ 'ams_type_request.id',\n 'ams_type_request.name',\n 'ams_type_request.created_at'];\n\n $prepare = ModelFactory::getInstance('TypeRequest');\n\n $prepare = $prepare->with([\n 'forms' => function($query){\n $query->select('*');\n }\n ]);\n\n $prepare->orderBy('order_number','asc')->get();\n\n // add search filter\n $searchFilter = FilterFactory::getInstance('Text','Search');\n $prepare = $searchFilter->addFilter($prepare,'search','search');\n $this->view->searchFilter = $searchFilter;\n\n $this->view->typerequests = $this->paginate($prepare);\n\n $this->view->title = 'Type of Request List';\n return $this->view('settings.request');\n }", "public function show(UnitTypes $unitTypes)\n {\n //\n }", "public function index()\n {\n $computerTypes = ComputerType::All();\n return view('catalogs.computerType.index',compact('computerTypes'));\n }", "public function index()\n {\n $specialization = Specialization::orderBy('id','desc')->get();\n $category = Category::orderBy('id','desc')->get();\n return view('Admin.Specialization.View', compact('specialization','category'));\n }", "public function index(Request $request, Category $category)\n {\n $specifications = $category->specifications()\n ->with(\"group\")\n ->orderBy(\"priority\")\n ->get();\n return view(\n \"category-product::admin.specifications.index\",\n compact(\"category\", \"specifications\")\n );\n }", "public function show(specimen_results $specimen_results)\n {\n //\n }", "public function index()\n {\n $card_types = CardType::orderBy('id')->paginate(10);\n return view('admin.card_types.index', compact('card_types'));\n }", "public function index()\n {\n $jobTypes = $this->jobTypeRepository->getAll(self::PER_PAGE);\n\n return view('admin.job_types.index', compact('jobTypes'));\n }", "public function list() {\n foreach ($this->instance->registered_post_types as $key => $registered_post_type) {\n WP_CLI::line($registered_post_type->get_post_type());\n }\n }", "public function index()\n\t{\n\t\t$cardTypes = $this->cardTypeRepository->all();\n\n\t\treturn $this->sendResponse($cardTypes->toArray(), \"CardTypes retrieved successfully\");\n\t}", "public function show(ProductType $productType)\n {\n //\n }", "public function show(ProductType $productType)\n {\n //\n }", "public function show(ProductType $productType)\n {\n //\n }", "public function show($id)\n {\n $specificationType = $this->specificationTypeRepository->find($id);\n\n if (empty($specificationType)) {\n Flash::error('Specification Type not found');\n\n return redirect(route('specificationTypes.index'));\n }\n\n return view('specification_types.show')->with('specificationType', $specificationType);\n }", "public function specializations(){\n\n $specializations = Specialization::all();\n \n return response()->json([\n 'success' => true,\n 'results' => $specializations\n ]);\n }", "public function show(CompanyType $companyType)\n {\n //\n }", "public function indexAction()\n {\n //Add toolbar button\n $this->_toolbar->addNewButton();\n $this->_toolbar->addDeleteButton();\n\n //Add filter\n $this->addFilter('filter_order', 'menu_type_id', 'string');\n $this->addFilter('filter_order_dir', 'ASC', 'string');\n\n //Get all filter\n $this->getFilter();\n\n $conditions = [];\n\n $conditions[] = 'menu_type_id > 0';\n\n //Get all item\n $items = MenuTypes::find([\n 'conditions' => implode(' AND ', $conditions),\n 'order' => $this->_filter['filter_order'] . ' ' . $this->_filter['filter_order_dir'],\n ]);\n\n //Create pagination\n $this->view->setVar('_page', ZPagination::getPaginationModel($items, $this->config->pagination->limit, $this->request->getQuery('page', 'int', 1)));\n\n //Set search value\n $this->view->setVar('_filter', $this->_filter);\n\n //Set column name, value\n $this->view->setVar('_pageLayout', [\n [\n 'type' => 'check_all',\n 'column' => 'menu_type_id'\n ],\n [\n 'type' => 'index',\n 'title' => '#'\n ],\n [\n 'type' => 'link',\n 'title' => 'm_menu_form_menu_type_name',\n 'sort' => true,\n 'column' => 'name',\n 'link' => '/admin/menu/index/edit/',\n 'access' => $this->acl->isAllowed('menu|index|edit')\n ],\n [\n 'type' => 'date',\n 'title' => 'gb_created_at',\n 'sort' => true,\n 'column' => 'created_at'\n ],\n [\n 'type' => 'date',\n 'title' => 'gb_updated_at',\n 'sort' => true,\n 'column' => 'updated_at'\n ],\n [\n 'type' => 'id',\n 'title' => 'gb_id',\n 'column' => 'menu_type_id'\n ]\n ]);\n }", "public function index()\n {\n //$shiptypes = $this->shiptype->all();\n\n return $this->view('admin::shiptypes.index');\n }", "public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n $this->view['jobtypes'] = $em->getRepository('AdminBundle:JMP\\JobType')->findAll();\n return $this->_render('AdminBundle:JMP:JobType\\index.html.twig');\n }", "public function index()\n {\n return ProductType::all();\n }", "public function show(DeviceType $deviceType)\n {\n //\n }", "public function index()\n {\n //\n $types = Program::all();\n return view('studentType.index', compact('types'));\n }", "public function index()\n {\n $viewData = CancerType::view();\n return view('cancer_type.list', $viewData);\n }", "public function show(PackageType $packageType)\n {\n //\n }", "public function index()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('created_at', 'desc')->Where('active', 1)->paginate(100);\n\n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }", "public function index()\n {\n $cat = r_product_type::with('rProductType')->get();\n return view('pages.products.table-product-category',compact('cat'));\n }", "public function typeAction($type)\n {\n $em = $this->getDoctrine()->getManager(); \n $entities = $em->getRepository('ApplisunCompteBundle:Compte')->findBy(array('user' => $this->getUser(), 'type' => $type));\n \n return $this->render('ApplisunCompteBundle:Compte:index.html.twig', array(\n 'comptesCourant' => $entities,\n ));\n }", "public function show(Salarytype $salarytype)\n {\n //\n }", "public function index()\n {\n $productTypes = ProductType::all();\n $producers = Producer::all();\n $categories = Category::where('id', '!=', 1)->get();\n\n return View('backoffice.pages.edit_product_types', ['productTypes' => $productTypes, 'producers' => $producers, 'categories' => $categories]);\n }", "public function index()\n {\n //\n\t\t$types = Type::orderby('id', 'desc')->paginate(12);\n\t\treturn view('admin.type', ['types' => $types]);\n }", "public function index()\n {\n $producttype = ProductType::paginate(5);\n return view('product_type.index', compact('producttype'));\n }", "public function index()\n {\n return $this->showAll(RequestType::all());\n }", "public function index()\n {\n $item_types = Item_Type::all();\n return view('admin_panel.item_types.index',compact('item_types'));\n }", "public function index()\n {\n $usertypes = Usertype::paginate(5);\n \n return view('usertypes.index', compact('usertypes'));\n }", "public function index()\n {\n $types = Type::all();\n\n return view('admin.type.index', [\n 'types' => $types\n ]);\n }", "public function actionIndex() {\n //$data['type'] = ProductType::model()->findAll(\"\");\n $this->render('index');\n }", "public function index()\n {\n $this->repository->pushCriteria(app('Prettus\\Repository\\Criteria\\RequestCriteria'));\n $planSubTypes = $this->repository->all();\n\n if (request()->wantsJson()) {\n\n return response()->json([\n 'data' => $planSubTypes,\n ]);\n }\n\n return view('planSubTypes.index', compact('planSubTypes'));\n }", "public function liste()\n {\n $discs = $this->LoadModel('Disc');\n $discDetail = $discs->info_record();\n $this->render('liste', [\n 'discs' => $discDetail\n ]);\n }", "public function actionIndex()\n {\n return $this->render('grid', ['model' => new ListOrgKind()]);\n }", "public function mostrarEspecie()\n {\n $especies = Especie::all();\n return View::make('especies.lista', array('especies' => $especies));\n }", "public function index()\n {\n $roomTypes = $this->roomType->getRoomTypes();\n return view('admin.room_types.list_room_type', ['roomTypes'=>$roomTypes]);\n }", "public function index()\n {\n // $types = Type::get();\n $types = Type::select('id', 'name', 'sort')->get();\n\n // return response([\n // 'data' => $types,\n // ], Response::HTTP_OK);\n return new TypeCollection($types);\n }", "public function index(Request $request)\n {\n $this->typeRepository->pushCriteria(new RequestCriteria($request));\n $types = $this->typeRepository->all();\n\n return view('backend.types.index')\n ->with('types', $types);\n }", "public function index()\n { \n $types = Type::paginate(8);\n return view('admin.type', compact('types'));\n }", "public function show($id)\n {\n $specification=Specification::find($id);\n return view('specifications.show')->with('spec',$specification);\n }", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n $deviceTypes = DeviceType::all();\n return view('devices.types.index', compact('deviceTypes'));\n }", "public function get_articaltypeslist(){\n \n \t\t$sql16=\"SELECT * FROM artical_types\";\n\t $result16 = mysqli_query($this->db,$sql16);\n\t while($articaltypeslist_data = mysqli_fetch_array($result16)){\n \n echo ' <tr>\n <td>'.$articaltypeslist_data[\"id\"].'</td>\n <td>'.$articaltypeslist_data[\"artical_type\"].'</td>\n <td class=\"text-center\">\n <a href=\"about_articletype.php?articletypeslist_id='.$articaltypeslist_data['id'] .'\" title=\"Edit\"><i class=\"fa fa-edit\"></i></a>\n </td>\n <td class=\"text-center\">\n <a href=\"delete.php?articletype_id='.$articaltypeslist_data['id'].'\" name=\"Delete\" title=\"Delete\"><i class=\"fa fa-trash-o\"></i></a>\n </td>\n </tr>';\n }\n return true;\n }", "public function getTypesList() {\n \t//maybe someday sorts them by course, student progress?\n \t$course_id = Auth::user()->course_id;\n Debugbar::info($course_id);\n $course = Course::find($course_id);\n Debugbar::info($course);\n $typesList = $course->questions;\n Debugbar::info($typesList);\n \treturn $typesList;\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $dictTypes = $em->getRepository('AppBundle:DictType')->findAll();\n\n return $this->render('dicttype/index.html.twig', array(\n 'dictTypes' => $dictTypes,\n ));\n }", "public function index()\n {\n $type = ProductType::all();\n return view('admincp.loaisanpham.list', ['type'=>$type]);\n }", "public function index()\n {\n $report_types = ReportType::all();\n\n return view('admin.report-type.index')->with('report_types', $report_types);\n }", "public function index() {\n\t\t\t$this->data[\"content\"] = $this->mongo_db->order_by(array(\"_id\"))->get(\"content_types\");\n\t\t\t$this->returndata();\n\t\t}", "public function show(EmpType $empType)\n {\n //\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('AppBundle:Cardtype')->findAll();\n\n return array(\n 'entities' => $entities,\n );\n }", "public function index()\n {\n $all_type = type_books::all();\n return view('admin.theloaisach.all-type-book', compact('all_type'));\n }" ]
[ "0.6765748", "0.6698905", "0.6547096", "0.6336483", "0.6201059", "0.61452466", "0.6143353", "0.60474277", "0.5985045", "0.58537257", "0.5822156", "0.57925844", "0.5783664", "0.5768481", "0.5750227", "0.5664008", "0.5661484", "0.56545395", "0.5644269", "0.5644269", "0.5644269", "0.5619624", "0.5604975", "0.5603286", "0.5599506", "0.5579179", "0.55775917", "0.5564503", "0.5562625", "0.5557126", "0.55428016", "0.5541226", "0.55375296", "0.5523216", "0.55151594", "0.55120957", "0.55115867", "0.55074966", "0.5480804", "0.54704165", "0.54700166", "0.5466009", "0.5461497", "0.5453647", "0.5452174", "0.54457927", "0.5433541", "0.5431855", "0.54299235", "0.5424233", "0.5423019", "0.541834", "0.54123604", "0.5396826", "0.5393305", "0.5393305", "0.5393305", "0.53843397", "0.5381708", "0.5366862", "0.536168", "0.5352381", "0.5348542", "0.53458464", "0.5344505", "0.5338681", "0.53304166", "0.5327758", "0.5327201", "0.5326816", "0.53215945", "0.5320916", "0.5319628", "0.53097653", "0.53065157", "0.52992564", "0.5298079", "0.52890366", "0.5289004", "0.5285437", "0.52743584", "0.52554214", "0.5253053", "0.5243636", "0.52406377", "0.5239093", "0.5233792", "0.52333355", "0.5223279", "0.52210814", "0.522047", "0.5215587", "0.5212998", "0.5205953", "0.5201281", "0.5193922", "0.5189338", "0.5188024", "0.51789796", "0.5178569" ]
0.61868995
5
Show the form for creating a new Specification_type.
public function create() { $specification = Specification::all(); return view('specification_types.create')->with(compact('specification')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store(CreateSpecification_typeRequest $request)\n {\n $input = $request->all();\n\n $specificationType = $this->specificationTypeRepository->create($input);\n\n Flash::success('Specification Type saved successfully.');\n\n return redirect(route('specificationTypes.index'));\n }", "public function create()\n {\n return view('specifications.create');\n }", "public function create()\n {\n return view('specifications.create');\n }", "public function newAction() {\n\n $entity = $this->get('admin.helper.ClothingType')->createNew();\n $form = $this->createForm(new ClothingTypes('add',$entity), $entity);\n return $this->render('LoveThatFitAdminBundle:ClothingType:new.html.twig', array(\n 'form' => $form->createView()));\n }", "public function create()\n\t{\n\t\treturn View::make('scaffolds.product_types.create');\n\t}", "public function create()\n {\n //\n return view('layouts.unit_types.form', ['type' => 'create']);\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('product_type.create');\n }", "public function create()\n {\n return view('admin.product_type.create');\n }", "public function create()\n {\n return view('catalogs.computerType.create');\n }", "public function create()\n {\n return view('admin.product_types.create');\n }", "public function create()\n {\n $model = new Type_cars();\n return view('modules.type.form', compact('model'));\n }", "public function create()\n {\n\n $jets = Jet::get();\n\n\n return view('admin.cabinSpecifications.form', [\n 'jets' => $jets\n ]);\n\n }", "public function create($type_id)\n {\n\n return view('admin.brands.types.models.create',compact('type_id'));\n }", "public function create()\n {\n return View::make('product_types.create');\n }", "public function create()\n {\n if (!checkRole(getUserGrade(1)))\n {\n prepareBlockUserMessage();\n return back();\n }\n\n $data['title'] = 'Create Industry Type';\n $data['active_class'] = 'industry_type';\n \n\n $data['subscribers'] = Subscriber::getSubscriberOptions();\n \n return view('admin.industry_type.create', $data);\n }", "public function create()\n {\n return view('admin.formtype.create', [\n 'form_type' => new FormType,\n 'colors' => Setting::colors()\n ]);\n }", "public function newAction()\n {\n $typeSeance = new TypeSeance();\n\n $form = $this->createCreateForm($typeSeance);\n\n $pages = array();\n $pages['Types de Séance '] = \"movibe_backend_typeSeance\";\n $pages['Creation'] = \"\";\n $this->breadcrumb($pages);\n\n return $this->render('MovibeBackendBundle:TypeSeance:new.html.twig', array(\n 'typeSeance' => $typeSeance,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('masters.companytypes.create');\n }", "public function create()\n {\n return view('admin.pages.company-type.create');\n }", "public function createType()\n {\n\n return view('expense.type.create', compact(''));\n }", "public function newAction()\n {\n/* \t$numfields = $this->getDoctrine()\n \t->getRepository('HegesAppConfigBundle:Configlinetype')\n \t->find($fieldsnumber);\n */\n \t\n \t\n $entity = new Configline();\n $form = $this->createForm(new ConfiglineType(), $entity);\n\n return $this->render('HegesAppConfigFileBundle:Configline:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView()\n ));\n }", "public function create()\n {\n return view('backend.types.create');\n }", "public function create()\n {\n return view('admin.type.create');\n }", "protected function form()\n {\n $form = new Form(new SpecificationTemplate());\n\n $form->text('name', __('Name'));\n $form->keyValues('content', __('Content'));\n $form->number('sort', __('Sort'))->default(0);\n $form->switch('is_display', __('Is display'))->default(1);\n\n return $form;\n }", "public function create()\n {\n return view('admin.portftype.addportfoliotype');\n }", "public function create()\n {\n return view('admin/type/create');\n }", "public function create()\n {\n return view('admin.job-type.create');\n }", "public function create()\n {\n return view('admin.job_types.create');\n }", "public function create()\n {\n return view('manage.project-type.create');\n }", "public function create()\n {\n return view('admin.master.expense_type.add');\n }", "public function create()\n {\n return view('beer.type.create');\n }", "public function create()\n {\n //\n return view('admin.complainttype.create');\n }", "public function newAction()\n {\n //Add Resource\n $this->_addResource();\n\n //Add toolbar button\n $this->_toolbar->addSaveButton();\n $this->_toolbar->addCancelButton('index');\n\n $menu_items = MenuItems::find();\n $form = new MenuTypeForm();\n\n if ($this->request->isPost()) {\n $menuType = new MenuTypes();\n if ($form->isValid($_POST, $menuType)) {\n $this->saveMenuDetails($menuType);\n } else {\n $this->flashSession->error('gb_please_check_required_filed');\n }\n }\n\n $this->view->setVar('form', $form);\n $this->view->setVar('menu_items', $menu_items);\n }", "public function create()\n {\n return view('admin.report-type.add');\n }", "public function create()\n {\n return view('salery_types.create');\n }", "public function create()\n {\n $types = TypeComplaint::all(); //Get all types\n\n return view('complaints.create', compact('types'));\n }", "public function actionCreate()\n {\n $model = new GiftcodeType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }", "public function create()\n {\n $title = \"Create New type for the Items\";\n return view('admin.types.create', compact('title'));\n }", "public function create()\n {\n return $this->view('admin::shiptypes.create');\n }", "public function newAction()\n {\n \t$em \t\t= $this->getDoctrine()->getEntityManager();\n \t$entity \t= new Corporation();\n $form \t= $this->createForm(new CorporationType($em, $this->container), $entity, array('show_legend' => false));\n \n $category = $this->container->get('request')->query->get('category');\n $NoLayout = $this->container->get('request')->query->get('NoLayout');\n if(!$NoLayout)\t$template = \"new.html.twig\"; else \t$template = \"new.html.twig\"; \n \n if($category)\n \t$entity->setCategory($category); \n\n return $this->render(\"PiAppGedmoBundle:Corporation:$template\", array(\n 'entity' \t=> $entity,\n 'form' \t=> $form->createView(),\n 'NoLayout' => $NoLayout,\n 'category'\t=> $category,\n ));\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('types.create');\n }", "public function create()\n {\n return view('admin.truck.type.create');\n }", "public function create()\n {\n return view('admin.typeField.create');\n }", "public function create()\n {\n return view('usertypes.create');\n }", "public function create()\n {\n return view('unit_type.create');\n }", "public function create()\n {\n $formData = CancerType::create();\n return view('cancer_type.add', $formData);\n }", "public function create()\n {\n $types = Type::all();\n return view('admin.addtype');\n }", "public function create()\n {\n return view('admin::appraisal.types.create');\n }", "public function create()\n {\n return view('admin.theloaisach.add-type-book');\n }", "public function permit_type_add_form()\n {\n $this->load->view('common/header');\n $this->load->view('permit/permittype/create_form');\n $this->load->view('common/footer');\n }", "public function create()\n {\n return view('request.type.create');\n }", "public function newAction()\n {\n $entity = new StudyQuestions();\n $form = $this->createForm(new StudyQuestionsType(), $entity);\n\n return $this->render('CompeteComBundle:StudyQuestions:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n //\n return view('studentType.create');\n }", "public function create()\n {\n return view('payType.create', ['types' => Type::all()]);\n }", "public function create()\n {\n return view('Type.create');\n }", "public function create()\n {\n return view(\"teacher.pages.exam-types.create\");\n }", "public function create()\n {\n $specheads = SpecificationHeader::all();\n $attributes = Attribute::all();\n // $selectedSpec = User::first()->role_id;\n return view('admin.product.create',compact('specheads', 'attributes'));\n }", "public function create()\n {\n return view('admin.package_types.create');\n }", "public function create()\n {\n if (! Gate::allows('jobtype_create')) {\n return abort(401);\n }\n return view('jobtypes.create');\n }", "public function create()\n\t{\n\t\treturn view('admin.awardtypes.create');\n\t}", "public function actionCreate()\n {\n $model = new ListOrgKind();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $model->generateDefaults(Yii::$app->request->get());\n return $this->render('form', ['model' => $model]);\n }\n }", "public function create()\n {\n $vehicle_types = VehicleType::all();\n return view('admin.card_types.create', compact('vehicle_types'));\n }", "public function create(CreateIncomeTypeRequest $request)\n {\n return view('backend.configuration.incomeType.create');\n }", "public function getCreate()\n {\n\n // Title\n $title = Lang::get('admin/types/title.create_a_new_type');\n\n // Show the page\n return View::make('admin/types/create', compact('title'));\n }", "public function create()\n {\n $data=$this->getFormData();\n list($specialty, $niv) = $data;\n return view('pages.classe.create',compact('specialty','niv'));\n }", "public function create()\n {\n if (! Gate::allows('operation_type_create')) {\n return abort(401);\n }\n return view('admin.operation_types.create');\n }", "public function create()\n {\n return view('admin_panel.item_types.create');\n }", "public function create()\n {\n return view('service_type.create');\n }", "public function actionCreate()\n {\n $model = new ListRegionType();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n $getParams = Yii::$app->getRequest()->get();\n $model->generateDefaults($getParams);\n return $this->render('form', ['model' => $model]);\n }\n }", "public function newFormAction()\n {\n $entity = new BaseEntity();\n $form = $this->createForm(BaseType::class, $entity);\n\n return $this->render('backOffice/area/new.html.twig', array(\n 'form' => $form->createView(),\n ));\n }", "public function create() {\n return view('admin.specs.specsCreate');\n }", "public function newAction()\n {\n $entity = new ObjectType();\n $form = $this->createCreateForm($entity);\n\n return $this->render('BrainstrapBundlesFrontBundle:Object/ObjectType:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n //\n return view('admin.nom.prefcontrtypes.create');\n }", "public function create()\n {\n return view('admin.typeQuestion.create');\n }", "public function create()\n {\n $allTypes = $this->economicalActivityTypeRepository->getAllForDropdown();\n return view('economical_activity_types.create')\n ->with('allTypes', $allTypes);\n }", "public function create()\n {\n return view('classifications.create');\n }", "public function create()\n {\n // ตรวจสอบ permission\n ChkPerm('st-vehicle-type-create', 'setting/st-vehicle-type');\n\n return view('setting.st-vehicle-type.create');\n }", "public function actionCreate()\r\n {\r\n $model = new Attributes();\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 $typeFields = ArrayHelper::map(TypeFields::find()->asArray()->orderBy('name')->all(), 'id', 'name');\r\n\r\n return $this->render('create', [\r\n 'model' => $model,\r\n 'typeFields' => $typeFields\r\n ]);\r\n }\r\n }", "public function create()\n {\n return view('devices.types.create');\n }", "public function create(Specialization $specialization)\n {\n $category = Category::orderBy('id','desc')->get();\n return view('Admin.Specialization.Create', compact('specialization','category'));\n }", "public function create()\n {\n $productTypes = ProductType::all();\n return view('admin.product.create', compact('productTypes'));\n }", "public function create()\n {\n $types = Core_custom_field_type::select('ID','name')->get();\n\n\n return view('common::backend.customfield.create' , compact('types'));\n }", "public function create($type){\n $this->setFormType($type);\n $this->setActionMethod($type);\n }", "public function create()\n {\n return view('outcome-type.create');\n }", "public function create()\n {\n //\n return view('type');\n }", "public function newAction()\n {\n $entity = new Cardtype();\n $form = $this->createCreateForm($entity);\n\n return array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view('product.create', ['productTypes' => ProductType::all()]);\n }", "public function createAction()\n {\n $em \t\t= $this->getDoctrine()->getEntityManager();\n $locale\t\t= $this->container->get('session')->getLocale();\n \n $category = $this->container->get('request')->query->get('category');\n $NoLayout = $this->container->get('request')->query->get('NoLayout');\n if(!$NoLayout)\t$template = \"new.html.twig\"; else \t$template = \"new.html.twig\"; \n \n $entity \t= new Corporation();\n $request \t= $this->getRequest();\n $form \t= $this->createForm(new CorporationType($em, $this->container), $entity, array('show_legend' => false));\n $form->bindRequest($request);\n\n if ($form->isValid()) {\n $entity->setTranslatableLocale($locale);\n $em->persist($entity);\n $em->flush();\n\n return $this->redirect($this->generateUrl('admin_gedmo_corporation_show', array('id' => $entity->getId(), 'NoLayout' => $NoLayout, 'category' => $category)));\n \n }\n\n return $this->render(\"PiAppGedmoBundle:Corporation:$template\", array(\n 'entity' \t=> $entity,\n 'form' \t=> $form->createView(),\n 'NoLayout' => $NoLayout,\n 'category'\t=> $category,\n ));\n }", "private function createCreateForm(Cardtype $entity)\n {\n $form = $this->createForm(new CardtypeType(), $entity, array(\n 'action' => $this->generateUrl('cardtype_create'),\n 'method' => 'POST',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Create'));\n\n return $form;\n }", "public function create()\n {\n return view('industry.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('admin.room_types.add_room_type');\n }", "public function create()\n {\n return view('Samples.create', [\n 'create' => new FormBuilder(\n [\n 'title'=>'text',\n 'slug'=>'text',\n 'type_id'=>'hidden',\n 'id'=>'hidden' \n ],\n ['samples.store'],\n 'POST',\n 'Create'\n ) \n ]);\n }", "public function create()\n {\n $types = type::all();\n return view('dashboard.matrail.create', compact('types'));\n //\n }", "public function newAction() {\n $entity = new DetailsProduits();\n $form = $this->createCreateForm($entity);\n\n return $this->render('VentesBundle:DetailsProduits:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('tournamenttypes.create');\n\t}" ]
[ "0.6891645", "0.6832236", "0.6832236", "0.67393976", "0.6649213", "0.6638073", "0.6626142", "0.6617111", "0.6614032", "0.6567561", "0.6533818", "0.65306485", "0.65222585", "0.65126884", "0.65025246", "0.6494007", "0.6493881", "0.6490555", "0.64793557", "0.64711577", "0.64697886", "0.6439236", "0.64380276", "0.6422312", "0.641536", "0.6414314", "0.64127094", "0.640603", "0.63904846", "0.6388555", "0.6379027", "0.63632476", "0.63605225", "0.63589334", "0.63544583", "0.63396496", "0.63352466", "0.63324946", "0.63247395", "0.63201797", "0.63015115", "0.6300908", "0.6300908", "0.6300908", "0.6300908", "0.6271829", "0.6255151", "0.62523353", "0.62473136", "0.6244783", "0.62383425", "0.62341064", "0.6222003", "0.62196547", "0.621856", "0.6211787", "0.6209227", "0.62077004", "0.6207165", "0.62068516", "0.61887926", "0.6177606", "0.6177192", "0.6152579", "0.61492616", "0.61447793", "0.61433357", "0.6138971", "0.6134114", "0.61289936", "0.6128142", "0.6121334", "0.6120488", "0.61079323", "0.610433", "0.60790414", "0.60725", "0.60683", "0.6067439", "0.6056691", "0.6033749", "0.6031576", "0.60301495", "0.6026965", "0.60264677", "0.60210586", "0.60148585", "0.60096836", "0.6004981", "0.6002085", "0.60008013", "0.5994869", "0.59918934", "0.5990007", "0.5983788", "0.59821606", "0.5977444", "0.59734386", "0.59708583", "0.5969084" ]
0.78522754
0
Store a newly created Specification_type in storage.
public function store(CreateSpecification_typeRequest $request) { $input = $request->all(); $specificationType = $this->specificationTypeRepository->create($input); Flash::success('Specification Type saved successfully.'); return redirect(route('specificationTypes.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function saveType()\n {\n }", "public function save(Type $type) {\n $typeData = array(\n 'name_ET' => $type->getName()\n );\n\n if ($type->getNum()) {\n // The type has already been saved : update it\n $this->getDb()->update('eventtype', $typeData, array('num_ET' => $type->getNum()));\n } else {\n // The type has never been saved : insert it\n $this->getDb()->insert('eventtype', $typeData);\n // Get the id of the newly created type and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $type->setNum($id);\n }\n }", "public function run()\n {\n $arr = array(\n 'units',\n 'value',\n 'tolerance',\n 'method'\n );\n $type= array();\n\n foreach ($arr as $key) {\n $now = Carbon::now();\n $type[] = [\n 'name' => $key,\n 'updated_at' => $now,\n 'created_at' => $now,\n ];\n }\n SpecificationType::insert($type);\n }", "public function store(Request $request)\n {\n $this->validate($request,[\n 'title'=>'max:189|required',\n 'project_type'=>'max:189|required',\n 'existing_desc'=>'max:189|required',\n 'requirement_spec'=>'max:189|required',\n 'hardware_env'=>'max:189|required',\n 'software_env'=>'max:189|required',\n 'provisional_planning'=>'max:500|required'\n ]);\n\n $specification=new Specification();\n $specification->title=$request->input('title');\n $specification->project_type=$request->input('project_type');\n $specification->existing_desc=$request->input('existing_desc');\n $specification->requirement_spec=$request->input('requirement_spec');\n $specification->hardware_env=$request->input('hardware_env');\n $specification->software_env=$request->input('software_env');\n $specification->provisional_planning=$request->input('provisional_planning');\n $specification->created_by=auth()->user()->id;\n if($specification->save())\n return redirect('/specifications')->with('success','specification created');\n }", "public function store(AuditTypeRequest $request)\n\t{\n\t\t$auditType = new AuditType;\n $auditType->name = $request->name;\n $auditType->description = $request->description;\n $auditType->user_id = Auth::user()->id;\n\t}", "public function save(\n\t $type = 'SYSTEM'\n\t )\n\t{\n\t}", "public function storeSpecification($storeData, $presetId)\n { \n if (!__isEmpty($storeData)) { \n $specificationPresetItem = [];\n foreach ($storeData as $key => $input) {\n \n $specification = new Specification;\n $specificationStoreData = [\n 'label',\n 'use_for_filter',\n 'status'\n ];\n\n if ($specification->assignInputsAndSave($input, $specificationStoreData)) {\n $specificationPresetItem[] = [\n 'specification_presets__id' => $presetId,\n 'specifications__id' => $specification->_id\n ];\n }\n }\n\n $newSpecificationPresetItem = new SpecificationPresetItem;\n if ($newSpecificationPresetItem->prepareAndInsert($specificationPresetItem, '_id')) {\n return true;\n }\n }\n \n return false; \n }", "public function store(Request $request)\n {\n\n $this->validate(request(), [\n 'name' => 'required|string',\n 'type' => 'required|string',\n 'jsonOptions' => 'json'\n ]);\n\n $validator = new JSONValidate;\n\n $json = json_decode(request('jsonOptions'));\n //Check each option for valid format\n\n foreach($json as $obj) {\n $validator->validate(\n $obj,\n (object)[\n \"type\"=>\"object\",\n \"properties\"=>(object)[\n \"label\"=>(object)[\n \"type\"=>\"string\",\n \"required\"=>true\n ],\n \"value\"=>(object)[\n \"type\"=>\"string\",\n \"required\"=>true\n ],\n ]\n ],\n Constraint::CHECK_MODE_NORMAL\n ); //validates, and sets defaults for missing properties\n }\n\n\n if ($validator->isValid()) {\n $spec = new Specification();\n $spec->name = request('name');\n $spec->slug = $this->createSlug(request('name'));\n $spec->type = request('type');\n $spec->options = request('jsonOptions');\n $spec->save();\n \\Session::flash('flash_created',request('name') . ' has been created');\n return redirect('/admin/specifications');\n } else {\n return redirect('/admin/specifications/create')->withErrors(\"Error, Invalid Options\");\n }\n\n\n }", "public function store(IntentTypeRequest $request) {\n $type = $this->service()->repo()->create($request->all());\n return $this->created($type);\n }", "public function store()\n {\n $this->validate(request(), [\n 'code' => ['required', 'unique:attributes,code,NULL,NULL,entity_type,' . request('entity_type'), new Code],\n 'name' => 'required',\n 'type' => 'required',\n ]);\n\n Event::dispatch('settings.attribute.create.before');\n\n request()->request->add(['quick_add' => 1]);\n\n $attribute = $this->attributeRepository->create(request()->all());\n\n Event::dispatch('settings.attribute.create.after', $attribute);\n\n session()->flash('success', trans('admin::app.settings.attributes.create-success'));\n\n return redirect()->route('admin.settings.attributes.index');\n }", "public function create()\n {\n $specification = Specification::all();\n return view('specification_types.create')->with(compact('specification'));\n }", "function timetracking_type_save(timetrackingType $type) {\n $type->save();\n}", "public function store()\n {\n $this->validate(request(), [\n 'name' => 'required|unique:lead_types,name',\n ]);\n\n Event::dispatch('settings.type.create.before');\n\n $type = $this->typeRepository->create(request()->all());\n\n Event::dispatch('settings.type.create.after', $type);\n\n return response([\n 'data' => new TypeResource($type),\n 'message' => __('admin::app.settings.types.create-success'),\n ]);\n }", "public function store(TypeRequest $request)\n {\n $type = Type::create($request->all());\n\n return $this->showOne($type, 'type creado correctamente');\n }", "public function store(StorageTypeRequest $request)\n {\n try {\n $this->service->addStorageType($request);\n return $this->Created('Successfully added new storage type');\n } catch (\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch (Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function store(TypeStoreRequest $request)\n {\n types::create([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n ]);\n return redirect()->route('types.index')->with('message','Type Added Successfully');\n }", "public function store(Request $request, Type $type)\n {\n $request = $request->all()['PropertyTypes'];\n \n if($type->create($request))\n {\n return response()->json(['success'=>'Property type created successfuly']);\n }\n else\n {\n return response()->json(['error'=>'Property type creation failed']);\n }\n }", "public static function forge($type = 'db', $config = null)\n\t{\n\t\t// validate the type\n\t\tif (empty($type) or ! is_string($type))\n\t\t{\n\t\t\tthrow new \\RuntimeException('FOU-028: Specified storage type must be a string value');\n\t\t}\n\n\t\t// create and return the requested storage instance\n\t\treturn static::getDic()->resolve('storage.'.$type, array($config));\n\t}", "public function setStorageType($storageType) {\n\t\t\n\t\t$this->_storageType = $storageType;\n\t}", "function store()\r\n {\r\n $db =& eZDB::globalDatabase();\r\n $db->begin();\r\n\r\n $ret = false;\r\n $name = $db->escapeString( $this->Name );\r\n $description = $db->escapeString( $this->Description );\r\n if ( !isSet( $this->ID ) )\r\n {\r\n $db->lock( \"eZContact_CompanyType\" );\r\n\t\t\t$this->ID = $db->nextID( \"eZContact_CompanyType\", \"ID\" );\r\n $res[] = $db->query( \"INSERT INTO eZContact_CompanyType\r\n (ID, Name, Description, ImageID, ParentID)\r\n VALUES\r\n ('$this->ID',\r\n '$name',\r\n '$description',\r\n '$this->ImageID',\r\n '$this->ParentID')\" );\r\n $db->unlock();\r\n $ret = true;\r\n }\r\n else\r\n {\r\n $res[] = $db->query( \"UPDATE eZContact_CompanyType set Name='$name', Description='$description', ImageID='$this->ImageID', ParentID='$this->ParentID' WHERE ID='$this->ID'\" );\r\n\r\n $ret = true;\r\n }\r\n eZDB::finish( $res, $db );\r\n return $ret;\r\n }", "public function storageType();", "public function store(Request $request, Category $category)\n {\n $this->storeValidator($request->all());\n $exist = $request->get(\"exists\", false);\n if ($exist) {\n $specification = Specification::find($exist);\n }\n else {\n $specification = Specification::create($request->all());\n }\n \n $title = $request->get(\"title\", false);\n if (empty($title)) {\n $title = $specification->title;\n }\n /**\n * @var Specification $specification\n */\n $specification->categories()->attach($category, [\n \"title\" => $title,\n \"filter\" => $request->has(\"filter\") ? 1 : 0,\n \"priority\" => $request->get(\"priority\", 1),\n ]);\n\n event(new CategorySpecificationUpdate($category));\n\n return redirect()\n ->route(\"admin.categories.specifications.index\", [\"category\" => $category])\n ->with(\"success\", \"Характеристика добавлена\");\n }", "protected function store($mimetype) {\n\t\t$this->dbConnection->insertIfNotExist('*PREFIX*mimetypes', [\n\t\t\t'mimetype' => $mimetype\n\t\t]);\n\n\t\t$fetch = $this->dbConnection->getQueryBuilder();\n\t\t$fetch->select('id')\n\t\t\t->from('mimetypes')\n\t\t\t->where(\n\t\t\t\t$fetch->expr()->eq('mimetype', $fetch->createNamedParameter($mimetype)\n\t\t\t));\n\n\t\t$result = $fetch->execute();\n\t\t$row = $result->fetch();\n\t\t$result->closeCursor();\n\n\t\tif (!$row) {\n\t\t\tthrow new \\Exception(\"Failed to get mimetype id for $mimetype after trying to store it\");\n\t\t}\n\n\t\t$this->mimetypes[$row['id']] = $mimetype;\n\t\t$this->mimetypeIds[$mimetype] = $row['id'];\n\t\treturn $row['id'];\n\t}", "public function store(Request $request)\n {\n $rules = ['type_name' => 'required'];\n\n $messages = [\n 'type_name.required' => 'Type name is required!',\n ];\n\n $validator = Validator::make($request->all(), $rules, $messages);\n\n if ($validator->fails()) {\n \n return redirect()->back()->withErrors($validator)->withInput();\n \n }\n\n $report_type = new ReportType;\n\n $report_type->name = $request->type_name;\n $report_type->description = $request->description;\n\n $report_type->save();\n \n $request->session()->flash('success', 'Add Report type successful.');\n \n return redirect()->back()->withInput();\n }", "function variant_set_type($variant, $type) {}", "private static function registerSpecification(\n PropertySpecification $specification )\n {\n self::$specifications[$specification->getName()] = $specification;\n }", "public function storeType(Request $request)\n {\n $type = new ExpenseType();\n $type->name = $request->name;\n $type->save();\n Flash::success(trans('general.successfully_saved'));\n return redirect('expense/type/data');\n }", "public function store(StoreIncomeTypeRequest $request)\n {\n $this->incomeTypes->create($request->all());\n return redirect()->route('admin.configuration.incomeTypes.index')->withFlashSuccess(trans('alerts.backend.generals.created'));\n }", "public function store(Request $request)\n {\n $attributes = $request->all();\n $this->productTypeService->add($attributes);\n\n return redirect()->route('type.create')->with('status', 'Новый тип товаров добавлен!');\n }", "public function store(SpecializationRequest $request)\n {\n // $specialization = Specialization::create($request->all());\n // return back()->with('success', 'Name added successully!');\n\n $specialization = new App\\Models\\Specialization();\n $specialization->name = $request->specialization;\n $specialization->category_id = $request->category;\n $specialization->save();\n return back()->with('success', 'Name added successully!');\n }", "public function persist($type,$request)\n {\n \tcache()->flush();\n \treturn $this->create($this->factory($type)->attributes($request));\n \t\n }", "public function store(TypologyRequest $request) //108\n {\n $this->authorize('store.typologies');\n\n $typology=Typology::create($request->all());\n\n $typology->syncSupervisions($request->supervisions_list);\n\n alert()->success(trans('messages.success.store'));\n\n return redirect('typologies');\n }", "public function store(Request $request)\n {\n Validator::make($request->all(), [\n 'type' => 'required|unique:unit_types',\n\n ])->validate();\n\n UnitType::create([\n 'type' => $request->type,\n ]);\n\n return redirect()->route('unit_type.index')->with('success', 'Unit Type added!');\n }", "public function store(TypeRequest $request)\n {\n\n $createdType = $this->typeRepo->create($request->all());\n if ($createdType) {\n\n \\Session::flash('success', 'Apprasial order Type was successfully created!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n \n } else {\n\n \\Session::flash('error', 'Something was wrong!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n }\n }", "public function save()\n {\n if ($this->validate()) {\n $type = new Type();\n $type->name = $this->name;\n $type->description = $this->description;\n $type->sockets = $this->sockets;\n\n return $type->save();\n }\n return false;\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function save($persistenceIdentifier, array $formDefinition);", "protected function _afterSave(Mage_Core_Model_Abstract $type)\n {\n $attributeSet = $type->getAttributeSet();\n $attributeSetName = $type->getName() . ' {' . $type->getIdentifier() .'}';\n\n if($attributeSet->getAttributeSetName() != $attributeSetName){\n $attributeSet->setAttributeSetName($attributeSetName);\n $attributeSet->save();\n }\n\n return parent::_afterSave($type);\n }", "public function store(Request $request, ClassType $classType)\n {\n //\n }", "public function store()\n {\n $data = request()->only(\"name\");\n\n try {\n $type = ObjectType::create($data);\n return $type;\n } catch (\\Exception $exception) {\n throw $exception;\n }\n }", "public function store() {\n //\n $car = new Car();\n $car->make = Input::get('make');\n $car->model = Input::get('model');\n $car->registration_num = Input::get('registration_num');\n $car->mileage = Input::get('mileage');\n $car->location_id = Input::get('location_id');\n $car->save();\n $car_type = $this->car->find($car->id);\n if (Input::has('type')) {\n foreach (Input::get('type') as $type => $val) {\n $car_type->type()->attach($val);\n }\n }\n return Redirect::route('admin.car.index');\n }", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "private function store()\n {\n $db = DataAccess::getInstance();\n switch ($this->type) {\n case self::BOOL:\n case self::SCALAR:\n case self::PICKABLE:\n $columns = \"value_scalar\";\n $values = \"?\";\n if ($this->isLeveled()) {\n $data = array($this->value['id']);\n } else {\n $data = array($this->value);\n }\n break;\n case self::RANGE:\n case self::DATE_RANGE:\n $columns = \"value_range_low, value_range_high\";\n $values = \"?,?\";\n $data = array($this->value['low'], $this->value['high']);\n break;\n default:\n //not a defined type\n return false;\n break;\n }\n $session = geoSession::getInstance()->initSession();\n $sql = \"REPLACE INTO \" . geoTables::browsing_filters . \" (session_id, target, category, $columns) VALUES ('$session','{$this->target}','\" . self::getActiveCategory() . \"', $values)\";\n $db->Execute($sql, $data);\n }", "public function store(StoreDataType $request)\n {\n try {\n $array = $request->sanitizedArray();\n $dataType = new DataType($array);\n $dataType->slug = Str::slug($dataType->name);\n \n // Save Relationships\n $object = $request->sanitizedObject();\n \n\n $dataType->saveOrFail();\n return $this->api->success()->message('Data Type Created')->payload($dataType)->send();\n } catch (\\Throwable $exception) {\n \\Log::error($exception);\n return $this->api->failed()->message($exception->getMessage())->payload([])->code(500)->send();\n }\n }", "public function store(Request $request)\n {\n $request->validate([\n 'type' => 'required|string|max:255|unique:card_types,type',\n ]);\n $input_prices = $request->except('_token', 'type');\n $card_type = CardType::create([\n 'type' => $request->type,\n ]);\n foreach(VehicleType::all() as $vehicle_type){\n Price::create([\n 'vehicle_type_id' => $vehicle_type->id,\n 'card_type_id' => $card_type->id,\n 'price' => $input_prices[$vehicle_type->id.'-price']*100,\n ]);\n }\n return redirect()->to(route('admin.card-types.index'))->with('success', 'Card type added successfully');\n }", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.59298974", "0.5857471", "0.5816396", "0.5762593", "0.5721604", "0.569306", "0.5689876", "0.565144", "0.56136304", "0.55326897", "0.55313015", "0.55204844", "0.54565305", "0.54481673", "0.5446711", "0.53715074", "0.5341286", "0.52945787", "0.5279172", "0.52786213", "0.52690476", "0.5237383", "0.5225318", "0.5219698", "0.52180755", "0.520332", "0.51951575", "0.5177545", "0.51755065", "0.5160272", "0.5154197", "0.51520836", "0.51299995", "0.51193565", "0.51175255", "0.51097864", "0.5109172", "0.5102772", "0.5088646", "0.5087725", "0.5086282", "0.5076647", "0.5076647", "0.5076647", "0.5075895", "0.50741416", "0.5066793", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899", "0.5045899" ]
0.70928854
0
Display the specified Specification_type.
public function show($id) { $specificationType = $this->specificationTypeRepository->find($id); if (empty($specificationType)) { Flash::error('Specification Type not found'); return redirect(route('specificationTypes.index')); } return view('specification_types.show')->with('specificationType', $specificationType); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Type $type)\n {\n //\n }", "public function show(Type $type)\n {\n //\n }", "public function show(Type $type)\n {\n //\n }", "public function showType($type = true)\n {\n $this->showType = $type;\n }", "function display($type, $quality) {\r\n return null; //PEAR::raiseError(\"No Display method exists\", true);\r\n }", "public function display_eligibility_type($type){\n\t\tif($type == 'PI'){\n\t\t\t$st = 'Profile Shortlisting';\n\t\t}else if($type == 'PS'){\t\n\t \t\t$st = 'Profile Sending';\n\t\t}else if($type == 'PC'){\n\t\t\t$st = 'Position Closing';\n\t\t}\n\t\treturn $st;\n\t}", "public function show(ComputerType $computerType)\n {\n //\n }", "public function show(Companytype $companytype)\n {\n //\n }", "public function show(Specialization $specialization)\n {\n //\n }", "public function show(PackageType $packageType)\n {\n //\n }", "public static function showProgramType($type)\n {\n \t// return program_type(string)\n \tswitch ($type) {\n \t\tcase '1':\n \t\t\treturn 'Тренировки и питание';\n \t\t\tbreak;\n \t\t\n \t\tcase '2':\n \t\t\treturn 'Только тренировки';\n \t\t\tbreak;\n\n \t\tcase '3':\n \t\t\treturn 'Только питание';\n \t\t\tbreak;\n \t\t\t\n \t\tdefault:\n \t\t\treturn 'Не определен';\n \t\t\tbreak;\n \t}\n }", "public function show(Salarytype $salarytype)\n {\n //\n }", "public function show(ProductType $productType)\n {\n //\n }", "public function show(ProductType $productType)\n {\n //\n }", "public function show(ProductType $productType)\n {\n //\n }", "public function displayType(): object\n {\n return $this->displayType;\n }", "public function show(CompanyType $companyType)\n {\n //\n }", "public function show(Type $type)\n {\n return $this->showOne($type);\n }", "public function show(Type $type)\n {\n return $this->showOne($type);\n }", "public function show(DeviceType $deviceType)\n {\n //\n }", "public function show(N_prefcontrtype $n_prefcontrtype)\n {\n //\n }", "public function show(PrizeType $prizeType)\n {\n //\n }", "public function displaytype()\n\t{\n\t\treturn $this->Players->displaytype($this->SqueezePlyrID);\n\t}", "public function show(EmpType $empType)\n {\n //\n }", "public function show(RunType $runType)\n {\n //\n }", "public function show(Type $type)\n {\n //\n return view('type', compact('type'));\n }", "public function show(Ctype $ctype)\n {\n //\n }", "public function show(type_of_user $type_of_user)\n {\n //\n }", "public function typeAction($type)\n {\n $em = $this->getDoctrine()->getManager(); \n $entities = $em->getRepository('ApplisunCompteBundle:Compte')->findBy(array('user' => $this->getUser(), 'type' => $type));\n \n return $this->render('ApplisunCompteBundle:Compte:index.html.twig', array(\n 'comptesCourant' => $entities,\n ));\n }", "function kato_policy_print_type(){\n\tif(function_exists('the_field')){\n\t\t$type = get_field('type');\n\t\t$field = get_field_object('type');\n\t\t$label = $field['choices'][ $type ];\n\t\tprint '<li class=\"meta-type type-' . $type . '\">';\n\t\tprint $label;\n\t\tprint '</li>';\n\t}\n}", "public function displayType(): string\n {\n return parent::DISPLAY_BLOCK;\n }", "private function getTypeDescription()\n {\n switch($this->_type)\n {\n case 'Mountain':\n return \"Mountains are peaceful places. Your ships don't do any damage here, while your tanks will do 10% less damage. Flying weapons (airplanes and helicopters) do normal damage.\" . PHP_EOL;\n case 'Water':\n return \"Water is what you drink. It's also the place where your tanks will be completely useless, but your ships will do 1000% more damage. o7\" . PHP_EOL;\n case 'Open land':\n return \"Who doesn't like the smell of grass in the morning, with a hint of blood from your enemy? Your tanks will do 1000% more damage here, while ships will do none. Good luck!\" . PHP_EOL;\n case 'Woods':\n return \"All you can do is hide, and sometimes it's the best option. Your tanks will do 40% less damage, your ships wont do any damage at all, your air vehicles will do 10% more, and your foot soldiers will do 30% more, so use them wisely. This is your chance, fella!\" . PHP_EOL;\n }\n }", "public function list_of($type)\n {\n }", "public function displaySpecsAction(Request $request) {\n $session = $request->getSession();\n $session->clear();\n $specs = $this->getSpecificationsDoctrine();\n return $this->render('MercedesVStoreBundle:Default:spec.html.twig', array(\"specification\" => $specs, \"activeMenuItem\" => \"spec\"));\n }", "public function show(ProductProductType $productProductType)\n {\n //\n }", "public function render($type=null, $quality=null);", "public function show(VideoType $video_type)\n {\n //\n }", "public function indexByTypeAction($type)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('StriideInventoryBundle:Item')->findByType($type);\n\n return $this->render('StriideInventoryBundle:Item:indexByType.html.twig', array(\n 'entities' => $entities,\n 'type' => $type\n ));\n }", "public function show(TypesConges $typesConges)\n {\n //\n }", "public function displayType(): string\n {\n return self::DISPLAY_INLINE;\n }", "public function display($type = 'jpg', $quality = 50) {\n\t\treturn $this->export($type, $quality, null);\n\t}", "public function show(ChartType $chart_type)\n {\n return $chart_type;\n }", "public function showCommand($type = NULL, $path = NULL) {\n\t\t$availableConfigurationTypes = $this->configurationManager->getAvailableConfigurationTypes();\n\t\tif (in_array($type, $availableConfigurationTypes)) {\n\t\t\t$configuration = $this->configurationManager->getConfiguration($type);\n\t\t\tif ($path !== NULL) {\n\t\t\t\t$configuration = \\TYPO3\\Flow\\Utility\\Arrays::getValueByPath($configuration, $path);\n\t\t\t}\n\t\t\t$typeAndPath = $type . ($path ? ': ' . $path : '');\n\t\t\tif ($configuration === NULL) {\n\t\t\t\t$this->outputLine('<b>Configuration \"%s\" was empty!</b>', array($typeAndPath));\n\t\t\t} else {\n\t\t\t\t$yaml = \\Symfony\\Component\\Yaml\\Yaml::dump($configuration, 99);\n\t\t\t\t$this->outputLine('<b>Configuration \"%s\":</b>', array($typeAndPath));\n\t\t\t\t$this->outputLine();\n\t\t\t\t$this->outputLine($yaml . chr(10));\n\t\t\t}\n\t\t} else {\n\t\t\tif ($type !== NULL) {\n\t\t\t\t$this->outputLine('<b>Configuration type \"%s\" was not found!</b>', array($type));\n\t\t\t}\n\t\t\t$this->outputLine('<b>Available configuration types:</b>');\n\t\t\tforeach ($availableConfigurationTypes as $availableConfigurationType) {\n\t\t\t\t$this->outputLine(' ' . $availableConfigurationType);\n\t\t\t}\n\t\t\t$this->outputLine();\n\t\t\t$this->outputLine('Hint: <b>%s configuration:show --type <configurationType></b>', array($this->getFlowInvocationString()));\n\t\t\t$this->outputLine(' shows the configuration of the specified type.');\n\t\t}\n\t}", "public function show(JIndustrySpecialization $jIndustrySpecialization)\n {\n //\n }", "public function actionProducttype() {\n $data['type'] = ProductType::model()->findAll(\"\");\n $this->render('producttype',$data);\n }", "public function geoCart_previewDisplay($sell_type = null)\n {\n return parent::geoCart_previewDisplay(2);\n }", "public function show(Type $type)\n {\n // return response([\n // 'data' => $type,\n // ], Response::HTTP_OK);\n return new TypeResource($type);\n }", "public function show(SpecSuggestions $specSuggestions)\n {\n //\n }", "public function show($id)\n {\n $specification=Specification::find($id);\n return view('specifications.show')->with('spec',$specification);\n }", "public function show($productType_id, $id)\n {\n //\n }", "public function show(UserType $userType)\n {\n //\n }", "public function show_header_selector($type = 'default')\n {\n }", "function entity_type_label_single($entity_type) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getToolboxHelper();\n\n return $helper->labelSingle();\n}", "public function show(specimen_results $specimen_results)\n {\n //\n }", "public function show(TypeThird $typeThird)\n {\n //\n }", "public function show(Type $type)\n {\n $title = \"Detail page of type {$type->name}\";\n return view('admin.types.view', compact('title', 'type'));\n }", "public function display($type='print_r') {\n\n\t\tif (!$this->_root) {\n\t\t\techo \"this tree is empty\" . \"\\n\";\n\t\t\treturn;\n\t\t}\n\n\t\tif ($type === 'pretty') {\n\t\t\t// TODO: some way to dynamically print\n\t\t} else {\n\t\t\t$printData = array(\n\t\t\t\t'count' => $this->_count,\n\t\t\t\t'BST' => $this->_root\n\t\t\t);\n\n\t\t\tprint_r($printData);\n\t\t}\n\t}", "public function show(types $types)\n {\n //\n }", "function printResult($jobId, $resultType) {\n $this->printDebugMessage('printResult', 'Begin', 1);\n echo \"<p>Result for job <a href=\\\"?jobId=$jobId\\\">$jobId</a>:</p>\\n\";\n $resultTypeObjs = $this->getResultTypes($jobId);\n foreach($resultTypeObjs as $resultTypeObj) {\n if($resultTypeObj->identifier == $resultType) {\n\t$selResultTypeObj = $resultTypeObj;\n }\n }\n // Plain text\n if($selResultTypeObj->mediaType == 'text/plain') {\n $resultStr = $this->getResult($jobId, $resultType);\n echo \"<p><pre>$resultStr</pre></p>\\n\";\n }\n // Image, embed using img tag using service REST API for document\n elseif(strpos($selResultTypeObj->mediaType, 'image') === 0 &&\n\t strpos($selResultTypeObj->mediaType, 'xml') == 0) {\n $resultUrl = 'http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/';\n $resultUrl .= $jobId . '/' . $resultType;\n echo \"<img src=\\\"$resultUrl\\\"></img>\";\n }\n // Other, embed in iframe using service REST API for document\n else {\n $resultUrl = 'http://www.ebi.ac.uk/Tools/services/rest/ncbiblast/result/';\n $resultUrl .= $jobId . '/' . $resultType;\n echo \"<iframe src=\\\"$resultUrl\\\" width=\\\"100%\\\" height=\\\"100%\\\"></iframe>\";\n }\n $this->printDebugMessage('printResult', 'Begin', 1);\n }", "function wcs_get_address_type_to_display( $address_type ) {\n\tif ( ! is_string( $address_type ) ) {\n\t\treturn new WP_Error( 'woocommerce_subscription_wrong_address_type_format', __( 'Can not get address type display name. Address type is not a string.', 'woocommerce-subscriptions' ) );\n\t}\n\n\t$address_types = apply_filters( 'woocommerce_subscription_address_types', array(\n\t\t'shipping' => __( 'Shipping Address', 'woocommerce-subscriptions' ),\n\t\t'billing' => __( 'Billing Address', 'woocommerce-subscriptions' ),\n\t) );\n\n\t// if we can't find the address type, return the raw key\n\t$address_type_display = isset( $address_types[ $address_type ] ) ? $address_types[ $address_type ] : $address_type;\n\n\treturn apply_filters( 'woocommerce_subscription_address_type_display', $address_type_display, $address_type );\n}", "public function get_type_name() { \n\n\t\tswitch ($this->type) { \n\t\t\tcase 'xml-rpc': \n\t\t\tcase 'rpc':\n\t\t\t\treturn _('API/RPC');\n\t\t\tbreak;\n\t\t\tcase 'network':\n\t\t\t\treturn _('Local Network Definition');\n\t\t\tbreak;\n\t\t\tcase 'interface':\n\t\t\t\treturn _('Web Interface');\n\t\t\tbreak;\n\t\t\tcase 'stream':\n\t\t\tdefault: \n\t\t\t\treturn _('Stream Access');\n\t\t\tbreak;\n\t\t} // end switch\n\n\t}", "public function show(HouseType $type)\n {\n return view('types.show', compact('type'));\n }", "function entity_descr($type, $entity)\n{\n global $config, $entity_cache;\n\n if (is_numeric($entity))\n {\n $entity = get_entity_by_id_cache($type, $entity);\n }\n\n $translate = entity_type_translate_array($type);\n\n $text = $entity[$translate['entity_descr_field']];\n\n return($text);\n}", "public function type($type);", "function show($dbname=null, $type=null){\n //\n $this->bind_arg('dbname', $dbname);\n $this->try_bind_arg(\"type\", $type);\n //\n //Get the involved database\n sql::get_dbase($dbname);\n //\n //Get the fields \n $fields= $this->fields->get_array();\n //\n //Execute this sql \n $array= $this->get_sql_data($dbname);\n //\n //Ouptut a table\n echo \"<table name='{$this->entity->name}'>\";\n echo $this->header();\n //\n //Loop through the array and display the results in a table \n foreach ($array as $row) {\n //\n //The id should be the primary value \n $id=$this->entity->name;\n //\n echo \"<tr onclick='record.select(this)' id='$row[$id]'>\";\n //\n //Step through the columns\n foreach($fields as $field){\n //\n //Get the indexes of the field\n $name= is_null($field->alias) ? $field->column->name:$field->alias;\n //\n //Get the field value\n $value = $row[$name];\n \n echo $field->show($value);\n \n }\n \n echo \"</tr>\";\n }\n echo \"</table>\";\n \n \n }", "public function showSpecs()\n {\n return $this->name . \" includes a \" . $this->chipset . \" chipset and \" . $this->internalMemory . \"GB of internal memory\";\n }", "function get_pretty_type($type=false){\n\t\tif( $type === false ){\n\t\t\t$type = $this->get_current_type();\n\t\t}\n\t\tif( ! $this->is_valid_type($type) ){\n\t\t\t$type = 'none';\n\t\t}\n\t\treturn $this->pretty_type[$type];\n\t}", "public function get_display_type( $property ) {\n\n\t\t\t// Base Fields\n\t\t\tif ( $this->is_base_field( $property ) ) {\n\t\t\t\tswitch ( $property ) {\n\t\t\t\t\tcase 'image':\n\t\t\t\t\t\treturn 'image';\n\t\t\t\t\tcase 'private':\n\t\t\t\t\t\treturn 'checkbox';\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t// Extended Data\n\t\t\t} else {\n\t\t\t\treturn $this->slplus->database->extension->get_option( $property, 'display_type' );\n\t\t\t}\n\t\t}", "public function show(defence $defence)\n {\n //\n }", "public function property_type_of_practice() {\n\n\t\t\tif ( $this->add_package !== 3 ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t $out = '<h3>Property Details:</h3>';\n\n\t\t\t$out = '<h4>Type of Practice</h4>';\n\t\t\t$out .= '<ul>';\n\n\t\t\t$practice_type = get_field( 'practice_type' );\n\t\t\t$practice_type_label = ( $practice_type != 'other' )\n\t\t\t\t? $practice_type\n\t\t\t\t: get_field( 'other_type' );\n\n\t\t\t$out .= '<li><em>Practice Type:</em> ' . $practice_type_label . '</li>';\n\n\t\t\t$small_animal_treated = get_field( 'small_animal_treated' );\n\t\t\t$equine_treated = get_field( 'equine_treated' );\n\t\t\t$bovine_treated = get_field( 'bovine_treated' );\n\t\t\t$other_treated = get_field( 'other_treated' );\n\t\t\t$other_animals_treated_cont = get_field( 'other_animals_treated_cont' );\n\n\n\t\t\tif ( $small_animal_treated ) {\n\t\t\t\t$treated_small = get_field( 'small_animal_choices' );\n\t\t\t\t$small_choices = rtrim( implode( ', ', $treated_small ), ',' );\n\t\t\t\t$out .= '<li><em>' . $small_animal_treated . '&#37; - Small</em> &#40; ' . $small_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $equine_treated ) {\n\t\t\t\t$treated_equine = get_field( 'equine_choices' );\n\t\t\t\t$equine_choices = rtrim( implode( ', ', $treated_equine ), ',' );\n\t\t\t\t$out .= '<li><em>' . $equine_treated . '&#37; - Equine</em> &#40; ' . $equine_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $bovine_treated ) {\n\t\t\t\t$treated_bovine = get_field( 'bovine_choices' );\n\t\t\t\t$bovine_choices = rtrim( implode( ', ', $treated_bovine ), ',' );\n\t\t\t\t$out .= '<li><em>' . $bovine_treated . '&#37; - Bovine</em> &#40; ' . $bovine_choices . ' &#41;</li>';\n\t\t\t}\n\n\t\t\tif ( $other_treated ) {\n\t\t\t\t$out .= '<li><em>' . $other_treated . '&#37; - Other</em> &#40; ' . $other_animals_treated_cont . '&#41;</li>';\n\t\t\t}\n\n\t\t\t$out .= '</ul>';\n\n\t\t\treturn $out;\n\t\t}", "public static function getDescription($type)\n\t{\n\t\t//Make sure the type is formatted properly. Return the description.\n\t\t$type = RegExp::getType($type);\t\t\n\t\t\n\t\treturn self::$description[$type];\n\t}", "function displayConfig($arrayType, $type, $idName, $arrayOption = null) {\n $str = \"<select size='1' class='cbo' name='$idName' id='$idName'><option value=''>-- \" . $arrayOption[\"firstText\"] . \" --</option>\";\n if (is_array($arrayType))\n foreach ($arrayType as $key => $value) {\n $str .= \"<option value='\" . $key . \"' \" . (($type == $key) ? \"selected\" : \"\") . \">\" . $value . \"</option>\";\n }\n $str .= \"</select>\";\n return $str;\n }", "public function handler($type)\n {\n \ttry {\n \t\tswitch ($type) {\n \t\t\tcase 1:\n \t\t\t\treturn $this->showCLI($type);\n \t\t\t\tbreak;\n \t\t\tcase 2:\n \t\t\t\treturn $this->showCLR($type);\n \t\t\t\tbreak;\n \t\t\tcase 3:\n \t\t\t\treturn $this->showVL($type);\n \t\t\t\tbreak;\n \t\t\tcase 4:\n \t\t\t\treturn $this->showTCGD($type);\n \t\t\t\tbreak;\n \t\t\tcase 5:\n \t\t\t\treturn $this->showTCDG($type);\n \t\t\t\tbreak;\n \t\t\tcase 6:\n \t\t\t\treturn $this->showNCSM($type);\n \t\t\t\tbreak;\n \t\t\tcase 7:\n \t\t\t\treturn $this->showCMA($type);\n \t\t\t\tbreak;\n \t\t\tcase 8:\n \t\t\t\treturn $this->showOT($type);\n \t\t\t\tbreak;\n case 9:\n return $this->showCAC($type);\n break;\n case 10:\n return $this->showPD($type);\n break;\n case 11:\n return $this->showTD($type);\n break;\n case 12:\n return $this->showSR($type);\n break;\n case 13:\n return $this->showDCWR($type);\n break;\n case 14:\n return $this->showTM($type);\n break;\n case 15:\n return $this->showMRHS($type);\n break;\n case 16:\n return $this->showMS($type);\n break;\n case 17:\n return $this->showMSL($type);\n break;\n case 18:\n return $this->showMMSM($type);\n break;\n case 19:\n return $this->showIMR($type);\n break;\n case 20:\n return $this->showNMDNU($type);\n break;\n case 21:\n return $this->showSMAPSP($type);\n break;\n case 22:\n return $this->showMMNRM($type);\n break;\n case 23:\n # code...\n return $this->showBBWR($type);\n break;\n case 24:\n return $this->showRBBR($type);\n break;\n case 25:\n return $this->showBBHLR($type);\n break;\n case 26:\n return \"Required Consultation\";\n break;\n \n \t\t\tdefault:\n \t\t\t\treturn \"In Progress\";\n \t\t\t\tbreak;\n \t\t}\n \t} catch (\\Exception $e) {\n \t\tdd($e->getMessage());\n \t}\n }", "public function create()\n {\n $specification = Specification::all();\n return view('specification_types.create')->with(compact('specification'));\n }", "public function displayAs($type, $config)\n {\n $this->type = strtolower($type) ?: $this->type;\n $this->config = $this->evalConfig($config);\n\n return $this;\n }", "public function getType()\n {\n \n $tipos = \n\n $TypeOfProduct = TypeOfProduct::find($this->type_id); \n\n return $TypeOfProduct->description;\n }", "public function show(RequestType $requestType)\n {\n return $this->showOne($requestType);\n }", "function testModeName($type) {\n switch ($type) {\n case 'firstName':\n $tagType = 'First Name';\n break;\n case 'lastName':\n $tagType = 'Last Name';\n break;\n case 'customerFeedback':\n $tagType = 'Feedback';\n break;\n default:\n $tagType = 'First and Last Name';\n }\n\n return '[Test Mode: Customer ' . $tagType . ' will appear here]';\n }", "function ecf_display( $post, $type){ \r\n\t\t\t\t?>\r\n\t\t\t\t<p class=\"meta-options ecf_field\">\r\n\t\t\t\t\t<?php \r\n\t\t\t\t\t// Swich -> Case function to future upgrade\r\n\t\t\t\t\tswitch ($type['args'][2]) {\r\n\t\t\t\t\t\tcase \"text\": ?>\r\n\t\t\t\t\t\t\t<label for=\"<?= $type['args'][0]; ?>\"><?= $type['args'][1]; ?></label>\r\n\t\t\t\t\t\t\t<input id=\"<?= $type['args'][0]; ?>\" type=\"text\" name=\"<?= $type['args'][0]; ?>\" value=\"<?php echo esc_attr( get_post_meta( get_the_ID(), $type['args'][0] , true ) ); ?>\">\r\n\t\t\t\t\t<?php\t\t\r\n\t\t\t\t\t\t// Brakre this function at the end\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t?>\r\n\t\t\t\t</p>\r\n\t\t\t<?php\r\n\t\t\t}", "public function show(MasterEducationType $masterEducationType)\n {\n //\n }", "public function preview_display( $type = 'default', $data ) {\n\n // Output the display based on the type of slider available.\n switch ( $type ) {\n case 'default' :\n // Don't preview anything\n break;\n default:\n do_action( 'envira_gallery_preview_' . $type, $data );\n break;\n }\n\n }", "public function render_products_type()\r\n {\r\n $current_product_type = isset($_REQUEST['product_type']) ? wc_clean(wp_unslash($_REQUEST['product_type'])) : false; // WPCS: input var ok, sanitization ok.\r\n $output = '<select name=\"product_type\" id=\"dropdown_product_type\"><option value=\"\">' . __('Filter by product type', 'woocommerce') . '</option>';\r\n\r\n foreach (wc_get_product_types() as $value => $label) {\r\n $output .= '<option value=\"' . esc_attr($value) . '\" ';\r\n $output .= selected($value, $current_product_type, false);\r\n $output .= '>' . esc_html($label) . '</option>';\r\n\r\n if ('simple' === $value) {\r\n $output .= '<option value=\"downloadable\" ';\r\n $output .= selected('downloadable', $current_product_type, false);\r\n $output .= '> ' . (is_rtl() ? '&larr;' : '&rarr;') . ' ' . __('Downloadable', 'woocommerce') . '</option>';\r\n\r\n $output .= '<option value=\"virtual\" ';\r\n $output .= selected('virtual', $current_product_type, false);\r\n $output .= '> ' . (is_rtl() ? '&larr;' : '&rarr;') . ' ' . __('Virtual', 'woocommerce') . '</option>';\r\n }\r\n }\r\n\r\n $output .= '</select>';\r\n echo $output; // WPCS: XSS ok.\r\n }", "public function displayGroupType() {\r\n\r\n $this->loadModel('SelectGroupType');\r\n $group_types = $this->SelectGroupType->find('all');\r\n\r\n $this->set('groupTypes', $group_types);\r\n }", "public function question_type() {\r\n $this->check_permission(18);\r\n $content_data['add'] = $this->check_page_action(18, 'add');\r\n $this->quick_page_setup(Settings_model::$db_config['adminpanel_theme'], 'adminpanel', $this->lang->line('question_type'), 'operation/question_type', 'header', 'footer', '', $content_data);\r\n }", "public function debugprint( $type ) {\n\t\tswitch( $type ) {\n\t\t\tcase \"update\":\n\t\t\t$this->setParameter( \"dtreviewed\", date('c') );\n\t\t\tbreak;\n\t\t}\n\t\t$this->createSmoRequest();\n\t\tprint_r( $this->smo );\n\t}", "public function show(MembershipType $membershipType)\n {\n //\n }", "function entity_type_label_plural($entity_type) {\n $controller = entity_toolbox_controller($entity_type);\n $helper = $controller->getToolboxHelper();\n\n return $helper->labelPlural();\n}", "public function resourceType(): string\n {\n return static::TYPE;\n }", "public function actionIndex($type)\n {\n if($this->isAuthenticate())\n {\n $searchModel = new SecurityEntitiesSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams, $type);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n 'type' => $type,\n ]);\n }\n }", "public function show(RoomType $roomType, Branch $branch = null, Department $department = null)\n {\n //\n }", "public function show(Testimony $testimony)\n {\n //\n }", "public function getVisualType(): string\n {\n return $this->visualType;\n }", "public function show(TipoEquipo $tipoEquipo)\n {\n //\n }", "private function display_stats_table($type)\n\t{\n\t\t$usages = [];\n\n\t\tforeach ($this->event_listing[$type] as $name => $count)\n\t\t{\n\t\t\t$usages[] = [$count, $name];\n\t\t}\n\n\t\t// Show the table\n\t\t$table_header = [$this->language->lang('CLI_EXTENSION_EVENTS_USAGES'), $this->language->lang('CLI_EXTENSION_EVENTS_NAME')];\n\t\t$this->render_table($table_header, $usages);\n\t}", "public function getSpecification()\n {\n return $this->Specification;\n }", "protected function get_instance_display_type( $instance ) {\n return 'list';\n }", "public function show(UnitTypes $unitTypes)\n {\n //\n }", "function which_type($table) {\n\n\tif ($table['type'] == \"text\") {\n\t\treturn print_text($table);\n\t}\n\telse if ($table['type'] == \"photo\") {\n\t\treturn print_photo($table);\n\t}\n\telse if ($table['type'] == \"photo and text\") {\n\t\treturn print_photo_text($table);\n\t}\n\telse if ($table['type'] == \"link and photo\") {\n\t\treturn print_link_photo($table);\n\t}\n\telse if ($table['type'] == \"link and text\") {\n\t\treturn print_link_text($table);\n\t}\n}", "function get_ad_specification_info( $specification_id, $specification_status = 0 )\n\t{\n\t\t$criteria = $specification_status == 1 ? \"specification_status = 1 AND \" : \"\";\n\t\t$q = \"SELECT * FROM title_dev_ad_specifications WHERE \".$criteria.\" specification_id = \".$specification_id;\n\t\t$r = $this -> db -> getSingleRecord( $q );\n\t\tif( $r )\n\t\t\treturn $r;\n\t\telse\n\t\t\treturn false;\n\t}", "public function get_course_type($type){\n\t\tswitch($type){\n\t\t\tcase 'R':\n\t\t\t$value = 'Regular';\n\t\t\tbreak;\n\t\t\tcase 'C':\n\t\t\t$value = 'Correspondence';\n\t\t\tbreak;\t\t\t\n\t\t}\n\t\treturn $value;\n }" ]
[ "0.6621573", "0.6621573", "0.6621573", "0.6559636", "0.6553296", "0.6357064", "0.624014", "0.6219991", "0.61806995", "0.6094615", "0.6093914", "0.6031929", "0.594848", "0.594848", "0.594848", "0.59464043", "0.5915264", "0.59119326", "0.59119326", "0.5840419", "0.5812693", "0.5799421", "0.57278264", "0.5701308", "0.568612", "0.56709296", "0.56704324", "0.56556743", "0.5621938", "0.5594668", "0.5589013", "0.55812067", "0.55778486", "0.55706835", "0.55653524", "0.5553226", "0.55445117", "0.5538362", "0.5500798", "0.5492056", "0.5486839", "0.5474598", "0.54675686", "0.5424744", "0.5424572", "0.5409676", "0.5397647", "0.53897864", "0.5385319", "0.53617394", "0.5361402", "0.5333318", "0.53290355", "0.5321539", "0.530994", "0.52965885", "0.52957124", "0.529386", "0.52929825", "0.5286105", "0.5283806", "0.5283046", "0.52787143", "0.5276222", "0.5257593", "0.5243851", "0.52297324", "0.52240026", "0.52231693", "0.52084905", "0.52049357", "0.52008164", "0.5200704", "0.5186791", "0.51832765", "0.51781666", "0.517312", "0.5167978", "0.5158052", "0.5148204", "0.51408595", "0.5115189", "0.51009214", "0.5094501", "0.5087401", "0.50739914", "0.50717276", "0.5066081", "0.5060549", "0.5055536", "0.50548947", "0.50431997", "0.5037972", "0.5036884", "0.5032407", "0.50309324", "0.50292295", "0.50262064", "0.5012743", "0.49977976" ]
0.55965984
29
Show the form for editing the specified Specification_type.
public function edit($id) { $specificationType = $this->specificationTypeRepository->find($id); if (empty($specificationType)) { Flash::error('Specification Type not found'); return redirect(route('specificationTypes.index')); } $specification = Specification::all(); $data =[ 'specification' => $specification, 'specificationType' => $specificationType ]; return view('specification_types.edit')->with($data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function edit(Type $type)\n {\n //\n }", "public function getEdit($type)\n {\n // Title\n $title = Lang::get('admin/types/title.type_update');\n\n // Show the page\n return View::make('admin/types/edit', compact('type', 'title'));\n }", "public function edit(Type $type)\n {\n //\n return view('type', compact('type'));\n }", "public function edit(Type $type)\n {\n Gate::authorize('edit-type', $type);\n $title = \"Edit {$type->name}\";\n return view('admin.types.edit', compact('title', 'type'));\n }", "public function edit(ProductProductType $productProductType)\n {\n //\n }", "public function edit(DeviceType $type)\n {\n return view('devices.types.edit', compact('type'));\n }", "public function edit(Salarytype $salarytype)\n {\n //\n }", "public function edit($typeId, $id, CarEngine $engine)\n {\n //\n $engine = $engine->find($id); \n $breadcrumb='carEngines.edit';\n $item=$engine;\n return view('admin.partials.cars.types.engines.form', compact('engine','breadcrumb','item'));\n }", "public function edit($menu_type)\n {\n $menu_type=Menu_type::whereId($menu_type)->first();\n return view('admin.menu.update_menu_type',compact('menu_type'));\n }", "public function edit(HouseType $type)\n {\n return view('types.edit', compact('type'));\n }", "public function edit($id)\n {\n $specification=Specification::find($id);\n return view('specifications.edit')->with('specification',$specification);\n }", "public function edit(Specialization $specialization)\n {\n $category = Category::orderBy('id','desc')->get();\n return view('Admin.Specialization.edit', compact('specialization','category'));\n }", "public function edit(Companytype $companytype)\n {\n return view('masters.companytypes.edit', compact('companytype'));\n }", "private function createEditForm(Cardtype $entity)\n {\n $form = $this->createForm(new CardtypeType(), $entity, array(\n 'action' => $this->generateUrl('cardtype_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }", "public function edit($id)\n {\n $spec = Specification::find($id);\n return view('admin.specs.specsEdit',\n [\n 'spec' => $spec\n ]\n );\n }", "public function edit(PrizeType $prizeType)\n {\n //\n }", "public function edit(Entity $entity)\n {\n $entity->typeCompanyPreview = self::previewTypeCompany($entity->type_company);\n\n\n return view('entity.edit', compact('entity'));\n }", "public function edit(ComputerType $computerType)\n {\n return view('catalogs.computerType.edit',['computerType' => $computerType]);\n }", "public function edit(MediaType $media_type)\n {\n if (Auth::check() && Auth::user()->hasRole('admin')) {\n return view('pages.media_type.edit')\n ->with('media_type', $media_type);\n } else {\n return redirect()->back();\n }\n }", "public function edit(FormType $form_type)\n {\n $colors = Setting::colors();\n if (!in_array($form_type->color, $colors)) {\n array_push($colors, $form_type->color);\n }\n\n return view('admin.formtype.edit', [\n 'form_type' => $form_type,\n 'colors' => $colors\n ]);\n }", "public function edit(EmpType $empType)\n {\n //\n return view ('emptype.edit')->with(compact('empType'));\n }", "public function edit(types $type)\n {\n return view('types.edit', compact('type'));\n }", "function editItemType() {\n\t\tglobal $page;\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:itemtype\">';\n\t\t\t$_ .= $this->getTypeObject()->editItem();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}", "public function edit(JIndustrySpecialization $jIndustrySpecialization)\n {\n //\n }", "public function edit(ShipType $shiptype)\n {\n return $this->view('admin::shiptypes.edit', compact('shiptype'));\n }", "public function edit(type_of_user $type_of_user)\n {\n //\n }", "public function edit($id)\n {\n\t\t$jobtype = JobType::find($id);\n return view('admin.job-type.edit',['jobtype'=>$jobtype]);\n }", "public function edit(ProductType $productType)\n {\n return view('admin.product_types.edit', compact('productType'));\n }", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit(PavaneType $pavaneType)\n {\n //\n }", "public function edit($outcomeType)\n {\n $model = OutcomeType::find($outcomeType);\n return view('outcome-type.update', ['model' => $model]);\n }", "public function edit($id)\n {\n $data = [];\n $data['typeedit'] = ProductType::findOrFail($id);\n return view('product_type.edit', $data);\n }", "private function createEditForm(SkSpecies $entity) {\n $em = $this->getDoctrine()->getManager();\n\n // Get criterias from species\n $criteria_ids = $em->getRepository('SkaphandrusAppBundle:SkIdentificationCriteria')->getCriteriasFromSpecies($entity->getId());\n\n\n\n $form = $this->createForm(new SkIdentificationSpeciesType(), $entity, array(\n 'action' => $this->generateUrl('identification_species_admin_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n 'criterias' => $criteria_ids\n ));\n return $form;\n }", "public function edit($id)\n\t{\n\t\t$product_type = $this->product_type->find($id);\n\n\t\tif (is_null($product_type))\n\t\t{\n\t\t\treturn Redirect::route('product_types.index');\n\t\t}\n\n\t\treturn View::make('scaffolds.product_types.edit', compact('product_type'));\n\t}", "public function edit(UserType $userType)\n {\n //\n }", "public function edit(RunType $runType)\n {\n //\n }", "public function edit($id)\n {\n $type = Type::find($id);\n return view('type.edit',compact('type'));\n }", "public function edit($video_type)\n {\n //\n $tipoVideo = VideoType::findOrFail($video_type);\n \n $user_id = \\Auth::user()->id; //auth()->id();\n $usuario = usermoodle::where('id', $user_id)->first();\n\n return view('admin.videotype.edit', compact('tipoVideo', 'usuario'));\n }", "public function edit(JetCabin $cabinSpecification)\n {\n $jets = Jet::get();\n\n return view('admin.cabinSpecifications.form', compact('cabinSpecification', 'jets'));\n }", "public function edit($id)\n {\n //\n //find record of given id\n $edit_form = Assignatory::find($id);\n\n if($edit_form->kind == 'R'){\n $records = Assignatory::all()->where('kind', '=', 'R');\n }elseif ($edit_form->kind == 'AA') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'AA');\n }elseif ($edit_form->kind == 'C') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'C');\n }elseif ($edit_form->kind == 'A') {\n # code...\n $records = Assignatory::all()->where('kind', '=', 'A');\n }\n \n $dept = Office::all();\n \n\n //show edit form and pass the info to it\n return View('signatory.editsignatory', compact('edit_form','records','dept')); \n }", "public function edit(TypeThird $typeThird)\n {\n //\n }", "#[IsGranted('ROLE_SEPULTURE_ADMIN')]\n #[Route(path: '/{id}/edit', name: 'typesepulture_edit', methods: ['GET', 'POST'])]\n public function edit(Request $request, TypeSepulture $type): Response\n {\n $em = $this->managerRegistry->getManager();\n $editForm = $this->createEditForm($type);\n $editForm->handleRequest($request);\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n $em->flush();\n $this->addFlash('success', 'Le type a bien été modifié');\n\n return $this->redirectToRoute('typesepulture');\n }\n\n return $this->render(\n '@Sepulture/type_sepulture/edit.html.twig',\n [\n 'entity' => $type,\n 'form' => $editForm->createView(),\n ]\n );\n }", "public function edit(PackageType $packageType)\n {\n return view('admin.package_types.edit', compact('packageType'));\n }", "public function edit($id)\n {\n //\n\t\t$type = Type::findOrFail($id);\n\t\treturn view('admin.type_edit', ['type' => $type]);\n }", "public function edit($id)\n {\n $productTypeEdit = $this->productTypeService->productTypeRepository->getById($id);\n\n return view('admin.product_type.edit', compact('productTypeEdit'));\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit($idposttype)\n {\n $rs_categories = DB::select('call ListAllCategoryProcedure()');\n $categories = json_decode(json_encode($rs_categories), true);\n $posttype = PostType::find($idposttype);\n return view('admin.posttype.edit',compact('posttype','idposttype','categories'));\n }", "public function getEditForm();", "function mongo_node_type_edit_form($form, $form_state, $entity_type) {\n $set = mongo_node_settings();\n $form = array();\n\n $form['label'] = array(\n '#type' => 'textfield',\n '#title' => t('Entity type'),\n '#default_value' => $set[$entity_type]['label'],\n '#description' => t('The human readable name of the entity.'),\n );\n\n $form['name'] = array(\n '#type' => 'machine_name',\n '#required' => FALSE,\n '#default_value' => $entity_type,\n '#machine_name' => array(\n 'exists' => '_mongo_node_type_exists',\n 'source' => array('label'),\n ),\n );\n\n // Send entity type.\n $form['entity_type'] = array(\n '#type' => 'value',\n '#value' => $entity_type,\n );\n\n $form['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save'),\n );\n\n return $form;\n}", "function fyc_project_menu_content_type_edit_form($form, &$form_state) {\n return $form;\n}", "public function edit($type, Ckp $ckp)\n {\n if (Auth::user()->id != $ckp->user->id) {\n abort(403);\n }\n\n if ($type == 'ckpr') {\n return view('ckp.entrickpr', compact('ckp'));\n } else if ($type == 'ckpt') {\n return view('ckp.entrickpt', compact('ckp'));\n } else {\n abort(404);\n }\n }", "public function edit(RoomType $roomType, Branch $branch = null, Department $department = null)\n {\n //\n }", "public function edit(CompanyType $companyType)\n {\n return view('admin.pages.company-type.edit', [\n \"companyType\" => $companyType\n ]);\n }", "public function edit(Seo $seo, FormBuilder $formBuilder, Request $request, $type, $id)\n {\n // Etonnant laravel ne comprends pas l'object Traduction.\n\n $seo->checkForTraduction();\n // $traduction->flashForMissing();\n // $type = $request->type;\n // $id = (int) $request->id;\n\n if(empty($id) && empty($type)) {\n abort(403);\n }\n\n $model_key = adminify_get_class($type, ['app:models', 'app:adminify:models'], false);\n\n if(empty($model_key)) {\n abort(403);\n }\n\n $model = new $model_key;\n $model = $model->find($id);\n\n $form = $this->makeForm(SeoForm::class, [\n 'method' => 'PUT',\n 'url' => route('seo.update', ['type' => $type, 'id' => $id]),\n 'model' => $model\n ]);\n\n return view(\"adminify::layouts.admin.pages.edit\", ['form' => $form]);\n }", "public function edit($id)\n {\n $type = Type::find($id);\n return view('admin/type/edit', ['type' => $type]);\n }", "public function edit($type=null,$item_id, $id)\n {\n //\n }", "public function edit($id)\n {\n $type = Type::find($id);\n return view('Type.edit',compact('type'));\n }", "public function edit($id)\n {\n $type = Type::findOrFail($id);\n return view('admin.type.edit', [\n 'type' => $type\n ]);\n }", "public function edit(int $id)\n {\n $jobType = $this->jobTypeRepository->get('id', $id);\n\n return view('admin.job_types.edit', compact('jobType'));\n }", "public function edit($id)\n\t{\n\t\t//\n\t\t$ps_products = CepProducts::where(\"prod_status\",1)->select('prod_id','prod_name')->get();\n\t\t$all_ps_products = array();\n\t\t$all_ps_products[\"\"] = \"Select\";\n\t\tforeach($ps_products as $prod)\n\t\t\t$all_ps_products[$prod->prod_id] = $prod->prod_name;\n\t\t$alphaRange=array_combine(range('1','26'),range('A','Z'));\n\t\t$productSpecs = CepSpecificationProducts::where(\"specprod_id\",$id)->first();\n\n $languages = CepLanguages::all();\n\t\t$languages_array = array();\n\t\t$languages_array[\"\"] = \"Select\";\n\t\tforeach ($languages as $language){\n\t\t\t$languages_array[$language->lang_code]=$language->lang_name;\n\t\t}\n\n\t\t$prd_attachment = CepAttachmentFiles::where('attfiles_attachment_id',$productSpecs['specprod_attachment_id'])->get();\n\n\t\treturn count($productSpecs) ? view(\"product_specifications.edit\",compact('all_ps_products','alphaRange','productSpecs','languages_array','prd_attachment')) : abort(404);\n\t}", "public function actionEdit($type = null, $id = null)\n {\n $this->adminOnly();\n\n $page = $this->findPageById($id);\n\n if ($page === null) {\n $page = Yii::createObject($this->getPageClassName());\n $page->type = $type;\n $page->content->container = $this->contentContainer;\n }\n\n $page->content->visibility = \\humhub\\modules\\content\\models\\Content::VISIBILITY_PUBLIC;\n\n if ($page->load(Yii::$app->request->post()) && $page->save()) {\n if ($page->type == Container::TYPE_MARKDOWN) {\n \\humhub\\modules\\file\\models\\File::attachPrecreated($page, Yii::$app->request->post('fileUploaderHiddenGuidField'));\n }\n\n return $this->redirect($this->contentContainer->createUrl('list'));\n }\n\n return $this->render('@custom_pages/views/common/edit', [\n 'page' => $page,\n 'sguid' => $this->space->guid,\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()]);\n }", "public function edit($id)\n {\n $type = RequestType::findOrFail($id);\n return view('request.type.edit', compact('type'));\n }", "public function edit(Plantation $plantation)\n {\n //$types = Type::all();\n $types =['' => 'Select a type'] + Type::pluck('name','id')->all();\n\n return view('editPlantation')->with('plantation',$plantation)\n ->with('types', $types);\n }", "public function edit($id)\n {\n $model = Type_cars::findOrFail($id);\n return view('modules.type.form', compact('model'));\n }", "public function edit($id)\n {\n if (! Gate::allows('jobtype_edit')) {\n return abort(401);\n }\n $jobtype = Jobtype::findOrFail($id);\n\n return view('jobtypes.edit', compact('jobtype'));\n }", "public function update($id, UpdateSpecification_typeRequest $request)\n {\n $specificationType = $this->specificationTypeRepository->find($id);\n\n if (empty($specificationType)) {\n Flash::error('Specification Type not found');\n\n return redirect(route('specificationTypes.index'));\n }\n\n $specificationType = $this->specificationTypeRepository->update($request->all(), $id);\n\n Flash::success('Specification Type updated successfully.');\n\n return redirect(route('specificationTypes.index'));\n }", "public function edit($model, $form);", "function travel_type_form($form, &$form_state, $entity_type, $op = 'edit') {\n // Handle the case when cloning is performed.\n if ($op == 'clone') {\n $entity_type->label .= ' (cloned)';\n $entity_type->type = '';\n }\n\n // Describe all properties of the entity which shall be shown on the form.\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $entity_type->label,\n '#description' => t('The human-readable name of this entity type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($entity_type->type) ? $entity_type->type : '',\n '#maxlength' => 32,\n //'#disabled' => $entity_type->isLocked() && $op != 'clone',\n '#machine_name' => array(\n 'exists' => 'travel_type_load_multiple',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this entity type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n $form['description'] = array(\n '#type' => 'textarea',\n '#default_value' => isset($entity_type->description) ? $entity_type->description : '',\n '#description' => t('Description about the entity type.'),\n );\n\n // Add some buttons.\n $form['actions'] = array('#type' => 'actions');\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save entity type'),\n '#weight' => 40,\n );\n //if (!$entity_type->isLocked() && $op != 'add' && $op != 'clone') {\n $entity_id = entity_id('travel', $entity);\n if (!empty($entity_id)) {\n $form['actions']['delete'] = array(\n '#type' => 'submit',\n '#value' => t('Delete entity type'),\n '#weight' => 45,\n '#limit_validation_errors' => array(),\n '#submit' => array('travel_type_form_submit_delete'),\n );\n }\n\n return $form;\n}", "public function editAction() {\n $entities = $this\n ->_getRepository()\n ->findAllOrdered();\n $entities = $this->_transformAllConfigEntities($entities);\n $form = $this->createForm(new ConfigType(), array(\n 'configentities' => $entities,\n ));\n\n return array(\n 'form' => $form->createView(),\n );\n }", "public function edit($id)\n {\n //\n $studentType = Program::findOrFail($id);\n return view('studentType.edit', compact('studentType'));\n\n }", "function breol_facetbrowser_breol_facetbrowser_content_type_edit_form($form, &$form_state) {\n return $form;\n}", "public function editAction(Request $request, TypeProduct $typeProduct)\n {\n $deleteForm = $this->createDeleteForm($typeProduct);\n $editForm = $this->createForm('AdminBundle\\Form\\TypeProductType', $typeProduct);\n $editForm->handleRequest($request);\n\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n $this->getDoctrine()->getManager()->flush();\n\n return $this->redirectToRoute('type_product_index');\n }\n\n return $this->render('AdminBundle:TypeProduct:edit.html.twig', array(\n 'typeProduct' => $typeProduct,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function actionEditjobtypes(){\n\n $seekerjobtypes = Yii::$app->user->identity->seeker->seekerJobTypes;\n // $seekerjobtypes = SeekerJobType::findAll(['seeker_id'=>Yii::$app->user->identity->seeker->seeker_id]);\n\n $job =JobType::find()\n ->where(['not in','job_type_id',\n ( new Query())\n ->select(['job_type_id'])\n ->from('seeker_job_type')\n ->where(['seeker_id'=>Yii::$app->user->identity->seeker->seeker_id])\n\n ])->all();\n\n return $this->render('addjobtype',['seekerjobtypes'=>$seekerjobtypes,'job'=>$job]);\n }", "public function edit_form_after_title() {\n\t\twp_nonce_field( 'papi_save_data', 'papi_meta_nonce' );\n\n\t\tif ( $value = esc_attr( papi_get_entry_type_id() ) ) {\n\t\t\tpapi_render_html_tag( 'input', [\n\t\t\t\t'data-papi-page-type-key' => true,\n\t\t\t\t'name' => esc_attr( papi_get_page_type_key() ),\n\t\t\t\t'type' => 'hidden',\n\t\t\t\t'value' => $value\n\t\t\t] );\n\t\t}\n\t}", "public function edit($id)\n {\n $data = ProjectType::find($id);\n return view('manage.project-type.edit')->with(compact('data'));\n }", "public function show(Type $type)\n {\n //\n }", "public function show(Type $type)\n {\n //\n }", "public function show(Type $type)\n {\n //\n }", "public function edit($id)\n {\n $type = $this->typeRepository->find($id);\n\n return view('types.edit', compact('type'));\n }", "public function editAction(Request $request, JobType $jobType) {\n $deleteForm = $this->createDeleteForm($jobType);\n $editForm = $this->createForm('Adverto\\AdminBundle\\Form\\JMP\\JobTypeType', $jobType);\n $editForm->handleRequest($request);\n\n if ($editForm->isSubmitted() && $editForm->isValid()) {\n $this->getDoctrine()->getManager()->flush();\n\n return $this->redirectToRoute('admin_jmp_job_type_edit', array('id' => $jobType->getId()));\n }\n\n return $this->render('AdminBundle:jmp:JobType/edit.html.twig', array(\n 'JobType' => $jobType,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function editFormAction()\n {\n\t\t$id = $this->params()->fromRoute(\"id\", \"\");\n\t\t$form_type = $this->params()->fromQuery(\"ftype\", \"\");\n\n\t\tif ($id == \"\")\n\t\t{\n\t\t\t//set error message\n\t\t\t$this->flashMessenger()->addErrorMessage(\"Form could not be loaded. Id is not set\");\n\t\t\t//redirect to index page\n\t\t\treturn $this->redirect()->toRoute(\"front-form-admin\");\n\t\t}//end if\n\n\t\t//load form data\n\t\t$objForm = $this->getFormAdminModel()->getForm($id);\n\n\t\t//load form\n\t\t$form = $this->getFormAdminModel()->getFormAdminForm($form_type);\n\n\t\t//save form type and remove option from form\n\t\t$fk_form_type_id = $objForm->get(\"fk_form_type_id\");\n\n\t\t//disable form type element\n\t\t$form->get(\"fk_form_type_id\")->setAttribute(\"disabled\", \"disabled\");\n\n\t\t//bind data to form\n\t\t$form->bind($objForm);\n\n\t\t$request = $this->getRequest();\n\t\tif ($request->isPost())\n\t\t{\n\t\t\t$arr_data = $request->getPost();\n\t\t\t$arr_data[\"fk_form_type_id\"] = $fk_form_type_id;\n\t\t\t$form->setData($arr_data);\n\n\t\t\tif ($form->isValid($request->getPost()))\n\t\t\t{\n\t\t\t\ttry {\n\t\t\t\t\t//update the form\n\t\t\t\t\t$objForm = $form->getData();\n\t\t\t\t\t$objForm->set(\"id\", $id);\n\t\t\t\t\t$objForm->set(\"fk_form_type_id\", $fk_form_type_id);\n\n\t\t\t\t\t$objForm = $this->getFormAdminModel()->editForm($objForm);\n\n\t\t\t\t\t//set success message\n\t\t\t\t\t$this->flashMessenger()->addSuccessMessage(\"Form has been updated\");\n\n\t\t\t\t\t//redirect to index page\n\t\t\t\t\treturn $this->redirect()->toRoute(\"front-form-admin\");\n\t\t\t\t} catch (\\Exception $e) {\n\t\t\t\t\t//set error message\n\t\t\t\t\t$form = $this->frontFormHelper()->formatFormErrors($form, $e->getMessage());\n\t\t\t\t}//end catch\n\t\t\t}//end if\n\t\t}//end if\n\n\t\tif ($objForm->get(\"id\") == \"\")\n\t\t{\n\t\t\t//reload form data\n\t\t\t$objForm = $this->getFormAdminModel()->getForm($id);\n\t\t}//end if\n\n\t\treturn array(\n\t\t\t\t\"form\" => $form,\n\t\t\t\t\"objForm\" => $objForm\n\t\t);\n }", "public function edit(Ctype $ctype)\n {\n //\n }", "public function edit($typology) //110\n {\n $this->authorize('edit.typologies');\n\n return view('admin.typologies.edit', compact('typology','supervisions'));\n }", "public function edit($type = 'about')\n {\n // we should gather any information from the tables and then send that\n // back to the view. We order by id desc because we can create new\n // type pages or edit\n $node = $this->nodeModel->nodeByType($type)->orderBy('id', 'desc')->first();\n // return view\n \n return view('admin.node_view')->with(compact('node'));\n }", "public function edit($type, $id)\n {\n if ((string) $type === 'role') {\n $data['acl'] = $this->roles->findOrFail($id);\n $data['group'] = $this->permissions->all();\n } elseif((string) $type === 'permissions') {\n $data['acl'] = $this->permissions->findOrFail($id);\n $data['group'] = $this->roles->all();\n } else {\n flash(trans('acl.flash-error-edit-acl'));\n return redirect()->route('users.index');\n }\n\n return view('acl.edit-view', $data);\n }", "function medstat_quizz_questionnaire_take_content_type_edit_form($form, &$form_state) {\n return $form;\n}", "public function postEdit($type)\n {\n // Declare the rules for the form validation\n $rules = array(\n 'name' => 'required|min:3'\n );\n\n // Validate the inputs\n $validator = Validator::make(Input::all(), $rules);\n\n // Check if the form validates with success\n if ($validator->passes())\n {\n // Update the type post data\n $this->$type->name = Input::get('name');\n\n // Was the type post updated?\n if($this->$type->save())\n {\n // Redirect to the new type post page\n return Redirect::to('admin/types/' . $type->id . '/edit')->with('success', Lang::get('admin/types/messages.update.success'));\n }\n\n // Redirect to the types post management page\n return Redirect::to('admin/types/' . $type->id . '/edit')->with('error', Lang::get('admin/types/messages.update.error'));\n }\n\n // Form validation failed\n return Redirect::to('admin/types/' . $type->id . '/edit')->withInput()->withErrors($validator);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $specifications = Specifications::findOrFail(decrypt($id));\n return view('specifications.edit', compact('specifications'));\n }", "private function createEditForm(ObjectType $entity)\n {\n $form = $this->createForm(new ObjectTypeType(), $entity, array(\n 'action' => $this->generateUrl('object_objecttype_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Сохранить изменения'));\n\n return $form;\n }", "function ting_new_materials_content_type_edit_form($form, &$form_state) {\n return $form;\n}", "function bat_event_type_form($form, &$form_state, $event_type, $op = 'edit') {\n $form['#attributes']['class'][] = 'bat-management-form bat-event-type-form';\n\n if ($op == 'clone') {\n $event_type->label .= ' (cloned)';\n $event_type->type = '';\n }\n\n $form['label'] = array(\n '#title' => t('Label'),\n '#type' => 'textfield',\n '#default_value' => $event_type->label,\n '#description' => t('The human-readable name of this event type.'),\n '#required' => TRUE,\n '#size' => 30,\n );\n\n // Machine-readable type name.\n $form['type'] = array(\n '#type' => 'machine_name',\n '#default_value' => isset($event_type->type) ? $event_type->type : '',\n '#maxlength' => 32,\n '#machine_name' => array(\n 'exists' => 'bat_event_get_types',\n 'source' => array('label'),\n ),\n '#description' => t('A unique machine-readable name for this event type. It must only contain lowercase letters, numbers, and underscores.'),\n );\n\n if ($op == 'add') {\n $form['fixed_event_states'] = array(\n '#type' => 'checkbox',\n '#title' => t('Fixed event states'),\n );\n }\n elseif ($op == 'edit') {\n $form['type']['#disabled'] = TRUE;\n }\n\n $form['event_granularity'] = array(\n '#type' => 'select',\n '#title' => t('Event Granularity'),\n '#options' => array('bat_daily' => t('Daily'), 'bat_hourly' => t('Hourly')),\n '#default_value' => isset($event_type->event_granularity) ? $event_type->event_granularity : 'bat_daily',\n );\n\n if (isset($event_type->is_new)) {\n // Check for available Target Entity types.\n $target_entity_types = module_invoke_all('bat_event_target_entity_types');\n if (count($target_entity_types) == 1) {\n // If there's only one target entity type, we simply store the value\n // without showing it to the user.\n $form['target_entity_type'] = array(\n '#type' => 'value',\n '#value' => $target_entity_types[0],\n );\n }\n else {\n // Build option list.\n $options = array();\n foreach ($target_entity_types as $target_entity_type) {\n $target_entity_info = entity_get_info($target_entity_type);\n $options[$target_entity_type] = $target_entity_info['label'];\n }\n $form['target_entity_type'] = array(\n '#type' => 'select',\n '#title' => t('Target Entity Type'),\n '#description' => t('Select the target entity type for this Event type. In most cases you will wish to leave this as \"Unit\".'),\n '#options' => $options,\n // Default to BAT Unit if available.\n '#default_value' => isset($target_entity_types['bat_unit']) ? 'bat_unit' : '',\n );\n }\n }\n\n if (!isset($event_type->is_new) && $event_type->fixed_event_states == 0) {\n $fields_options = array();\n\n $fields = field_info_instances('bat_event', $event_type->type);\n\n foreach ($fields as $field) {\n $fields_options[$field['field_name']] = $field['field_name'];\n }\n\n $form['events'] = array(\n '#type' => 'fieldset',\n '#group' => 'additional_settings',\n '#title' => t('Events'),\n '#tree' => TRUE,\n '#weight' => 80,\n );\n\n $form['events'][$event_type->type] = array(\n '#type' => 'select',\n '#title' => t('Select your default @event field', array('@event' => $event_type->label)),\n '#options' => $fields_options,\n '#default_value' => isset($event_type->default_event_value_field_ids[$event_type->type]) ? $event_type->default_event_value_field_ids[$event_type->type] : NULL,\n '#empty_option' => t('- Select a field -'),\n );\n }\n\n if (!isset($event_type->is_new)) {\n $fields_options = array();\n $fields = field_info_instances('bat_event', $event_type->type);\n\n foreach ($fields as $field) {\n $fields_options[$field['field_name']] = $field['field_name'];\n }\n\n $form['event_label'] = array(\n '#type' => 'fieldset',\n '#group' => 'additional_settings',\n '#title' => t('Label Source'),\n '#tree' => TRUE,\n '#weight' => 80,\n );\n\n $form['event_label']['default_event_label_field_name'] = array(\n '#type' => 'select',\n '#title' => t('Select your label field', array('@event' => $event_type->label)),\n '#default_value' => isset($event_type->default_event_label_field_name) ? $event_type->default_event_label_field_name : NULL,\n '#empty_option' => t('- Select a field -'),\n '#description' => t('If you select a field here, its value will be used as the label for your event. BAT will fall back to using the event state as the label if the field has no value.'),\n '#options' => $fields_options,\n );\n }\n\n $form['actions'] = array(\n '#type' => 'actions',\n '#tree' => FALSE,\n );\n $form['actions']['submit'] = array(\n '#type' => 'submit',\n '#value' => t('Save Event type'),\n '#weight' => 40,\n '#submit' => array('bat_event_type_form_submit'),\n );\n\n return $form;\n}", "function dgu_search_info_content_type_edit_form($form, &$form_state) {\n return $form;\n}", "public function edit(form $form)\n {\n //\n }", "public function edit($id)\n {\n $item_type = Item_Type::find($id);\n\n return view('admin_panel.item_types.edit',compact('item_type'));\n\n }", "public function edit($id)\n {\n $type = CardType::find($id);\n return view('admin.card_types.edit', compact('type'));\n }", "public function edit(ExpenceManagement $expenceManagement) {\n\t\t//\n\t}", "private function createEditForm(DetailsProduits $entity) {\n $form = $this->createForm(new DetailsProduitsType(), $entity, array(\n 'action' => $this->generateUrl('detailsproduits_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update'));\n\n return $form;\n }" ]
[ "0.68237865", "0.68237865", "0.68237865", "0.6719413", "0.6660235", "0.6604879", "0.6359982", "0.6317093", "0.6273309", "0.62707806", "0.6260954", "0.6246086", "0.623583", "0.6216477", "0.6207442", "0.6175922", "0.6148457", "0.61346316", "0.60801107", "0.6068831", "0.60631335", "0.60605335", "0.60427153", "0.60138726", "0.59505534", "0.59450394", "0.5925229", "0.5911338", "0.5908838", "0.5891496", "0.58840096", "0.5873607", "0.5857856", "0.5849346", "0.5840048", "0.5836062", "0.58300006", "0.5822154", "0.5813919", "0.5804997", "0.58048594", "0.57901555", "0.5780402", "0.5756643", "0.57551664", "0.5754136", "0.5746976", "0.5736705", "0.5732976", "0.5718534", "0.5712428", "0.5710377", "0.57056326", "0.5698946", "0.5694253", "0.56925535", "0.5679967", "0.56735414", "0.5671952", "0.566409", "0.5657632", "0.56545854", "0.56516635", "0.5637368", "0.563487", "0.5627733", "0.55936635", "0.55935144", "0.5585024", "0.55806917", "0.5579957", "0.5576996", "0.5576983", "0.5571517", "0.55670357", "0.55648535", "0.5564532", "0.55633307", "0.55633307", "0.55633307", "0.5562214", "0.55607563", "0.5557754", "0.55555457", "0.5539861", "0.5535699", "0.55354905", "0.5535234", "0.5531091", "0.5526646", "0.5519062", "0.55168736", "0.5508921", "0.55082226", "0.5506443", "0.55026066", "0.55000967", "0.5486707", "0.5484452", "0.5482718" ]
0.6558751
6
Update the specified Specification_type in storage.
public function update($id, UpdateSpecification_typeRequest $request) { $specificationType = $this->specificationTypeRepository->find($id); if (empty($specificationType)) { Flash::error('Specification Type not found'); return redirect(route('specificationTypes.index')); } $specificationType = $this->specificationTypeRepository->update($request->all(), $id); Flash::success('Specification Type updated successfully.'); return redirect(route('specificationTypes.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'50')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}", "public function update($data, $type = '')\n {\n }", "public function update(Request $request, Type $type)\n {\n //\n }", "public function update(Request $request, Type $type)\n {\n //\n }", "public function update(Request $request, ItemType $type)\n {\n $type->update($request->validate([\n 'manufacturer' => 'nullable|min:2',\n 'model' => 'nullable|min:2',\n 'stock_type' => ['nullable', Rule::in(ItemStockType::getValues())],\n ]));\n\n return response($type);\n }", "function _mongo_node_update_type($old_entity_type, $entity_type) {\n // Update collection names.\n _mongo_node_rename_collection($old_entity_type, $entity_type);\n\n // Update bundle name in mongo entities.\n $collection = mongodb_collection('fields_current', $entity_type);\n $result = $collection->update(\n array('_type' => $old_entity_type),\n array('$set' => array('_type' => $entity_type, 'type' => $entity_type))\n );\n}", "public function update($type, $id = null);", "public function update(Request $request, HouseType $type)\n {\n $request->validate(['type_name' => 'required|string']);\n\n $type->update(['type_name' => title_case($request->type_name)]);\n\n alert()->success('Updated Successfully');\n\n return redirect()->route('types.index');\n }", "public function update(TypeStoreRequest $request, types $type)\n {\n $type->update([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n // 'password' => Hash::make($request->password),\n ]);\n return redirect()->route('types.index')->with('message','Type updated Successfully');\n }", "public function update(Request $request, Type $type)\n {\n //\n $request -> validate([\n 'name' => 'required'\n ]);\n\n Type::update($request->all());\n\n return redirect()->route('type')\n ->with('success','แก้ไขหมวดหมู่อัลบั้มสำเร็จ');\n }", "public function update(Request $request, Type $type)\n {\n $this->validate($request, [\n 'name' => [\n 'max:50',\n Rule::unique('types', 'name')->ignore($type->name, 'name'), // 更新时排除自己的名称后,检查是否为唯一值\n ],\n 'sort' => 'nullable|integer',\n ]);\n\n $type->update($request->all());\n\n // return response([\n // 'data' => $type,\n // ], Response::HTTP_OK);\n return new TypeResource($type);\n }", "public function update(Request $request, Type $type)\n {\n Gate::authorize('edit-type', $type);\n $validationData = $request->validate([\n 'name' => 'required|min:2',\n ]);\n\n $type->update([\n 'name' => $validationData['name'],\n 'slug' => Str::slug($validationData['name']),\n 'user_id' => Auth::id()\n ]);\n return redirect()->route('admin.types.show', ['type' => $type->id])->with(\"success\", \"{$type->name} has been updated successfully\");\n }", "public function update(Request $request, MediaType $media_type)\n {\n if (!$media_type) {\n return redirect()->route('media_types.index')->with('error', 'Resource not found.');\n }\n\n $validator = Validator::make($request->all(), [\n 'label' => 'required|string|min:3',\n 'description' => 'required|string|min:3'\n ]);\n\n\n // validate inputs\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator->errors())\n ->withInput($request->all());\n } else {\n $media_type->name = $request->title ? Str::slug(Str::lower($request->label)) : $media_type->name;\n $media_type->label = $request->title ? $request->label : $media_type->label;\n $media_type->description = $request->description ? $request->description : $media_type->description;\n $media_type->save();\n\n // redirect\n toast('success', 'Update successful!');\n return redirect()->route('media_types.show', $media_type)->with('media_type', $media_type);\n }\n }", "public function update(Request $request, ProductProductType $productProductType)\n {\n //\n }", "public function updateDocument(string $documentType, array $document);", "private function upd(array $config) {\r\n switch ($config['type']) {\r\n case 'cart':\r\n case 'address':\r\n case 'cartConfig':\r\n case 'pwd':\r\n case 'config':\r\n case 'status_order':\r\n parent::update(\r\n ['type' => $config['type']],\r\n $config['data']\r\n );\r\n break;\r\n }\r\n }", "public function update(TypeRequest $request, Type $type)\n {\n $type->name = $request->name;\n\n if(!$type->isDirty())\n {\n return response()->json([\"error\" => 'se debe especificar al menos un valor diferente para actualizar', \"code\" => 422],422);\n }\n\n $type->save();\n\n return $this->showOne($type, 'type actulizado correctamente');\n }", "public function update(Request $request, PrizeType $prizeType)\n {\n //\n }", "public function update(Request $request, TypeThird $typeThird)\n {\n //\n }", "public function updated(PlugType $PlugType)\n {\n //\n }", "public function update(Request $request, IdentificationType $identificationType)\n {\n try{\n $input = $request->all();\n $validator = Validator::make($input,[\n 'name' => 'required'\n ]);\n if($validator->fails()){\n return $this->sendError('Validation Error.', $validator->errors());\n }\n $identificationType = IdentificationType::findOrFail($identificationType->id);\n $identificationType->update($request->all());\n $success['name'] = $identificationType->name;\n return $this->sendResponse($success, 'IdentificationType successfully updated.');\n }catch (\\Exception $exception){\n return $this->sendError('Error',[\"message\"=>$exception->getMessage(),\"line\"=>$exception->getLine()]);\n }\n\n }", "public function update(Request $request, Complainttype $complainttype)\n {\n //\n\n\n\n $complainttype_update = $complainttype->update($request->toArray());\n if ( $complainttype_update) {\n\n if (isset($request->complainttype_status) and $request->complainttype_status == '0') {\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Deleted');\n Session::flash('toastcontent', 'complainttype Deleted Successfully');\n } else {\n\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Success');\n Session::flash('toastcontent', 'complainttype updated Successfully');\n }\n } else {\n Session::flash('toasttype', 'error');\n Session::flash('toasttitle', 'Error');\n Session::flash('toastcontent', 'complainttype Not Updated');\n }\n\n return redirect()->route('complainttype.index');\n }", "public function setStorageType($storageType) {\n\t\t\n\t\t$this->_storageType = $storageType;\n\t}", "public function POS_it_checks_updateRec_att_type_changed() {\n // create the record to check\n $type = 'Bob';\n $taskType = new TaskType();\n $taskType->setType($type);\n $taskType->setDescription('was here');\n $taskType->created_at = Carbon::now();\n $taskType->updated_at = Carbon::now();\n $taskType->client_id = 1;\n $taskType->save();\n\n // create the changed record\n $changeType = 'Steve';\n\n $stdClass = new \\stdClass();\n $stdClass->id = $taskType->id;\n $stdClass->type = $changeType;\n $stdClass->desc = $taskType->getDescription();\n $stdClass->client_id = $taskType->client_id;\n\n $taskType->updateRec($stdClass);\n $result = $taskType::where('id', $taskType->getId())->first();\n\n $this->assertEquals($result->getType(), $changeType);\n }", "public function SetBackendStorage($data, $type = self::BACKENDSTORAGE_PERMANENT) {\n if ($type == self::BACKENDSTORAGE_STATE) {\n if (!$this->uuid)\n throw new StateNotYetAvailableException();\n\n // TODO serialization should be done in the StateMachine\n return $this->statemachine->SetState($data, $this->device->GetDeviceId(), IStateMachine::BACKENDSTORAGE, $this->uuid, $this->newStateCounter);\n }\n else {\n return $this->statemachine->SetState($data, $this->device->GetDeviceId(), IStateMachine::BACKENDSTORAGE, false, $this->device->GetFirstSyncTime());\n }\n }", "public function update(Request $request, PermitType $permit_type)\n {\n $data = $request->validate([\n 'abbreviation' => 'string|required',\n 'name' => 'string'\n ]);\n\n $permit_type->Abbreviation = $data['abbreviation'];\n\n if ($request->has('name'))\n $permit_type->Name = $data['name'];\n\n $permit_type->save();\n\n return response()->json([\n 'message' => lang('update_successful')\n ], 200);\n }", "function variant_set_type($variant, $type) {}", "public function update(TypeRequest $request, $id)\n {\n $type = Type::findOrFail($id);\n $path = base_path() . '/storage/app/type/';\n $input = $request->all();\n $file = null;\n if(Input::file('image')){\n $file = Input::file('image')->getClientOriginalName();\n }\n // echo $file;die;\n $uniqueSlug = $this->buildUniqueSlug('type', $request->id, $request->slug);\n $newFolderPath = $this->buildNewFolderPath($path, $file);\n $data = ['title' => $input['name'], 'slug' => $uniqueSlug, 'description' => $input['description'], 'is_active' => $input['is_active'],'updated_at' => date('Y:m:d H:i:s')];\n if(Input::file('image')){\n $data['image'] = $newFolderPath[0];\n }\n if(DB::table('type')->where('id', $id)->update($data)){\n if(Input::file('image')){\n File::delete($path.'/'.$type->image);\n Input::file('image')->move($path, $newFolderPath[0]);\n }\n }\n return redirect()->intended('admin/type');\n }", "public function update(Request $request, $deviceType)\n {\n $validator = Validator::make($request->all(), ['name' => 'required']);\n $validator->validate();\n\n $deviceType->update($request->all());\n\n return redirect()->route('devices.types.index');\n }", "public function update( Request $request, ProductType $productType )\n {\n \n $rules = array(\n 'producer' => 'required|numeric',\n 'name' => 'required|max:200',\n 'available' => 'required|numeric|between:0,1',\n );\n \n $error = Validator::make($request->all(), $rules);\n\n if($error->fails())\n {\n return response()->json(['errors' => $error->errors()->all()]);\n }\n\n \n\n // CHECK PRODUCER\n $producer = Producer::findOrFail($request->producer);\n \n if(!$request->hasFile('image')) {\n \n // IMAGE NOT CHANGED\n \n $data = array(\n 'name' => $request->name,\n 'image_ref' => $productType->image_ref,\n 'available' => $request->available,\n 'producer_id' => $producer->id\n );\n\n \n\n } else {\n \n // IMAGE CHANGED\n \n // UPLOAD IMAGE\n $image = $request->file('image');\n $new_name = rand() . '.' . $image->getClientOriginalExtension(); // Name of new Image\n $destination_path = \"/images/product_types\";\n\n\n \n $resize_image = Image::make($image->getRealPath());\n\n \n $dimension = max($resize_image->width(), $resize_image->height());\n\n // we need to resize image, otherwise it will be cropped \n\n if ($resize_image->width() > $dimension) { \n $resize_image->resize($dimension, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n }\n\n if ($resize_image->height() > $dimension) {\n $resize_image->resize(null, $dimension, function ($constraint) {\n $constraint->aspectRatio();\n }); \n }\n\n \n\n $resize_image->resizeCanvas($dimension, $dimension, 'center', false, '#ffffff');\n\n //return response()->json(['errors' => [$destination_path . '/' . $new_name]]);\n $resize_image->save(public_path($destination_path . '/' . $new_name));\n\n\n $old_image_path = $productType->image_ref;\n if(File::exists(public_path() . $old_image_path)) {\n File::delete(public_path() . $old_image_path);\n }\n\n $data = array(\n 'name' => $request->name,\n 'image_ref' => '/images/product_types/' . $new_name,\n 'available' => $request->available,\n 'producer_id' => $producer->id\n ); \n }\n \n \n\n if(isset($request->categories)) {\n $productType->categories()->sync($request->categories);\n //foreach($request->categories as $category_id) {\n //$productType Category::findOrFail($category_id);\n \n //}\n }\n\n $productType->update($data);\n \n return response()->json(['success' => 'Product Type Updated successfully.']);\n }", "public function update(Request $request, FormType $form_type)\n {\n $form_type->update($request->all());\n\n return redirect()->route('admin.form-type.index')->with('success', 'Form Type updated');\n }", "public function update(Request $request, PackageType $packageType)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'category' => 'required',\n 'image' => 'image|mimes:jpeg,png,jpg|max:10240',\n ]);\n\n $params = $request->all();\n\n //Add The Image\n if(!empty($request->file('image'))){\n $params['image'] = save_image( $request->file('image'), 'package_type');\n }\n\n try {\n $packageType->update($params);\n } catch (Exception $e) {\n return redirect()->back()->with('error_message','Sorry, Unable to Update Package Type.');\n } \n\n\n\n return redirect()->back()->with('success_message','Package Type Updated successfully!!');\n }", "public function update(Request $request, Ctype $ctype)\n {\n //\n }", "public function store(CreateSpecification_typeRequest $request)\n {\n $input = $request->all();\n\n $specificationType = $this->specificationTypeRepository->create($input);\n\n Flash::success('Specification Type saved successfully.');\n\n return redirect(route('specificationTypes.index'));\n }", "public function update($type, $elementid, $grade) {\n if ($this->type != $type || $this->elementid != $elementid || $this->grade != $grade) {\n global $DB;\n\n $this->type = $type;\n $this->elementid = $elementid;\n $this->grade = $grade;\n\n $record = new stdClass();\n $record->id = $this->id;\n $record->type = $this->type;\n $record->elementid = $this->elementid;\n $record->grade = $this->grade;\n\n $DB->update_record('ddtaquiz_condition_part', $record);\n }\n }", "public function updateSpecification($updateData)\n {\n return Specification::bunchUpdate($updateData, '_id');\n }", "function updateRegistrationType(&$registrationType) {\n\t\t$expiryDate = $registrationType->getExpiryDate();\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE registration_types\n\t\t\t\tSET\n\t\t\t\t\tsched_conf_id = ?,\n\t\t\t\t\tcost = ?,\n\t\t\t\t\tcurrency_code_alpha = ?,\n\t\t\t\t\topening_date = %s,\n\t\t\t\t\tclosing_date = %s,\n\t\t\t\t\texpiry_date = %s,\n\t\t\t\t\taccess = ?,\n\t\t\t\t\tinstitutional = ?,\n\t\t\t\t\tmembership = ?,\n\t\t\t\t\tpub = ?,\n\t\t\t\t\tseq = ?,\n\t\t\t\t\tcode = ?\n\t\t\t\tWHERE type_id = ?',\n\t\t\t\t$this->dateToDB($registrationType->getOpeningDate()),\n\t\t\t\t$this->datetimeToDB($registrationType->getClosingDate()),\n\t\t\t\t$expiryDate === null?'null':$this->datetimeToDB($expiryDate)\n\t\t\t), array(\n\t\t\t\t(int) $registrationType->getSchedConfId(),\n\t\t\t\t(float) $registrationType->getCost(),\n\t\t\t\t$registrationType->getCurrencyCodeAlpha(),\n\t\t\t\t(int) $registrationType->getAccess(),\n\t\t\t\t(int) $registrationType->getInstitutional(),\n\t\t\t\t(int) $registrationType->getMembership(),\n\t\t\t\t(int) $registrationType->getPublic(),\n\t\t\t\t(float) $registrationType->getSequence(),\n\t\t\t\t$registrationType->getCode(),\n\t\t\t\t(int) $registrationType->getTypeId()\n\t\t\t)\n\t\t);\n\t\t$this->updateLocaleFields($registrationType);\n\t\treturn $returner;\n\t}", "public function updateType(Request $request)\n {\n /*--------- Validating Data -------------------*/\n $rules = array (\n 'SolarTypeName' => 'required',\n 'SolarTypePrice' => 'required|max:7',\n );\n\n $validator = Validator::make($request->all(), $rules);\n if ($validator->fails()) {\n return Redirect::back()->withErrors($validator)->withInput();\n }\n\n $update = SolarPanelType::where('id', $request->KeyToEdit)\n ->update([\n 'solarTypeName' => $request->SolarTypeName,\n 'price' => $request->SolarTypePrice,\n ]);\n\n // if success\n if ($update) {\n alert()->success('saved with success!', 'Done!');\n return Redirect()->back();\n }\n alert()->danger('Failed to save', 'Oops!');\n return Redirect()->back();\n\n }", "public function update(Request $request, $id)\n {\n $this->validate(request(), [\n 'id' => 'exists:specifications',\n 'name' => 'required|string',\n 'type' => 'required|string',\n 'jsonOptions' => 'json'\n ]);\n\n $validator = new JSONValidate;\n\n $json = json_decode(request('jsonOptions'));\n //Check each option for valid format\n\n foreach($json as $obj) {\n $validator->validate(\n $obj,\n (object)[\n \"type\"=>\"object\",\n \"properties\"=>(object)[\n \"label\"=>(object)[\n \"type\"=>\"string\",\n \"required\"=>true\n ],\n \"value\"=>(object)[\n \"type\"=>\"string\",\n \"required\"=>true\n ],\n ]\n ],\n Constraint::CHECK_MODE_NORMAL\n ); //validates, and sets defaults for missing properties\n }\n\n\n if ($validator->isValid()) {\n try {\n $spec = Specification::find($id);\n $spec->name = request('name');\n $spec->slug = $this->createSlug(request('name'));\n $spec->type = request('type');\n $spec->options = request('jsonOptions');\n $spec->save();\n \\Session::flash('flash_created',request('name') . ' has been edited');\n return redirect('/admin/specifications');\n }\n catch(QueryException $e) {\n \\Session::flash('flash_deleted','Error Editing Specification');\n return redirect('/admin/specifications');\n }\n\n } else {\n return redirect('/admin/specifications/create')->withErrors(\"Error, Invalid Options\");\n }\n\n }", "public function setType( Quantifier $type ): void {\n\t\t\t$this->type = $type;\n\t\t}", "public function updateAdType($type_id, $type_name, $is_available)\n {\n $query = \"UPDATE adv_type SET name = $type_name, is_available=$is_available WHERE id = $type_id\";\n return $this->getQueryResult($query, $this->getConnection());\n }", "public function update(): void\n {\n // Update quality\n $this->item->quality = self::QUALITY_MAX;\n }", "public function update(ClaimTypeRequest $request, ClaimType $claim_type)\n {\n $claim_type->update($request->all());\n return new ClaimTypeResource($claim_type); \n }", "private function updateTypeChangeStorage( $params = array() ){\r\n\t\t$new_changes = array();\r\n\t\t\r\n\t\t// determine what configuration value key we're working with..\r\n\t\t$cfg_key = ($params['type'] === 'International'\r\n\t\t\t\t?\r\n\t\t\t'MODULE_SHIPPING_USPS_INTL_TYPE_CHANGE_DETECTED'\r\n\t\t\t\t:\r\n\t\t\t'MODULE_SHIPPING_USPS_DMSTC_TYPE_CHANGE_DETECTED'\r\n\t\t);\r\n\t\t\r\n\t\t// query existing changes..\r\n\t\t$q = tep_db_query(\"\r\n\t\t\tSELECT\t\r\n\t\t\t\tconfiguration_value\r\n\t\t\tFROM\r\n\t\t\tIXcore.\" . TABLE_CONFIGURATION . \"\t\r\n\t\t\tWHERE\r\n\t\t\t\tconfiguration_key = '\" . $cfg_key . \"'\r\n\t\t\");\r\n\t\t\r\n\t\t// fetch result; older PHP version compatible, so ugly..\r\n\t\t$r = tep_db_fetch_array($q);\r\n\t\t$existing_changes = json_decode($r['configuration_value'], true);\r\n\t\t\t\t\r\n\t\t// remove any change that have been added..\r\n\t\t$changes_added = false;\r\n\t\tforeach( $existing_changes as $k => $change ){\r\n\t\t\tif( in_array($change, ($params['type'] === 'International'\r\n\t\t\t\t\t?\r\n\t\t\t\t$this->intl_types\r\n\t\t\t\t\t:\r\n\t\t\t\t$this->types\r\n\t\t\t)) ){\r\n\t\t\t\tunset($existing_changes[$k]);\r\n\t\t\t\t$changes_added = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// check for new changes..\r\n\t\tforeach( $params['changes'] as $change ){\r\n\t\t\tif( ! in_array($change, $existing_changes) ){\r\n\t\t\t\t$new_changes[] = $change;\r\n\t\t\t} \r\n\t\t}\r\n\t\t\r\n\t\t// if changes have been added or we've got new changes, update the db..\r\n\t\tif( $changes_added || $new_changes ){\r\n\t\t\ttep_db_query(\"\r\n\t\t\t\tUPDATE\t\r\n\t\t\t\tIXcore.\" . TABLE_CONFIGURATION . \"\t\r\n\t\t\t\tSET\r\n\t\t\t\t\tconfiguration_value = '\" . tep_db_input(\r\n\t\t\t\t\t\tjson_encode(array_merge(\r\n\t\t\t\t\t\t\t$existing_changes,\r\n\t\t\t\t\t\t\t$new_changes\r\n\t\t\t\t\t\t))\r\n\t\t\t\t\t) . \"'\r\n\t\t\t\tWHERE\r\n\t\t\t\t\tconfiguration_key = '\" . $cfg_key . \"'\r\n\t\t\t\");\r\n\t\t}\r\n\t\t\r\n\t\treturn $new_changes;\r\n\t}", "public function update(GameType $gametype, Request $request)\n {\n\n $gametype->description = ucwords($request->description);\n $gametype->medal_points = $request->medal_points;\n $gametype->save();\n\n return response()->json(['title' => 'Game Type']);\n }", "function _mongo_node_update_bundle($entity_type, $old_bundle, $bundle) {\n\n // Update bundle name in ids collection.\n $collection = mongodb_collection($entity_type . '_ids');\n\n $result = $collection->update(\n array('bundle' => $old_bundle),\n array('$set' => array('bundle' => $bundle))\n );\n\n // Update bundle name in mongo entities.\n $collection = mongodb_collection('fields_current', $entity_type);\n $result = $collection->update(\n array('_bundle' => $old_bundle, '_type' => $entity_type),\n array('$set' => array('_bundle' => $bundle, 'type' => $bundle))\n );\n}", "protected function update(QuantityType $quantity_type, array $data)\n {\n $quantity_type->name = $data['name'];\n $quantity_type->description = $data['description'];\n\n $quantity_type->save();\n\n return $quantity_type;\n }", "public function updateType(Request $request, $id)\n {\n $type = ExpenseType::find($id);\n $type->name = $request->name;\n $type->save();\n Flash::success(trans('general.successfully_saved'));\n return redirect('expense/type/data');\n }", "public function update(Request $request, QualityRecord $qualityRecord)\n {\n //\n }", "public function setType($type, $agentSchemeNumber) {\n\n $allTypes = $this->getAllTypes();\n foreach($allTypes as $key => $val) {\n switch($val) {\n case 'historicaccount':\n if ($type == Model_Core_Agent_Type::HISTORIC_ACCOUNT) {\n $translatedType = $key;\n break 2;\n }\n break;\n case 'newcustomer':\n if ($type == Model_Core_Agent_Type::NEW_CUSTOMER) {\n $translatedType = $key;\n break 2;\n }\n break;\n case 'returningcustomer':\n if ($type == Model_Core_Agent_Type::RETURNING_CUSTOMER) {\n $translatedType = $key;\n break 2;\n }\n break;\n case 'legalentitychange':\n if ($type == Model_Core_Agent_Type::LEGAL_ENTITY_CHANGE) {\n $translatedType = $key;\n break 2;\n }\n break;\n }\n }\n\n $where = $this->getAdapter()->quoteInto('agentschemeno = ?', $agentSchemeNumber);\n $update = $this->update(array('NEWAGENTTYPELOOKUPID' => $translatedType), $where);\n }", "function update_sample_type($edit_sample_type, $sample_type_manual_id, $sample_type_name, $sample_type_description, $status) {\r\n\t\tglobal $db;\r\n\t\t$query = \"UPDATE sample_types SET\r\n\t\t\tsample_type_manual_id='\".$sample_type_manual_id.\"',\r\n\t\t\tsample_type_name='\".$sample_type_name.\"',\r\n\t\t\tsample_type_description='\".$sample_type_description.\"',\r\n\t\t\tstatus='\".$status.\"'\r\n\t\t\tWHERE sample_type_id='\".$edit_sample_type.\"'\r\n\t\t\";\r\n\t\t$result = $db->query($query) or die($db->error);\r\n\t\t\r\n\t\treturn 'Sample was updated successfuly.';\t\r\n\t}", "public static function save( $name, $type ){\n if ( isset( $_REQUEST ) && isset( $_REQUEST['_wpnonce'] ) && wp_verify_nonce( $_REQUEST['_wpnonce'], 'wprds_nonce_check' ) == 1 ) {\n $post_data = $_REQUEST[ self::$options_name ];\n $value = isset( $post_data[ $name ] ) ? $post_data[ $name ] : null;\n switch ( $type ) {\n case 'text':\n case 'password':\n update_option( $name, sanitize_text_field( $value ) );\n break;\n case 'textarea':\n update_option( $name, sanitize_textarea_field( $value ) );\n break;\n case 'multiselect':\n update_option( $name, $value );\n break;\n case 'select':\n update_option( $name, $value );\n break;\n case 'checkbox':\n $value = isset( $value ) ? true : false;\n update_option( $name, $value );\n break;\n }\n }\n }", "public function update(Request $request, UserType $userType)\n {\n //\n }", "public function update(Request $request)\n {\n $p;\n switch($request->product_type){\n case 'simple': \n $p = Product::where('id', $request->id)->first();\n\n $p->product_name = $request->product_name;\n $p->product_sku = $request->product_sku;\n $p->product_slug = $request->product_name;\n $p->product_category = $request->product_category;\n $p->product_brand = $request->product_brand;\n $p->product_short_desc = $request->product_short_desc;\n $p->product_long_desc = $request->product_long_desc;\n $p->product_type = $request->product_type;\n $p->product_mrp = $request->product_mrp;\n $p->product_price = $request->product_price;\n $p->product_quantity = $request->product_quantity;\n $p->product_primary_image = $request->product_primary_image;\n $p->product_other_images = !empty($request->product_other_images) ? $request->product_other_images : null;\n $p->product_meta_keywords = $request->product_meta_keywords;\n $p->product_meta_desc = $request->product_meta_desc;\n $p->product_published = $request->product_published;\n $p->product_featured = ($request->product_featured == true) ? 1 : 0;\n $p->product_tags = $request->product_tags;\n $p->product_dimensions = $request->product_dimensions;\n $p->updated_at = Carbon::now();\n $p->save();\n\n break;\n case 'affiliate': \n $p = Product::where('id', $request->id)->first();\n\n $p->product_name = $request->product_name;\n $p->product_sku = $request->product_sku;\n $p->product_slug = $request->product_name;\n $p->product_category = $request->product_category;\n $p->product_brand = $request->product_brand;\n $p->product_affiliate_link = $request->product_affiliate_link;\n $p->product_short_desc = $request->product_short_desc;\n $p->product_long_desc = $request->product_long_desc;\n $p->product_type = $request->product_type;\n $p->product_mrp = $request->product_mrp;\n $p->product_price = $request->product_price;\n $p->product_quantity = 0;\n $p->product_primary_image = $request->product_primary_image;\n $p->product_other_images = !empty($request->product_other_images) ? $request->product_other_images : null;\n $p->product_meta_keywords = $request->product_meta_keywords;\n $p->product_meta_desc = $request->product_meta_desc;\n $p->product_published = $request->product_published;\n $p->product_featured = ($request->product_featured == true) ? 1 : 0;\n $p->product_tags = $request->product_tags;\n $p->product_dimensions = $request->product_dimensions;\n $p->updated_at = Carbon::now();\n $p->save();\n\n break;\n case 'variable': break;\n }\n \n return response()->json($p, 200);\n }", "public function trackProfileUpdate(int $type)\n {\n $this->engagement->setType($type);\n $this->saveTracker();\n }", "public function setType(?string $type): void;", "public function update(AuditTypeRequest $request, $id)\n\t{\n\t\t$auditType = AuditType::findOrFail($id);;\n $auditType->name = $request->name;\n $auditType->description = $request->description;\n $auditType->user_id = Auth::user()->id;\n\t}", "public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}", "public function updateQuality(): void\n {\n foreach ($this->items as $item) {\n switch ($item->name) {\n\n case $this->checkItemType($item->name, 'Aged Brie'):\n $itemType = new AgedBrie($item);\n $this->itemTypeUpdateQuality($itemType);\n break;\n\n case $this->checkItemType($item->name, 'Backstage passes'):\n $itemType = new BackstageTicket($item);\n $this->itemTypeUpdateQuality($itemType);\n break;\n\n case $this->checkItemType($item->name, 'Sulfuras'):\n $itemType = new Sulfuras($item);\n $this->itemTypeUpdateQuality($itemType);\n break;\n\n case $this->checkItemType($item->name, 'Conjured'):\n $itemType = new Conjured($item);\n $this->itemTypeUpdateQuality($itemType);\n break;\n\n default:\n $itemType = new Common($item);\n $this->itemTypeUpdateQuality($itemType);\n }\n }\n }", "public function update(Request $request, $type)\n {\n if ('profile' == $type) {\n $this->updateProfile($request);\n } else {\n $this->updatePassword($request);\n }\n\n return redirect()->action('Backend\\Admin\\ProfileController@index');\n }", "public function setType($type) {}", "public function update($id, TypeRequest $request)\n {\n\n $updatedType = $this->typeRepo->update($id, $request->all());\n\n if ($updatedType) {\n\n \\Session::flash('success', 'Apprasial order Type was successfully updated!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n \n } else {\n\n \\Session::flash('error', 'Something was wrong!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n }\n }", "public function update(Request $request, CompanyType $companyType)\n {\n $this->validate($request, [\n \"name\" => \"required|string|max:255\",\n \"description\" => \"required|string\",\n ]);\n\n $data = [\n 'name' => $request->name,\n 'description' => $request->description,\n ];\n\n $companyType->fill($data);\n\n if ($companyType->save()) {\n Toastr::success(\"Successfully Company Type Updated\", \"Success\");\n } else {\n Toastr::error(\"Something Went Worng!\", \"Error\");\n }\n return redirect()->back();\n }", "public function updateEntityType($entityTypeId, $request)\n {\n return $this->start()->uri(\"/api/entity/type\")\n ->urlSegment($entityTypeId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }", "public static function update_data($img_data, $type) {\n\t\t// Open database isntance for beginning and committing\n\t\t$db = Database::instance();\n\n\t\t// Begin transaction\n\t\t$db->begin();\n\n\t\tforeach ($img_data AS $id => $values) {\n\t\t\ttry {\n\t\t\t\t$query = DB::update($type.'s')->set($values)->where('id', '=', $id)->execute();\n\t\t\t}\n\t\t\tcatch (Exception $e) {\n\t\t\t\techo $e->getMessage().'<br />';\n\t\t\t}\n\t\t}\n\n\t\t// Commit transaction\n\t\t$db->commit();\n\t}", "public function update(Request $request, ClassType $classType, Student $student)\n {\n //\n }", "public function updateRequest($object_type, $object_type_definition_patch)\n {\n // verify the required parameter 'object_type' is set\n if ($object_type === null || (is_array($object_type) && count($object_type) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $object_type when calling update'\n );\n }\n // verify the required parameter 'object_type_definition_patch' is set\n if ($object_type_definition_patch === null || (is_array($object_type_definition_patch) && count($object_type_definition_patch) === 0)) {\n throw new \\InvalidArgumentException(\n 'Missing the required parameter $object_type_definition_patch when calling update'\n );\n }\n\n $resourcePath = '/crm/v3/schemas/{objectType}';\n $formParams = [];\n $queryParams = [];\n $headerParams = [];\n $httpBody = '';\n $multipart = false;\n\n\n\n // path params\n if ($object_type !== null) {\n $resourcePath = str_replace(\n '{' . 'objectType' . '}',\n ObjectSerializer::toPathValue($object_type),\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($object_type_definition_patch)) {\n if ($headers['Content-Type'] === 'application/json') {\n $httpBody = \\GuzzleHttp\\json_encode(ObjectSerializer::sanitizeForSerialization($object_type_definition_patch));\n } else {\n $httpBody = $object_type_definition_patch;\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 = ObjectSerializer::buildQuery($formParams);\n }\n }\n\n // this endpoint requires OAuth (access token)\n if (!empty($this->config->getAccessToken())) {\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 = ObjectSerializer::buildQuery($queryParams);\n return new Request(\n 'PATCH',\n $this->config->getHost() . $resourcePath . ($query ? \"?{$query}\" : ''),\n $headers,\n $httpBody\n );\n }", "public function setType($type){ }", "public function setCapabilityType($type = 'post'){\n\t\t$this->capabilityType = $type;\n\t}", "public function updatePivot(Request $request, Category $category, Specification $specification)\n {\n $this->updatePivotValidator($request->all());\n\n $category->specifications()\n ->updateExistingPivot($specification->id, [\n \"title\" => $request->get(\"title\"),\n \"filter\" => $request->has(\"filter\") ? 1 : 0,\n \"priority\" => $request->get(\"priority\", 1)\n ]);\n event(new CategorySpecificationUpdate($category));\n return redirect()\n ->route(\"admin.categories.specifications.index\", [\"category\" => $category])\n ->with(\"success\", \"Успешно обновлено\");\n }", "public function update(Request $request, $type=null,$item_id,$id)\n {\n //\n }", "public function update(Request $request, $id)\n {\n\n $jobtype = Jobtype::find($id);\n $jobtype->user_id = Auth::id();\n $jobtype->job_type = $request->job_type;\n $jobtype->description = $request->description;\n $jobtype->save();\n }", "public function updateType($objectType) {\n\t\tthrow new CmisNotImplementedException(\"updateType\");\t\t\n\t}", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "private static function _setFileSpecification(\\SetaPDF_Core_Type_Dictionary $dict, $fileSpecification) {}", "public function update(Request $request, ProductType $productType)\n {\n $productType->update($request->all());\n return redirect()->route('admin.product-types.edit', $productType)->withSuccess('Запись успешно обновлена');\n }", "public function save(Type $type) {\n $typeData = array(\n 'name_ET' => $type->getName()\n );\n\n if ($type->getNum()) {\n // The type has already been saved : update it\n $this->getDb()->update('eventtype', $typeData, array('num_ET' => $type->getNum()));\n } else {\n // The type has never been saved : insert it\n $this->getDb()->insert('eventtype', $typeData);\n // Get the id of the newly created type and set it on the entity.\n $id = $this->getDb()->lastInsertId();\n $type->setNum($id);\n }\n }", "public function update(Request $request, Companytype $companytype)\n {\n $request->validate([\n 'name' => 'required',\n ]);\n\n $companytype->update($request->all());\n\n return redirect()->route('companytypes.index');\n }", "public function update(Request $request, $id,$type)\n {\n if($type == 1){\n $q = QandA::findOrFail($id);\n $q->qa_state = !$q->qa_state;\n $q->save();\n return redirect()->back()->withSuccess('Done');\n }else{\n $data = $request->validate([\n 'question' => 'required|min:10',\n 'answer' => 'required|min:10',\n ]);\n $q = QandA::findOrFail($id);\n $q->qa_q = $request->question;\n $q->qa_a = $request->answer;\n $q->qa_state = isset($request->state) ? 1 : 0;\n $q->save();\n return redirect()->back()->withSuccess('Done');\n }\n }", "public function updateCart($type, $quantity) {\n\t\t$this->order[$type] = $quantity;\n\t}", "public function setType(?string $type): void\n {\n }", "public function set_type($type) {\n $this->update([\n 'type' => $type\n ]);\n\n $this->type = $type;\n\n // finish configuring this OrderExchange\n $this->sync();\n }", "public function update(Request $request)\n {\n //\n $request['StorageType_Id'] = $request->get('StorageTypes');\n unset($request['StorageTypes']);\n \n $storageCategories = StorageCategories::findOrFail($request->category_id);\n $storageCategories->update($request->all());\n\n //return $priceCategories;\n return back();\n }", "public function update(Request $request, TypeArchive $typeArchive)\n {\n //\n }", "public function update_type_record($data, $id){\n\t\t$this->db->where('training_type_id', $id);\n\t\tif( $this->db->update('training_types',$data)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\t\t\n\t}", "protected function _afterSave(Mage_Core_Model_Abstract $type)\n {\n $attributeSet = $type->getAttributeSet();\n $attributeSetName = $type->getName() . ' {' . $type->getIdentifier() .'}';\n\n if($attributeSet->getAttributeSetName() != $attributeSetName){\n $attributeSet->setAttributeSetName($attributeSetName);\n $attributeSet->save();\n }\n\n return parent::_afterSave($type);\n }", "public function should_update($type, $item, $context)\n {\n }", "public function update(Request $request, TypesConges $typesConges)\n {\n //\n }", "public static function forge($type = 'db', $config = null)\n\t{\n\t\t// validate the type\n\t\tif (empty($type) or ! is_string($type))\n\t\t{\n\t\t\tthrow new \\RuntimeException('FOU-028: Specified storage type must be a string value');\n\t\t}\n\n\t\t// create and return the requested storage instance\n\t\treturn static::getDic()->resolve('storage.'.$type, array($config));\n\t}", "public function save(\n\t $type = 'SYSTEM'\n\t )\n\t{\n\t}", "public function update(Request $request, PavaneType $pavaneType)\n {\n //\n }", "public function update_articaltypelist($id,$updatedarticalname){\n $sql22 = \"update artical_types set artical_type='$updatedarticalname' where id='$id'\";\n $result22 = mysqli_query($this->db,$sql22);\n return $result22;\n }", "public function update(Request $request, $productType_id, $id)\n {\n $input = $request->all();\n $product = Product::findOrFail($id);\n if($product->name == $input['product-name'] || !Product::where('product_type_id', $productType_id)->where('name', $input['product-name'])->first()){\n $product->name = $input['product-name'];\n $product->price = $input['product-price'];\n $product->save();\n $productAttributeValues = $product->attributeValues;\n $product->attributeValues()->detach();\n foreach($input['product-attributeValues'] as $name => $value){\n $attribute = Attribute::where('name', $name)->first();\n $attributeValue = new AttributeValue;\n $attributeValue->attribute_id = $attribute->id;\n $hasFound = false;\n foreach($attribute->attributeValues as $attrVal){\n if($attrVal->value == $value){\n $product->attributeValues()->save($attrVal);\n $hasFound = true;\n break;\n }\n }\n if(!$hasFound){\n $attributeValue->value = $value;\n $product->attributeValues()->save($attributeValue);\n }\n }\n foreach($productAttributeValues as $productAttributeValue){\n if(count($productAttributeValue->products) == 0){\n $productAttributeValue->delete();\n }\n }\n }\n return $this->index($productType_id);\n }", "function update($query, $param_type, $param_value_array) {\n $sql = $this->connection->prepare($query);\n $this->bindQueryParams($sql, $param_type, $param_value_array);\n $sql->execute();\n }", "public function update(Request $request, $sol_type_id)\n {\n $lsegm = previous_segment($request);\n //$segmentos = $request->segments(); //de la actual URL\n $maxSol = solicitudType::all()->count();\n $rules = [\n 'name'=>'required',\n 'orderBy'=>['required','integer','digits_between:1,'.$maxSol]\n ];\n if($lsegm[2]!=$sol_type_id){\n $rules = array_add($rules,'solType_cod','required'); //esto generar un error en la vista\n }\n $this->validate($request,$rules);\n $data = $request->all();\n //guardo nombre en la BD\n $solicitudType = solicitudType::where('id',$sol_type_id)->first();\n $solicitudType->name = $data['name'];\n $solicitudType->save();\n //actualizo la posición (debo modificar la posicion de otros registros)\n $actOrder = $solicitudType->orderBy;\n $newOrder = $data['orderBy'];\n if($actOrder!=$newOrder){\n update_other_orderBy($actOrder,$newOrder,get_class($solicitudType));\n $solicitudType->orderBy = $newOrder;\n $solicitudType->save();\n }\n return redirect()->route('solicitudeTypes');\n }", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);", "public function setType($type);" ]
[ "0.6288913", "0.6018423", "0.59911406", "0.59911406", "0.588655", "0.58472097", "0.5689344", "0.5671953", "0.56371284", "0.56031495", "0.5590668", "0.5552451", "0.54424405", "0.5436249", "0.5380119", "0.5378809", "0.5376139", "0.5363912", "0.53624606", "0.5334468", "0.5261503", "0.5257268", "0.52525926", "0.52479124", "0.5229666", "0.5223163", "0.51752484", "0.51746446", "0.5167868", "0.5158204", "0.5155639", "0.5144275", "0.5141348", "0.5136218", "0.5135619", "0.51341075", "0.51315755", "0.5111041", "0.51031536", "0.50923914", "0.50782865", "0.5072233", "0.50701654", "0.5064359", "0.5055703", "0.50522393", "0.5045899", "0.50312907", "0.5030555", "0.503033", "0.5025843", "0.5023112", "0.5020647", "0.5016252", "0.5014669", "0.5014165", "0.5010459", "0.50043976", "0.49903762", "0.49814522", "0.49774513", "0.49770188", "0.49659884", "0.49638093", "0.4959518", "0.4955557", "0.49553216", "0.49536255", "0.4951158", "0.4944043", "0.49414077", "0.49389035", "0.49272308", "0.4924296", "0.49217114", "0.49163762", "0.49161634", "0.49160817", "0.49098182", "0.49030194", "0.48940426", "0.48929664", "0.48878402", "0.48767102", "0.48763478", "0.4868417", "0.4865918", "0.48599413", "0.48569155", "0.48526865", "0.4838286", "0.48366928", "0.48349103", "0.48211318", "0.48166013", "0.4814612", "0.4814612", "0.4814612", "0.4814612", "0.4814612" ]
0.620051
1
Remove the specified Specification_type from storage.
public function destroy($id) { $specificationType = $this->specificationTypeRepository->find($id); if (empty($specificationType)) { Flash::error('Specification Type not found'); return redirect(route('specificationTypes.index')); } $this->specificationTypeRepository->delete($id); Flash::success('Specification Type deleted successfully.'); return redirect(route('specificationTypes.index')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function remove($typeId);", "public function destroy(Type $type)\n {\n //\n }", "public function destroy(Type $type)\n {\n //\n }", "protected function remove($type)\n {\n unset($this->alerts[$type]);\n }", "public function removeConditionByType($type)\n {\n $toRemoves = $this->getConditions()->filter(function ($item) use ($type) {\n return $item->getType() === $type;\n });\n\n $toRemoves->each(function ($item, $key) use ($type) {\n $this->conditions->forget($key);\n\n $this->getCartItemCollection()->each(function ($item) use ($type) {\n $item->removeConditionByType($type);\n });\n });\n }", "function timetracking_type_delete(timetrackingType $type) {\n $type->delete();\n}", "public function destroy(ItemType $type)\n {\n //\n }", "public function wipe($type) {\n\t\t$table = $this->safeTable($type);\n\t\t$this->adapter->exec(\"DELETE FROM $table\");\n\t}", "public function removeConditionsByType($type)\n {\n $this->getConditionsByType($type)->each(function ($condition) {\n $this->removeCartCondition($condition->getName());\n });\n }", "public function deleteByIdType($id, $type);", "public function removeType($type)\n {\n foreach ($this->fields as $fieldname => $field) {\n if ($field->type == $type) {\n unset($this->fields[$fieldname]);\n }\n }\n return $this;\n }", "public function remove(string $instanceType)\n {\n $widget = $this->getWidgetByInstanceType($instanceType);\n $this->resourceModel->delete($widget);\n }", "public function destroy(Companytype $companytype)\n {\n //\n }", "public function delete($name, $type)\n {\n $this->memcached->delete($this->generateKey($name, $type));\n }", "public function removeData($type, $id)\n { \n if($type == 'section'){\n Category_sections::destroy($id);\n }elseif($type == 'question'){\n Section_questions::destroy($id);\n }elseif($type == 'answer'){\n Question_answers::destroy($id);\n }\n \n return response()->json(['success' => 1]); \n \n }", "public function clearStore(string $type = null)\n {\n if($type === null)\n {\n $this->_store = [];\n }\n else\n {\n unset($this->_store[$type]);\n }\n }", "public function clearDataByType($type) {\n $sql = 'DELETE shadow_objects.*, shadow_object_relations.* FROM shadow_object_relations LEFT JOIN shadow_objects ON shadow_object_relations.real_object_id = shadow_objects.id WHERE shadow_objects.type = ?';\n $this->database->execute($sql, array($type));\n\n $sql = 'DELETE from `shadow_meta` WHERE type = ?';\n $this->database->execute($sql, array($type));\n }", "public function drop ()\n {\n //delete the records of the lookup value\n $records = LookupValue::where('lookup_type_id', 1)->get();\n foreach ( $records as $record )\n $record->forceDelete();\n\n //delete the lookup definition itself\n $record = LookupType::find(1);\n $record->forceDelete();\n }", "function clearType($type) {\n $keyGroups = array();\n $theKey = 'keyGroup' . ucfirst($type);\n if (isset($this->$theKey)) {\n $keyGroups = $this->$theKey;\n }\n\n $cache = Zend_Registry::get('cache');\n $keys = $cache->get('SITEKEYS');\n foreach ($keyGroups AS $keyGroup) {\n if (isset($keys[$keyGroup])) {\n foreach ($keys[$keyGroup] AS $singleKey) { \n $cache->remove($singleKey);\n } \n $keys[$keyGroup] = array();\n }\n }\n $cache->set($keys, 'SITEKEYS');\n }", "public function remove($type)\n {\n $rsp = new Response();\n\n if(!isAuthorized::isAdmin())\n {\n $rsp->setFailure(401, \"You are not authorized to do this action.\")\n ->send();\n\n return;\n }\n\n if($type === \"word\" && isset($_POST['word']))\n return $this->removeWord();\n\n if($type === \"email\" && isset($_POST['email']))\n return $this->removeEmail();\n\n $rsp->setFailure(400, \"Your request couldn't be executed. Check for wrong arguments or missing values.\")\n ->send();\n }", "public function deleting($educationType)\n {\n\t\tparent::deleting($educationType);\n\n }", "public function destroy(TypeThird $typeThird)\n {\n //\n }", "public function destroy(Type $type)\n {\n $type->employees()->delete();\n $type->delete();\n\n return $this->showMessage('type eliminado correctamente');\n }", "public function deleteType($type){\n\t\t$user = $this->getUser();\n\t\tif(!isset($user[\"id\"])||$user[\"status\"]!=DBConfig::$userStatus[\"admin\"]){\n\t\t\treturn false;\n\t\t}\n\t\t$type = $this->getType($type);\n\t\tif(!isset($type[\"id\"]))return false;\n\t\t$query = Queries::deletetype($type[\"id\"]);\n\t\t$result = $this->query($query);\n\t\tif(!$result)return false;\n\t\t$this->log(\"@\".$user[\"id\"].\" (\".$user[\"username\"].\") deletes type $type\");\n\t\t$query = Queries::removetypefromentries($type[\"id\"]);\n\t\treturn $this->query($query);\n\t}", "public function remove(string $type): static\n {\n // Remove provider reference\n unset(\n $this->store[$type],\n $this->providers[$type]\n );\n\n\n // Get binding\n if (isset($this->bindings[$type])) {\n $binding = $this->bindings[$type];\n } elseif (isset($this->aliases[$type])) {\n $binding = $this->bindings[$this->aliases[$type]];\n } else {\n return $this;\n }\n\n $type = $binding->getType();\n\n\n // Remove alias\n if (null !== ($alias = $binding->getAlias())) {\n unset($this->aliases[$alias]);\n }\n\n if (null !== ($alias = $binding->getTargetType())) {\n unset($this->aliases[$alias]);\n }\n\n // Remove binding\n unset($this->bindings[$type]);\n return $this;\n }", "public function destroy(N_prefcontrtype $n_prefcontrtype)\n {\n //\n }", "public function deleteWithType(string $aggregateType): void;", "protected function delete($key, $type) {\n $file = $this->config['cachePath'] . '/' . $key . '.' . $type;\n\n if(is_numeric($this->config['expiry'])) {\n if(file_exists($file))\n unlink($file);\n } else {\n $cacheKey = substr($key, 0, strrpos($key, '-'));\n if($match = glob($this->config['cachePath'] . '/' . $cacheKey . '-*.' . $type)) {\n foreach($match as $path)\n unlink($path);\n }\n }\n }", "public function delete($name, $type)\n {\n return apc_delete($type . $name);\n }", "public function destroy(PrizeType $prizeType)\n {\n //\n }", "final public function unregisterBackend($type) {\n\t\t$type = mb_strtolower($type);\n\t\tif (NULL === $this->getBackendByType($type))\n\t\t\treturn FALSE;\n\t\tunset($this->map[$type]);\n\t\tksort($this->map);\n\t\treturn TRUE;\n\t}", "public function clear($type)\n {\n Local::eraseFolder($this->$type->cache);\n }", "public function destroy(Type $type)\n {\n $type->delete();\n return response(null, Response::HTTP_NO_CONTENT);\n }", "public function delete($entity_type, $entity_bundle, $entity_display) {\n $config = $this->configFactory->getEditable('alinks.settings');\n $displays = array_values(array_filter($config->get('displays'), function ($display) use ($entity_type, $entity_bundle, $entity_display) {\n return !($display['entity_type'] == $entity_type && $display['entity_bundle'] == $entity_bundle && $display['entity_display'] == $entity_display);\n }));\n $config->set('displays', $displays)->save();\n return new RedirectResponse(Url::fromRoute('alink_keyword.settings')->setAbsolute()->toString());\n }", "public function testLineItemTypeDeletion() {\n $values = [\n 'id' => strtolower($this->randomMachineName(8)),\n 'label' => $this->randomMachineName(16),\n 'purchasableEntityType' => 'commerce_product_variation',\n 'orderType' => 'default',\n ];\n $line_item_type = $this->createEntity('commerce_line_item_type', $values);\n\n $this->drupalGet($line_item_type->toUrl('delete-form'));\n $this->assertSession()->statusCodeEquals(200);\n $this->assertSession()->pageTextContains(t('This action cannot be undone.'));\n $this->submitForm([], t('Delete'));\n $line_item_type_exists = (bool) LineItemType::load($line_item_type->id());\n $this->assertFalse($line_item_type_exists, 'The line item type has been deleted form the database.');\n }", "function remove_id_type($id_type_id = '')\n\t{\n\t\t$this->db->where('id_type_id', $id_type_id);\n\t\t$this->db->delete('id_type');\n\n\t\t$this->session->set_flashdata('success', 'ID type has been deleted successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}", "public static function removeType($doctrineType)\n {\n unset(static::$typeMap[$doctrineType]);\n }", "public function remove_attr($type){\n\t\tif(isset($this->attr[$type])){\n\t\t\tunset($this->attr[$type]);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public function destroy(ProductType $productType)\n {\n //\n }", "public function destroy(Type $type)\n {\n //\n $type->delete();\n return redirect()->route('type')\n ->with('success','ลบหมวดหมู่สินค้าสำเร็จ');\n }", "public function removeHeader($key, $type)\n {\n }", "public function deleteHospitalByType(string $type)\n {\n return Hospital::query()->where('type', $type)->delete();\n }", "public function deleted(EducationType $educationType)\n {\n // Removing Entries from the Cache\n $this->clearCache($educationType);\n }", "public function delete_type_record($id){\n\t\t$this->db->where('training_type_id', $id);\n\t\t$this->db->delete('training_types');\n\t\t\n\t}", "function removeSensSpec($biomarker_id,$organ_data_id,$study_data_id,$sensitivity_id) {\n\t\t$this->checkSession(\"/biomarkers/organs/{$biomarker_id}/{$organ_data_id}\");\n\t\t$this->StudyData->habtmDelete(\"Sensitivity\",$study_data_id,$sensitivity_id);\n\t\t$this->redirect(\"/biomarkers/organs/{$biomarker_id}/{$organ_data_id}\");\n\t}", "function delete_ad_specification( $specification_id )\n\t{\n\t\t\n\t\t$q = \"DELETE FROM title_dev_ad_specifications WHERE specification_id = \".$specification_id;\n\t\t$r = $this -> db -> deleteRecord( $q );\n\t\tif( $r )\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "function search_index_remove($object_id, $type) {\n return call_user_func_array(array(SEARCH_ENGINE, 'remove'), array($object_id, $type));\n }", "public function uninstall()\n\t\t{\n\t\t\t$this->_Parent->Database->delete('tbl_pages_types', \"`page_id` = 4294967295\");\n\t\t}", "public function testLineItemTypeDeletion() {\n $values = [\n 'id' => strtolower($this->randomMachineName(8)),\n 'label' => $this->randomMachineName(16),\n 'purchasableEntityType' => 'commerce_product_variation',\n 'orderType' => 'default',\n ];\n $lineItemType = $this->createEntity('commerce_line_item_type', $values);\n\n $this->drupalGet('admin/commerce/config/line-item-types/' . $lineItemType->id() . '/delete');\n $this->assertResponse(200, 'line item type delete form can be accessed at admin/commerce/config/line-item-types/'. $lineItemType->id() . '/delete.');\n $this->assertText(t('This action cannot be undone.'), 'The line item type deletion confirmation form is available');\n $this->drupalPostForm(NULL, NULL, t('Delete'));\n $lineItemTypeExists = (bool) LineItemType::load($lineItemType->id());\n $this->assertFalse($lineItemTypeExists, 'The line item type has been deleted form the database.');\n }", "protected function removeAllItems($type)\n\t{\n\t\t$names = ItemHelper::getItemsNameByType($this->items, $type);\n\t\tif (empty($names)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tforeach ($names as $n => $hardTrue) {\n\t\t\t$this->domain->assignment->revokeAllByItemName($n);\n\t\t}\n\t\t\n\t\t/*foreach ($this->domain->assignment->all() as $i => $assignments) {\n\t\t\tforeach ($assignments as $n => $assignment) {\n\t\t\t\tif (isset($names[$assignment->roleName])) {\n\t\t\t\t\tunset($this->assignments[$i][$n]);\n\t\t\t\t}\n\t\t\t}\n\t\t}*/\n\t\t\n\t\t$this->children = ItemHelper::removeByNames($this->children, $names);\n\t\t\n\t\t$this->saveItems();\n\t}", "public function destroy(Technology $technology)\n {\n //\n }", "public function removeFieldStorageDefinition(FieldStorageDefinitionInterface $field_storage_definition);", "function deleteRegistrationType(&$registrationType) {\n\t\treturn $this->deleteRegistrationTypeById($registrationType->getTypeId());\n\t}", "public function destroy(ClaimType $claim_type)\n {\n $claim_type->delete();\n return response()->json(['result'=>'deleted'], 204);\n }", "public function test_mod_lti_delete_tool_type() {\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/ims_cartridge_basic_lti_link.xml'), '', '');\n $this->assertNotEmpty(lti_get_type($type['id']));\n $type = mod_lti_external::delete_tool_type($type['id']);\n $this->assertEmpty(lti_get_type($type['id']));\n }", "function remove_product_types( $types ){\n unset( $types['grouped'] );\n unset( $types['external'] );\n\n return $types;\n}", "public function destroy(VideoType $video_type)\n {\n //\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function removeResponsiveDefinition($site_id, $page_id, $id, $column_type)\n {\n $sql = \"DELETE \n `uspscr`\n FROM \n `user_site_page_structure_column_responsive` `uspscr`\n INNER JOIN \n `designer_column_type` `dct` ON \n `uspscr`.`column_type_id` = `dct`.`id`\n WHERE \n `uspscr`.`site_id` = :site_id AND \n `uspscr`.`page_id` = :page_id AND \n `uspscr`.`column_id` = :column_id AND \n `dct`.`column_type` = :column_type\";\n $stmt = $this->_db->prepare($sql);\n $stmt->bindValue(':site_id', $site_id);\n $stmt->bindValue(':page_id', $page_id);\n $stmt->bindValue(':column_id', $id);\n $stmt->bindValue(':column_type', $column_type);\n\n return $stmt->execute();\n }", "public function destroy($type)\n {\n $model = Student::whereUser_id(auth()->user()->id)->first();\n if (!is_null($model)) {\n if ($model->user_id == auth()->user()->id) {\n $documents = $model->getMedia($type);\n foreach ($documents as $document) $document->delete();\n toast('Document deleted succesfully', 'success')->autoClose(5000)->timerProgressBar();\n return redirect()->back();\n }\n }\n toast('Document not found', 'warning')->autoClose(5000)->timerProgressBar();\n return redirect()->back();\n }", "public function destroy(DeviceType $deviceType)\n {\n //\n }", "public function deleteItemsByType($fileType)\n {\n $this->_getWriteAdapter()->delete($this->getMainTable(),\n array('file_type = ?' => $fileType)\n );\n }", "public function delete($address, $list, $type)\n {\n $this->getQuery()\n ->where('type', '=', $type)\n ->where('list', '=', $list)\n ->where('label', '=', $address)\n ->delete();\n }", "public function destroy(types $type)\n {\n $type->delete();\n\n return redirect()->route('types.index')->with('message','Type Deleted Successfully');\n }", "public function removeFromIndexByTypeAndId($type, $id)\n {\n $this->elasticsearch->delete(\n [\n 'index' => $this->indexName,\n 'type' => $type,\n 'id' => $id,\n ]\n );\n }", "public function destroy($type=null,$item_id,$id)\n {\n //\n }", "public function deleteType($typeId) {\n\t\tthrow new CmisNotImplementedException(\"deleteType\");\t\t\n\t}", "public function destroy(HouseType $type)\n {\n $type->delete();\n\n alert()->success('Deleted Successfully');\n\n return redirect()->route('types.index');\n }", "public function delete_by_content_type($content_type)\n\t{\n\t\treturn $this->db->where('content_type', $content_type)->delete($this->table);\n\t}", "public function delete(){\n\t\t$db = new Database();\n\t\t$sql = \"DELETE FROM reportKinds WHERE id=?\";\n\t\t$sql = $db->prepareQuery($sql, $this->id);\n\t\t$db->query($sql);\n\t}", "public function destroy(ClassType $classType, Student $student)\n {\n //\n }", "public function removeDataType($dataType)\n {\n if ($this->hasDataType($dataType)) {\n unset($this->dataTypeMapping[$dataType]);\n }\n return $this;\n }", "function Remove(){\n\t\tif($this->AuthUser->Role=='Demo'){ // handle demo mode\n\t\t\t$tojson = array (\n\t\t\t \"IsSuccessful\" => 'false',\n\t\t\t\t\"Error\" => 'Not available in demo mode'\n\t\t\t);\n\n\t\t\t// encode to json\n\t\t\t$encoded = json_encode($tojson);\n\n\t\t\tdie($encoded);\n\t\t}\n\n\t\t$menuTypeUniqId = $this->GetPostData(\"MenuTypeUniqId\");\n\t\t\n\t\t$menuType = MenuType::GetByMenuTypeUniqId($menuTypeUniqId);\n\t\t\n\t\t$menuType->Delete();\n\t\t\n\t\t// return MenuTypeUniqId\n\t\t$tojson = array (\n\t\t 'IsSuccessful' => 'true',\n\t\t\t'MenuTypeUniqId' => $menuTypeUniqId,\n\t\t\t'Message' => 'Menu type removed successfully'\n\t\t);\n\t\t\n\t\t// encode to json\n\t\t$encoded = json_encode($tojson);\n\t\t \n\t\tdie($encoded);\n\t}", "public function destroy(DataType $dataType)\n {\n $dataType->delete();\n return $this->api->success()->message(\"Data Type has been deleted\")->payload($dataType)->code(200)->send();\n }", "private function removeAttribute( $attr )\n {\n if (isset($this->attributeTypes[$attr]) || array_key_exists($attr, $this->attributeTypes))\n unset( $this->attributeTypes[$attr] ); // forma de remover un valor de un array...\n }", "public static function forge($type = 'db', $config = null)\n\t{\n\t\t// validate the type\n\t\tif (empty($type) or ! is_string($type))\n\t\t{\n\t\t\tthrow new \\RuntimeException('FOU-028: Specified storage type must be a string value');\n\t\t}\n\n\t\t// create and return the requested storage instance\n\t\treturn static::getDic()->resolve('storage.'.$type, array($config));\n\t}", "public function removePolicy(string $sec, string $ptype, array $rule): void\n {\n throw new NotImplementedException('not implemented');\n }", "public function destroy(RequestType $requestType)\n {\n $requestType->delete();\n return $this->showOne($requestType);\n }", "function removeSensSpec2($biomarker_id,$study_data_id,$sensitivity_id) {\n\t\t$this->checkSession(\"/biomarkers/studies/{$biomarker_id}\");\n\t\t$this->BiomarkerStudyData->habtmDelete(\"Sensitivity\",$study_data_id,$sensitivity_id);\n\t\t$this->redirect(\"/biomarkers/studies/{$biomarker_id}\");\n\t}", "public function remove_type( $ext ) {\n\t\t\tif ( isset( $this->mime_types[$ext] ) ) {\n\t\t\t\tunset( $this->mime_types[$ext] );\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "public function apply(Type $type)\n {\n foreach ($this->blacklistedFields as $blacklistedField) {\n if (isset($type->$blacklistedField)) {\n unset($type->$blacklistedField);\n }\n }\n\n return $type;\n }", "public function delete($type)\n {\n $filename = self::getFile($type);\n @unlink($filename);\n // re-create log file\n $translator = Msd_Language::getInstance()->getTranslator();\n $this->write($type, $translator->_('L_LOG_CREATED'));\n }", "public function destroy(UserType $userType)\n {\n //\n }", "protected function deleteStore() {\n $keys = ['entity_type', 'entity_id', 'export_type'];\n foreach ($keys as $key) {\n $this->store->delete($key);\n }\n }", "public function destroy(GameType $gametype)\n {\n //\n $deleted = $gametype->description;\n\n Game::where('game_type_id', $gametype->id)->delete();\n GameType::destroy($gametype->id);\n\n return response()->json(['title' => $deleted]);\n }", "public static function remove ($type, Array $files) {\n if (in_array($type, array_keys(self::$_assets))) {\n foreach ($files as $file) {\n unset(self::$_assets[$type][array_search($file, self::$_assets[$type])]);\n }\n }\n }", "public function removeProvider($provider);", "public function deleted(ClaseType $clases_type)\n {\n // $clases_type->blocks()->delete();\n }", "public function destroy(MembershipType $membershipType)\n {\n //\n }", "public function truncate_attachment_cache($type = self :: ATTACHMENT_NORMAL)\n {\n unset($this->attachment_ids[$type]);\n unset($this->attachments[$type]);\n }", "public function destroy(ComputerType $computerType)\n {\n $computerType->delete();\n $message['type'] = 'success';\n $message['status'] = Lang::get('messages.remove_computer_type');\n return redirect($this->menu)->with('message',$message);\n }", "function del($typeConstant, $uniqueId = null)\n {\n return $this->cacheStore->delete($this->getCacheKey($typeConstant, $uniqueId));\n }", "public function test_mod_lti_delete_tool_type_without_capability() {\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/ims_cartridge_basic_lti_link.xml'), '', '');\n $this->assertNotEmpty(lti_get_type($type['id']));\n $this->expectException('required_capability_exception');\n self::setUser($this->teacher);\n $type = mod_lti_external::delete_tool_type($type['id']);\n }", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "public function destroy(type_of_user $type_of_user)\n {\n //\n }", "public function destroy(PavaneType $pavaneType)\n {\n //\n }", "function removeConstraint($constraintType, $columnName, $referencesTableName, $referencesColumnName) {\n foreach ($this->constraints as $key => $c) {\n if ($c->equals(new DbConstraint($constraintType, $columnName, $referencesTableName, $referencesColumnName))) {\n unset($this->constraints[$key]);\n }\n }\n }" ]
[ "0.60756814", "0.58918566", "0.58918566", "0.58310276", "0.5779239", "0.57006854", "0.56732434", "0.567184", "0.5611747", "0.561007", "0.55900204", "0.5521843", "0.54639184", "0.54513294", "0.54227537", "0.541718", "0.5410807", "0.54031", "0.5375461", "0.53292793", "0.5328341", "0.532514", "0.52942914", "0.528232", "0.52678394", "0.52195144", "0.51985687", "0.518366", "0.516774", "0.5167594", "0.51433986", "0.5120822", "0.5119469", "0.5111388", "0.50735474", "0.50713384", "0.50685775", "0.5047125", "0.50441813", "0.5037861", "0.5019895", "0.50150704", "0.500196", "0.49972832", "0.49877882", "0.49782377", "0.49702743", "0.4951393", "0.4950779", "0.49494976", "0.4927224", "0.4925284", "0.49172872", "0.49140233", "0.4911922", "0.48901242", "0.4889716", "0.48642528", "0.48585758", "0.48522556", "0.48428518", "0.4830984", "0.48138115", "0.4813671", "0.48086447", "0.48058388", "0.47958636", "0.47923246", "0.47811335", "0.47706375", "0.4770574", "0.47660893", "0.47599062", "0.47569826", "0.47426423", "0.47399282", "0.47332057", "0.4730185", "0.47261935", "0.4722946", "0.47209045", "0.47157952", "0.4693539", "0.46917877", "0.46854067", "0.4680441", "0.46762756", "0.467147", "0.4666328", "0.4664893", "0.46626174", "0.46546495", "0.46492496", "0.46429473", "0.46429473", "0.46429473", "0.46429473", "0.46405008", "0.46390295", "0.46337143" ]
0.48786578
57
$all_role = M('role')>where('user_id 0')>select();
function getSubRoleId4($self = true, $role_id=0){ $role_id = session('role_id'); $below_role = getSubRole4($role_id, $all_role); if ($self) { $below_ids[] = $role_id; } foreach ($below_role as $key=>$value) { $below_ids[] = $value['role_id']; } //dump($below_ids);exit; return array_unique($below_ids); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllRoles() {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT DISTINCT role FROM users');\n // exécution\n $query -> execute();\n // renvoie un tableau associatif\n return $query -> fetchAll();\n}", "public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}", "public static function getUserRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT *\n FROM user_role\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "private function get_all_roles(){\n return Role::all();\n }", "function _rtm_mail_get_roles() {\n\n $sql = \"select * from {role} where rid > 2\";\n $result = db_query($sql);\n\n $items = array();\n while ($row = db_fetch_object($result)) {\n array_push($items, $row);\n }\n\n return $items;\n}", "function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}", "function get_all_user_role()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('user_role')->result_array();\n }", "function get_roles(){\n\t\t$this->db->select('*');\n\t\t$q = $this->db->get('user_role');\n\n\t\treturn $q->result_array();\n\t}", "public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }", "public static function manageRole(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM hp_role'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }", "function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }", "function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }", "function role_show_all_model(){\n\n $query = $this->db->query('select id,name,date,user_id,Ucreate,Uupdate,Udelete,Uselect,Ualter from role'); \n //return $query->result_array();\n return $query;\n\n }", "public function listarRoles(){\r\n $sql = \"SELECT * FROM roles;\";\r\n $roles = $this->conexion->getTable($sql);\r\n return $roles;\r\n}", "public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }", "function getAdminRoles(){\r\n\t $this->db->select(TBL_MST_ROLES.'.id');\r\n\t\t$this->db->from(TBL_MST_ROLES);\r\n\t\t$this->db->where(array(TBL_MST_ROLES.'.is_active'=>TRUE,TBL_MST_ROLES.'.is_admin'=>TRUE));\t\r\n $recordSet = $this->db->get();\r\n\t\t$data=$recordSet->result();\r\n\t\tif(count($data)>0){\r\n\t\t\treturn $data;\r\n\t\t}else{\r\n\t\t\treturn array();\t\t\r\n\t\t}\r\n\t}", "public function fillRoles(){\n $query = Rol::select('id_rol','nombre')->where('estado','=','true')->get();\n return $query;\n }", "function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('user_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }", "function getAll()\n\t{\n\t\t$this->db->order_by(\"roleName\",\"ASC\");\n\t\t$query = $this->db->get('roles');\n\t\treturn $query;\n\t}", "function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}", "function get_all_roles()\n {\n $this->db->order_by('role', 'asc');\n return $this->db->get('tbl_roles')->result_array();\n }", "public function userRoleDashboard()\n {\n return User::select('role',DB::raw('count(*) as total'))\n ->groupBy('role')\n ->pluck('total','role')\n ->all();\n }", "public static function getListRole(){\n return SentinelRole::where('company_id_fk',Sentinel::getUser()->company_id_fk)->orWhere('company_id_fk')->lists('name','id')->all();\n }", "function getRoles(){\n $this->db->select('*');\n $this->db->from('Roles');\n $query = $this->db->get();\n $result = $query->result();\n return $result;\n }", "public function getRoleList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_role');\r\n\t\t$this->db->where('role_status', '1');\r\n\t\t$this->db->where('role_id !=', '1');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getRoleList()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_role');\n\t\t$this->db->where('role_status', '1');\n\t\t$this->db->where('role_id !=', '1');\n\t\t$query = $this->db->get();\n\t\treturn $query->result() ;\n\t}", "function getAllAdmins(){\n $sql = self::$connection->prepare(\"SELECT * FROM `user` WHERE role_id = 1\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM users WHERE role_id = 2;\";\n $stm = App::$db->prepare($sql);\n $stm->setFetchMode(\\PDO::FETCH_OBJ);\n $stm->execute();\n return $stm->fetchAll();\n }", "public function get_roles()\n {\n $query=$this->db->get('tbl_roles');\n return $query->result();\n }", "function get_roles () {\r\n //if (!check_admin()) return false;\r\n $conn = db_connect();\r\n $query = \"select * from roles\";\r\n $result = $conn->query(\"set names utf8\");\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n }\r\n if ($result->num_rows == 0) {\r\n // throw new Exception(\"No records in roles table!\");\r\n }\r\n\r\n $result = db_result_to_array($result);\r\n return $result;\r\n }", "public function getRoles(){\n //write the query to select all roles except super admin\n $sql = \"SELECT * FROM roles WHERE role_title != 'Super Admin'\";\n\n //check if the query() runs the sql statement\n if ($result = $this->dbobj->dbcon->query($sql)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }", "function getRoles()\n\t{\n $query = $this->db->query(\"select\n\t\t\t\t\t\t\t\t\t\troles.id as id,\n\t\t\t\t\t\t\t\t\t\troles.nombre as nombre,\n\t\t\t\t\t\t\t\t\t\troles.id_superior as id_superior\n\t\t\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\t\t\troles\n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\troles.estado = 0\n\t\t\t\t\t\t\t\t\torder by\n\t\t\t\t\t\t\t\t\t\troles.id asc\");\n\t\treturn $query->result();\n }", "public function listAll(){\n try{\n $sql = 'select * from user u inner join person p on u.id_person = p.id_person inner join role r on u.id_role = r.id_role where r.id_role <> 2';\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }", "public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }", "public function get_all_roles()\n {\n return App\\Role::all();\n }", "function get_user_role($id)\n {\n return $this->db->get_where('user_role',array('id'=>$id))->row_array();\n }", "public function getAllRoles(): array;", "public function fetchAll()\n\t{\n\t\t$permissions = $this->getRoleModel()->fetchAll();\n\t\treturn $permissions;\n\t}", "function get_all_pac_emp_roles()\n {\n $pac_emp_roles = $this->getdb()->query(\"\n SELECT\n *\n\n FROM\n `pac_emp_roles`\n\n WHERE\n 1 = 1\n \")->result_array();\n\n return $pac_emp_roles;\n }", "function getRolesList(){\r\n\t\t$sql=\"select * from m_employee_roles\";\r\n\t\t$res=$this->db->query($sql);\r\n\t\tif($res->num_rows()){\r\n\t\t\treturn $res->result_array($sql);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static function selectrole($roleID){\n $userlist = [];\n $db = Db::getInstance(); \n $roleID = intval($roleID);\n $req = $db->prepare('SELECT * FROM hp_user WHERE role_id = :id'); \n $req->execute(array('id' => $roleID));\n foreach($req->fetchAll() as $row) {\n $userlist[] = $row;\n }\n return $userlist;\n }", "public function getUserRole()\r\n{\r\n $query_string = \"SELECT role FROM users \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }", "public function role_akun_data()\n {\n $this->db->select('*');\n $this->db->from('user_role');\n return $this->db->get();\n }", "public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }", "private function load_roles() {\n $query = $this->PDO->prepare(\"SELECT * FROM rol\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getMarcas(){\n\t\t//consulta a la tabla roles usando el objeto db de la clase modelo\n\t\t$marcas = $this->_db->query(\"SELECT id, nombre FROM marcas ORDER BY nombre\");\n\n\t\t//retornamos lo que haya en la tabla roles\n\t\treturn $marcas->fetchall();\n\t}", "public function getAll() {\n $this->load->database();\n\n $this->db->select('*');\n $this->db->from('user');\n $this->db->where('role =', '3');\n \n $query = $this->db->get();\n return $query->result();\n }", "public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }", "public function index()\n {\n $result = User::where('role','>','0')->get()->all();\n return $result;\n }", "function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }", "public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }", "public function loadrolesAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }", "public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }", "function getAllUsers(){\n $sql = self::$connection->prepare(\"SELECT * FROM `user` WHERE role_id = 2\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "public function selectAllRoleIDs()\n {\n $result = $this->sdb->query(\"select id from role order by label asc\", array());\n $all = array();\n while($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row['id']);\n }\n return $all;\n }", "function getListRoleCurUser() {\n $userRoleModel = new UserRoleModel();\n $userId = isset($this->curUserInfo->id)? $this->curUserInfo->id: 0;\n $result = $userRoleModel->filterUserId($userId)->buildCond()->get();\n $retVal = [];\n if((int)$result->count() > 0){\n $retVal = $result->pluck('role')->toArray();\n }\n return $retVal;\n }", "function getAllUsersWithRoles() {\n $statement = 'SELECT user.id, username, role, email, banned FROM user INNER JOIN \n role_lov role_lov ON user.role_id = role_lov.id ORDER BY user.id';\n $query = $this->prepare($statement);\n $query->execute();\n return $query->fetchAll();\n }", "public function showAll(){\n\t\t\t$sql = \"SELECT r.CodRole,r.Nombre,r.Estado,r.updated_by,r.updated_at,u.CodUsuario,u.NombreUsuario FROM role r INNER JOIN usuario u ON r.updated_by=u.CodUsuario\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}", "public function index()\n {\n return Role::all();\n }", "public function index()\n {\n return Role::all();\n }", "public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }", "public function getUsersRoles()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ur' => 'users_roles'),\n\t\t\t\t'ur.user_id = u.user_id', array('role_id'));\n\t\treturn $db->fetchAll($select);\t\n\t}", "public function count_all_roles(){\n\t\treturn ORM::factory('role')->count_all();\n\t}", "function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }", "protected function queryUserAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n return $queryBuilder->select('*')\n ->from('User', 'u')\n ->innerJoin('u', 'Role','r','u.Role_ID = r.Role_ID' );\n }", "function _muckypup_database_get_roles () {\n\n\t$roles = array ();\n\t$user_roles = user_roles();\n\t\n\tunset ($user_roles[1]); // Deleting anonymous role. By default at index 1.\n\tunset ($user_roles[2]); // Deleting authenticated role. By default at index 2.\n\t\n\tforeach ($user_roles as $rid=>$user_role) {\n\t\t$roles[$rid] = $user_role;\n\t}\n\n\treturn $roles;\n}", "public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }", "public function getRolesData()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n 'SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Role p'\n \n );\n $result = $query->getResult();\n \n return $result;\n }", "public function all()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('r')\n ->from(Role::class, 'r');\n\n return $qb->getQuery()->getResult();\n }", "public function all()\n {\n $roles = collect($this->table()->where('user_id', $this->user->id())->get());\n\n if ($roles->isEmpty()) {\n return collect();\n }\n\n return $roles; // todo: groups\n }", "public function get_roles()\n {\n $users_roles = user_role_active_record::search()->where('uid', $this->uid)->exec();\n $roles = array();\n foreach ($users_roles as $users_role) {\n $roles[] = role_active_record::search()->where('rid', $users_role->rid)->execOne();\n }\n return $roles;\n }", "public function findAll() {\n\n // Récupération des différents type d'utilisateur\n $result = $this->getDb()->fetchAll(\"select * from roles order by nom asc\");\n \n $roles = array();\n foreach ($result as $row) {\n $roles[$row['id']] = $this->buildDomainObject($row);\n }\n return $roles;\n }", "public function getRole($queryReturn = true){\n $data = $this->belongsTo(Role::class,'role_id');\n return $queryReturn ? $data : $data->first();\n }", "public function findRoles() {\n\t\t\n\t}", "public function listAll()\n {\n $roles = $this->model->lists('name', 'id');\n\n return $roles;\n }", "public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }", "public function role(){\n $obj = $this->hasMany(UserRole::class,'user_id','id')\n ->join('role', 'role.id', '=', 'role_id')->with('permissions');\n return $obj;\n }", "public function getRoleId()\n {\n return $this->db->get('role_id')->result_array();\n }", "public function getRoles(): array;", "function getAdminUsers(){\n\tglobal $connection, $roles;\n\t$sql = \"SELECT * FROM Accounts WHERE role IS NOT NULL\";\n\t$result = mysqli_query($connection, $sql);\n\t$users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\treturn $users;\n}", "public static function getProjectRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT name\n FROM project_role\n\t\t\tWHERE name != 'Owner'\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function roles(): MorphToMany;", "public function mostrar(){ \n $role = DB::table('roles as r')\n //->join('roles as r','m.idMiembro','=','r.idRole') \n ->select('r.idrole', 'r.descripcionrole')\n ->get();\n return $role;\n }", "public function rolesForUser();", "private function getUserRole($id) { \n $dv_role = Yii::$app->db->createCommand(\"SELECT meta_value FROM assist_user_meta WHERE uid = '$id' AND meta_key = 'role'\")->queryAll();\n return $dv_role;\n }", "function get_emp_access_roles(){\r\n\t\t$user_authdet = $this->session->userdata('user_authdet');\r\n\r\n\t\t$access_list_res = $this->db->query(\"SELECT role_id,role_name\r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM m_employee_roles\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE role_id > 1 \");\r\n\t\t\t\t\r\n\t\t\t\r\n\t\tif($access_list_res->num_rows()){\r\n\t\t\treturn $access_list_res->result_array();\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function roles()\n {\n \treturn $this->belongsTo('App\\Models\\User','roles','id');\n }", "public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}", "private function roles($id){\n $role = Rol::find($id);\n return $role->users;\n }", "public function getRoles(): array {\n\t\t$sql = 'SELECT id, name FROM roles';\n\t\treturn $this->queryRows($sql);\n\t}", "public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }", "public static function getAll()\n {\n return Role::with(['permissions'])->get();\n }", "public static function userdept(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM user_department'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }", "public function index()\n {\n return Roles::all();\n }", "function getdataroleuser()\n\t{\n\t\t$query = $this->db->query(\"SELECT roleuser,koderole FROM roleuser \");\n\t\t// print_r($query);\n\t\t// exit();\n\t\treturn $query->result();\n\t}", "public function roles()\n {\n return $this->belongsToMany('App\\Role', 'user_roles');\n\t}", "public function roles();", "public function roles();", "public function roles();" ]
[ "0.71899444", "0.716844", "0.7125367", "0.7072232", "0.6991448", "0.698676", "0.69687694", "0.69639075", "0.6926662", "0.6888963", "0.68565255", "0.68565255", "0.68399596", "0.68283665", "0.68247694", "0.6803391", "0.6792577", "0.6760366", "0.67563844", "0.67539054", "0.6662545", "0.6641829", "0.66282564", "0.6625254", "0.6620011", "0.66026276", "0.65677035", "0.65580726", "0.6533123", "0.6532434", "0.6529705", "0.65256095", "0.65169305", "0.65162677", "0.6503397", "0.64996994", "0.6485583", "0.6441832", "0.64417607", "0.64299655", "0.64289266", "0.6417208", "0.64140755", "0.6399432", "0.6380664", "0.63762665", "0.6352735", "0.63215786", "0.6300143", "0.62878746", "0.62854713", "0.6276868", "0.6275574", "0.6274428", "0.6259747", "0.6257847", "0.6257454", "0.6250483", "0.6244381", "0.6232657", "0.622584", "0.622584", "0.62236595", "0.6223181", "0.62174624", "0.6211808", "0.6209169", "0.61890703", "0.6178075", "0.617199", "0.6170333", "0.61652917", "0.6163783", "0.61577076", "0.6141466", "0.6128455", "0.611664", "0.6112865", "0.6098333", "0.60906726", "0.60882825", "0.6076185", "0.60713696", "0.6061866", "0.6046407", "0.60380656", "0.6034673", "0.60338145", "0.60290265", "0.6021711", "0.6021454", "0.60133034", "0.6010657", "0.5976641", "0.5967088", "0.59646946", "0.5962417", "0.59579563", "0.5951375", "0.5951375", "0.5951375" ]
0.0
-1
$all_role = M('role')>where('user_id 0')>select();
function getSubRoleId3($self = true, $role_id=0){ //echo M('role')->getLastSql(); //dump($all_role); $role_id = session('role_id'); $below_role = getSubRole3($role_id, $all_role); //dump($below_role); if ($self) { $below_ids[] = $role_id; } foreach ($below_role as $key=>$value) { $below_ids[] = $value['role_id']; } //dump($below_ids);exit; return array_unique($below_ids); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAllRoles() {\n // connexion à la BDD\n $db = connect();\n // requête\n $query = $db -> prepare('SELECT DISTINCT role FROM users');\n // exécution\n $query -> execute();\n // renvoie un tableau associatif\n return $query -> fetchAll();\n}", "public function get_all_roles(){\n\t\treturn ORM::factory('role')->find_all()->as_array();\n\t}", "public static function getUserRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT *\n FROM user_role\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "private function get_all_roles(){\n return Role::all();\n }", "function _rtm_mail_get_roles() {\n\n $sql = \"select * from {role} where rid > 2\";\n $result = db_query($sql);\n\n $items = array();\n while ($row = db_fetch_object($result)) {\n array_push($items, $row);\n }\n\n return $items;\n}", "function get_all_roles() {\n return get_records('role', '', '', 'sortorder ASC');\n}", "function get_all_user_role()\n {\n $this->db->order_by('id', 'desc');\n return $this->db->get('user_role')->result_array();\n }", "function get_roles(){\n\t\t$this->db->select('*');\n\t\t$q = $this->db->get('user_role');\n\n\t\treturn $q->result_array();\n\t}", "public function get_roles() {\n return DB::query(Database::SELECT, 'SELECT * FROM roles WHERE id > 1')\n ->as_object()\n ->execute($this->db);\n }", "public static function manageRole(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM hp_role'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }", "function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }", "function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('tbl_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }", "function role_show_all_model(){\n\n $query = $this->db->query('select id,name,date,user_id,Ucreate,Uupdate,Udelete,Uselect,Ualter from role'); \n //return $query->result_array();\n return $query;\n\n }", "public function listarRoles(){\r\n $sql = \"SELECT * FROM roles;\";\r\n $roles = $this->conexion->getTable($sql);\r\n return $roles;\r\n}", "public function getRoles(){\n $db = new MainModel();\n $query = \"SELECT r.id as idRol, r.name as nameRol from roles as r\";\n return $response = $db->consultQueryAll($query);\n }", "function getAdminRoles(){\r\n\t $this->db->select(TBL_MST_ROLES.'.id');\r\n\t\t$this->db->from(TBL_MST_ROLES);\r\n\t\t$this->db->where(array(TBL_MST_ROLES.'.is_active'=>TRUE,TBL_MST_ROLES.'.is_admin'=>TRUE));\t\r\n $recordSet = $this->db->get();\r\n\t\t$data=$recordSet->result();\r\n\t\tif(count($data)>0){\r\n\t\t\treturn $data;\r\n\t\t}else{\r\n\t\t\treturn array();\t\t\r\n\t\t}\r\n\t}", "public function fillRoles(){\n $query = Rol::select('id_rol','nombre')->where('estado','=','true')->get();\n return $query;\n }", "function getUserRoles()\n {\n $this->db->select('roleId, role');\n $this->db->from('user_roles');\n $this->db->where('roleId !=', 1);\n $query = $this->db->get();\n \n return $query->result();\n }", "function getAll()\n\t{\n\t\t$this->db->order_by(\"roleName\",\"ASC\");\n\t\t$query = $this->db->get('roles');\n\t\treturn $query;\n\t}", "function get_role_list() {\n\t\treturn $this->db->get('system_security.security_role');\n\t\t\n\t}", "function get_all_roles()\n {\n $this->db->order_by('role', 'asc');\n return $this->db->get('tbl_roles')->result_array();\n }", "public function userRoleDashboard()\n {\n return User::select('role',DB::raw('count(*) as total'))\n ->groupBy('role')\n ->pluck('total','role')\n ->all();\n }", "public static function getListRole(){\n return SentinelRole::where('company_id_fk',Sentinel::getUser()->company_id_fk)->orWhere('company_id_fk')->lists('name','id')->all();\n }", "function getRoles(){\n $this->db->select('*');\n $this->db->from('Roles');\n $query = $this->db->get();\n $result = $query->result();\n return $result;\n }", "public function getRoleList()\r\n\t{\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->from('tbl_role');\r\n\t\t$this->db->where('role_status', '1');\r\n\t\t$this->db->where('role_id !=', '1');\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->result() ;\r\n\t}", "public function getRoleList()\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('tbl_role');\n\t\t$this->db->where('role_status', '1');\n\t\t$this->db->where('role_id !=', '1');\n\t\t$query = $this->db->get();\n\t\treturn $query->result() ;\n\t}", "function getAllAdmins(){\n $sql = self::$connection->prepare(\"SELECT * FROM `user` WHERE role_id = 1\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "public function getAll()\n {\n $sql = \"SELECT * FROM users WHERE role_id = 2;\";\n $stm = App::$db->prepare($sql);\n $stm->setFetchMode(\\PDO::FETCH_OBJ);\n $stm->execute();\n return $stm->fetchAll();\n }", "public function get_roles()\n {\n $query=$this->db->get('tbl_roles');\n return $query->result();\n }", "function get_roles () {\r\n //if (!check_admin()) return false;\r\n $conn = db_connect();\r\n $query = \"select * from roles\";\r\n $result = $conn->query(\"set names utf8\");\r\n $result = $conn->query($query);\r\n if (!$result) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n }\r\n if ($result->num_rows == 0) {\r\n // throw new Exception(\"No records in roles table!\");\r\n }\r\n\r\n $result = db_result_to_array($result);\r\n return $result;\r\n }", "public function getRoles(){\n //write the query to select all roles except super admin\n $sql = \"SELECT * FROM roles WHERE role_title != 'Super Admin'\";\n\n //check if the query() runs the sql statement\n if ($result = $this->dbobj->dbcon->query($sql)) {\n $row = $result->fetch_all(MYSQLI_ASSOC);\n }\n else{\n echo \"Error\" .$this->dbobj->dbcon->error;\n }\n return $row;\n }", "function getRoles()\n\t{\n $query = $this->db->query(\"select\n\t\t\t\t\t\t\t\t\t\troles.id as id,\n\t\t\t\t\t\t\t\t\t\troles.nombre as nombre,\n\t\t\t\t\t\t\t\t\t\troles.id_superior as id_superior\n\t\t\t\t\t\t\t\t\tfrom\n\t\t\t\t\t\t\t\t\t\troles\n\t\t\t\t\t\t\t\t\twhere\n\t\t\t\t\t\t\t\t\t\troles.estado = 0\n\t\t\t\t\t\t\t\t\torder by\n\t\t\t\t\t\t\t\t\t\troles.id asc\");\n\t\treturn $query->result();\n }", "public function listAll(){\n try{\n $sql = 'select * from user u inner join person p on u.id_person = p.id_person inner join role r on u.id_role = r.id_role where r.id_role <> 2';\n $stm = $this->pdo->prepare($sql);\n $stm->execute();\n $result = $stm->fetchAll();\n\n } catch (Exception $e){\n $this->log->insert($e->getMessage(), get_class($this).'|'.__FUNCTION__);\n $result = [];\n }\n return $result;\n }", "public function getAllRoles()\n {\n return \\EntityManager::getRepository('stoykov\\Ohrana\\Models\\Doctrine\\Role')->findAll();\n }", "public function getRoles() {\n return DB::table('dx_users_roles as ur')\n ->join('dx_roles as r', 'r.id', '=', 'ur.role_id')\n ->select('r.id', 'r.title', DB::raw('COUNT(*) as total_users'))\n ->where('r.is_system', '=', '0')\n ->groupBy('r.id')\n ->orderBy('r.title')\n ->get();\n }", "public function get_all_roles()\n {\n return App\\Role::all();\n }", "function get_user_role($id)\n {\n return $this->db->get_where('user_role',array('id'=>$id))->row_array();\n }", "public function getAllRoles(): array;", "public function fetchAll()\n\t{\n\t\t$permissions = $this->getRoleModel()->fetchAll();\n\t\treturn $permissions;\n\t}", "function get_all_pac_emp_roles()\n {\n $pac_emp_roles = $this->getdb()->query(\"\n SELECT\n *\n\n FROM\n `pac_emp_roles`\n\n WHERE\n 1 = 1\n \")->result_array();\n\n return $pac_emp_roles;\n }", "function getRolesList(){\r\n\t\t$sql=\"select * from m_employee_roles\";\r\n\t\t$res=$this->db->query($sql);\r\n\t\tif($res->num_rows()){\r\n\t\t\treturn $res->result_array($sql);\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public static function selectrole($roleID){\n $userlist = [];\n $db = Db::getInstance(); \n $roleID = intval($roleID);\n $req = $db->prepare('SELECT * FROM hp_user WHERE role_id = :id'); \n $req->execute(array('id' => $roleID));\n foreach($req->fetchAll() as $row) {\n $userlist[] = $row;\n }\n return $userlist;\n }", "public function getUserRole()\r\n{\r\n $query_string = \"SELECT role FROM users \";\r\n $query_string .= \"WHERE userid = :userid\";\r\n\r\n return $query_string;\r\n}", "public function getRoles(){\n $sql = \"SELECT * FROM rol\";\n\n foreach ($this->bd->query($sql) as $res) {\n $this->rol[] = $res;\n }\n return $this->rol;\n }", "public function role_akun_data()\n {\n $this->db->select('*');\n $this->db->from('user_role');\n return $this->db->get();\n }", "public function getAll()\n {\n return $this->roles->whereStatus(1)->orderBy('id', 'desc')->get();\n }", "private function load_roles() {\n $query = $this->PDO->prepare(\"SELECT * FROM rol\");\n $query->execute();\n return $query->fetchAll(PDO::FETCH_ASSOC);\n }", "public function getMarcas(){\n\t\t//consulta a la tabla roles usando el objeto db de la clase modelo\n\t\t$marcas = $this->_db->query(\"SELECT id, nombre FROM marcas ORDER BY nombre\");\n\n\t\t//retornamos lo que haya en la tabla roles\n\t\treturn $marcas->fetchall();\n\t}", "public function getAll() {\n $this->load->database();\n\n $this->db->select('*');\n $this->db->from('user');\n $this->db->where('role =', '3');\n \n $query = $this->db->get();\n return $query->result();\n }", "public function retrieveAllRoles()\n {\n return $this->invoker->getAllRoles($this->factory->createNewRolesObject());\n\n }", "public function index()\n {\n $result = User::where('role','>','0')->get()->all();\n return $result;\n }", "function getAllRoles(){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getAllRoles();\r\n }", "public function getAllRoles()\n {\n $id = $this->get(TableFactory::getUserModel()\n ->getPrimaryKey());\n\n return Cache::remember(sprintf(Constants::CACHE_ROLES, $id), function() use ($id) {\n return TableFactory::getRoleModel()\n ->find()\n ->matching('Users', function(Query $query) use ($id) {\n return $query->where(['Users.id' => $id]);\n })\n ->toArray();\n });\n }", "public function loadrolesAction(){\n $roles=Doctrine_Query::create()\n\t ->select(\"r.ID, r.role\")\n\t ->from(\"Roles r\")\n \t ->execute(null,Doctrine::HYDRATE_ARRAY);\n $this->emitTableResult($roles);\n }", "public function roleListAll() {\n $this->_adminUserDao = new AdminUserDao();\n\n $ret = array();\n $roles = $this->_adminroledao->getAll();\n foreach ($roles as $role) {\n $user = $this->_adminUserDao->getRow(array(array('username', '=', $role->owner)));\n if($user){\n $ret[$role->owner]['role'][] = $role;\n $ret[$role->owner]['user'] = $user;\n }else{\n if($role->owner == config('admin.user.super_user.username')){\n $ret[$role->owner]['role'][] = $role;\n// $ret[$role->owner]['user'] = (new AdminUserDao())->fill(config('admin.user.super_user'));\n// $ret[$role->owner]['user'] = $this->_adminUserDao->getRow(array(array('id', '=', config('admin.user\n $ret[$role->owner]['user']['username'] = $role->owner;\n }\n }\n }\n return $ret;\n }", "function getAllUsers(){\n $sql = self::$connection->prepare(\"SELECT * FROM `user` WHERE role_id = 2\");\n $sql->execute();//return an object\n $items = array();\n $items = $sql->get_result()->fetch_all(MYSQLI_ASSOC);\n return $items; //return an array\n }", "public function selectAllRoleIDs()\n {\n $result = $this->sdb->query(\"select id from role order by label asc\", array());\n $all = array();\n while($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row['id']);\n }\n return $all;\n }", "function getListRoleCurUser() {\n $userRoleModel = new UserRoleModel();\n $userId = isset($this->curUserInfo->id)? $this->curUserInfo->id: 0;\n $result = $userRoleModel->filterUserId($userId)->buildCond()->get();\n $retVal = [];\n if((int)$result->count() > 0){\n $retVal = $result->pluck('role')->toArray();\n }\n return $retVal;\n }", "function getAllUsersWithRoles() {\n $statement = 'SELECT user.id, username, role, email, banned FROM user INNER JOIN \n role_lov role_lov ON user.role_id = role_lov.id ORDER BY user.id';\n $query = $this->prepare($statement);\n $query->execute();\n return $query->fetchAll();\n }", "public function showAll(){\n\t\t\t$sql = \"SELECT r.CodRole,r.Nombre,r.Estado,r.updated_by,r.updated_at,u.CodUsuario,u.NombreUsuario FROM role r INNER JOIN usuario u ON r.updated_by=u.CodUsuario\";\n\t\t\treturn ejecutarConsulta($sql);\n\t\t}", "public function index()\n {\n return Role::all();\n }", "public function index()\n {\n return Role::all();\n }", "public function index()\n {\n $roles = App\\User::find(1)->roles()->orderBy('name')->get();\n }", "public function getUsersRoles()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('u' => 'users'), array('user_id', 'name', 'surname', 'patronymic'))\n\t\t\t->joinLeft(array('ur' => 'users_roles'),\n\t\t\t\t'ur.user_id = u.user_id', array('role_id'));\n\t\treturn $db->fetchAll($select);\t\n\t}", "public function count_all_roles(){\n\t\treturn ORM::factory('role')->count_all();\n\t}", "function roles_get() {\n\n $result_set = $this->model_all->getTableDataInArray(\"app_roles\", array(\"id!=\" => \"1\"), \"id,role_name,short_form\");\n if (($result_set['total_rows']) > 0) {\n $result[\"status\"] = 1;\n $result[\"message\"] = \"Records Found\";\n $result[\"roles\"] = $result_set['records'];\n $this->response($result, 200);\n exit;\n } else {\n $result[\"status\"] = 0;\n $result[\"message\"] = \"Detais Not Found\";\n $this->response($result, 200);\n exit;\n }\n }", "protected function queryUserAll()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n\n return $queryBuilder->select('*')\n ->from('User', 'u')\n ->innerJoin('u', 'Role','r','u.Role_ID = r.Role_ID' );\n }", "function _muckypup_database_get_roles () {\n\n\t$roles = array ();\n\t$user_roles = user_roles();\n\t\n\tunset ($user_roles[1]); // Deleting anonymous role. By default at index 1.\n\tunset ($user_roles[2]); // Deleting authenticated role. By default at index 2.\n\t\n\tforeach ($user_roles as $rid=>$user_role) {\n\t\t$roles[$rid] = $user_role;\n\t}\n\n\treturn $roles;\n}", "public function ObtenerRolesSupeAdmin()\r\n {\r\n return Rol::all();\r\n }", "public function getRolesData()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n 'SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Role p'\n \n );\n $result = $query->getResult();\n \n return $result;\n }", "public function all()\n {\n $qb = $this->em->createQueryBuilder();\n $qb->select('r')\n ->from(Role::class, 'r');\n\n return $qb->getQuery()->getResult();\n }", "public function all()\n {\n $roles = collect($this->table()->where('user_id', $this->user->id())->get());\n\n if ($roles->isEmpty()) {\n return collect();\n }\n\n return $roles; // todo: groups\n }", "public function get_roles()\n {\n $users_roles = user_role_active_record::search()->where('uid', $this->uid)->exec();\n $roles = array();\n foreach ($users_roles as $users_role) {\n $roles[] = role_active_record::search()->where('rid', $users_role->rid)->execOne();\n }\n return $roles;\n }", "public function findAll() {\n\n // Récupération des différents type d'utilisateur\n $result = $this->getDb()->fetchAll(\"select * from roles order by nom asc\");\n \n $roles = array();\n foreach ($result as $row) {\n $roles[$row['id']] = $this->buildDomainObject($row);\n }\n return $roles;\n }", "public function getRole($queryReturn = true){\n $data = $this->belongsTo(Role::class,'role_id');\n return $queryReturn ? $data : $data->first();\n }", "public function findRoles() {\n\t\t\n\t}", "public function listAll()\n {\n $roles = $this->model->lists('name', 'id');\n\n return $roles;\n }", "public function getRoles() {\n $ds = \\dibi::dataSource(\"\n SELECT r.*, rr.name AS parent_name\n FROM users_roles AS r\n LEFT JOIN users_roles AS rr ON rr.id = r.parent_id\n \");\n\n return $ds;\n }", "public function role(){\n $obj = $this->hasMany(UserRole::class,'user_id','id')\n ->join('role', 'role.id', '=', 'role_id')->with('permissions');\n return $obj;\n }", "public function getRoleId()\n {\n return $this->db->get('role_id')->result_array();\n }", "public function getRoles(): array;", "function getAdminUsers(){\n\tglobal $connection, $roles;\n\t$sql = \"SELECT * FROM Accounts WHERE role IS NOT NULL\";\n\t$result = mysqli_query($connection, $sql);\n\t$users = mysqli_fetch_all($result, MYSQLI_ASSOC);\n\n\treturn $users;\n}", "public static function getProjectRole(){\n\t\t$db = DemoDB::getConnection();\n $sql = \"SELECT name\n FROM project_role\n\t\t\tWHERE name != 'Owner'\";\n $stmt = $db->prepare($sql);\n $ok = $stmt->execute();\n if ($ok) {\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }\n\t}", "public function roles(): MorphToMany;", "public function mostrar(){ \n $role = DB::table('roles as r')\n //->join('roles as r','m.idMiembro','=','r.idRole') \n ->select('r.idrole', 'r.descripcionrole')\n ->get();\n return $role;\n }", "public function rolesForUser();", "private function getUserRole($id) { \n $dv_role = Yii::$app->db->createCommand(\"SELECT meta_value FROM assist_user_meta WHERE uid = '$id' AND meta_key = 'role'\")->queryAll();\n return $dv_role;\n }", "function get_emp_access_roles(){\r\n\t\t$user_authdet = $this->session->userdata('user_authdet');\r\n\r\n\t\t$access_list_res = $this->db->query(\"SELECT role_id,role_name\r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM m_employee_roles\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE role_id > 1 \");\r\n\t\t\t\t\r\n\t\t\t\r\n\t\tif($access_list_res->num_rows()){\r\n\t\t\treturn $access_list_res->result_array();\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public function roles()\n {\n \treturn $this->belongsTo('App\\Models\\User','roles','id');\n }", "public function getRolesList()\n\t{\n\t\t$roles = Role::select('name as text', 'id')->get();\n\t\treturn $roles;\n\t}", "private function roles($id){\n $role = Rol::find($id);\n return $role->users;\n }", "public function getRoles(): array {\n\t\t$sql = 'SELECT id, name FROM roles';\n\t\treturn $this->queryRows($sql);\n\t}", "public function getRoles()\n {\n $roles = Role::lists('name','id');\n\n return $roles;\n }", "public static function getAll()\n {\n return Role::with(['permissions'])->get();\n }", "public static function userdept(){\n $rolelist = [];\n $db = Db::getInstance(); \t \n $req = $db->query('SELECT * FROM user_department'); \n foreach($req->fetchAll() as $row) {\n $rolelist[] = $row;\n }\n return $rolelist;\n \n }", "public function index()\n {\n return Roles::all();\n }", "function getdataroleuser()\n\t{\n\t\t$query = $this->db->query(\"SELECT roleuser,koderole FROM roleuser \");\n\t\t// print_r($query);\n\t\t// exit();\n\t\treturn $query->result();\n\t}", "public function roles()\n {\n return $this->belongsToMany('App\\Role', 'user_roles');\n\t}", "public function roles();", "public function roles();", "public function roles();" ]
[ "0.71899444", "0.716844", "0.7125367", "0.7072232", "0.6991448", "0.698676", "0.69687694", "0.69639075", "0.6926662", "0.6888963", "0.68565255", "0.68565255", "0.68399596", "0.68283665", "0.68247694", "0.6803391", "0.6792577", "0.6760366", "0.67563844", "0.67539054", "0.6662545", "0.6641829", "0.66282564", "0.6625254", "0.6620011", "0.66026276", "0.65677035", "0.65580726", "0.6533123", "0.6532434", "0.6529705", "0.65256095", "0.65169305", "0.65162677", "0.6503397", "0.64996994", "0.6485583", "0.6441832", "0.64417607", "0.64299655", "0.64289266", "0.6417208", "0.64140755", "0.6399432", "0.6380664", "0.63762665", "0.6352735", "0.63215786", "0.6300143", "0.62878746", "0.62854713", "0.6276868", "0.6275574", "0.6274428", "0.6259747", "0.6257847", "0.6257454", "0.6250483", "0.6244381", "0.6232657", "0.622584", "0.622584", "0.62236595", "0.6223181", "0.62174624", "0.6211808", "0.6209169", "0.61890703", "0.6178075", "0.617199", "0.6170333", "0.61652917", "0.6163783", "0.61577076", "0.6141466", "0.6128455", "0.611664", "0.6112865", "0.6098333", "0.60906726", "0.60882825", "0.6076185", "0.60713696", "0.6061866", "0.6046407", "0.60380656", "0.6034673", "0.60338145", "0.60290265", "0.6021711", "0.6021454", "0.60133034", "0.6010657", "0.5976641", "0.5967088", "0.59646946", "0.5962417", "0.59579563", "0.5951375", "0.5951375", "0.5951375" ]
0.0
-1
endif if SODIUM_LIBRARY_VERSION_MAJOR > 9 || (SODIUM_LIBRARY_VERSION_MAJOR == 9 && SODIUM_LIBRARY_VERSION_MINOR >= 6)
function sodium_crypto_pwhash_str_needs_rehash(string $password, int $opslimit, int $memlimit): bool {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function birdseye_component_checkversion()\n{\n if (!function_exists('get_product_release'))\n return false;\n if (get_product_release() < 207)\n return false;\n\n return true;\n}", "public function compatVersionConditionMatchesOlderRelease() {}", "public function compatVersionConditionMatchesOlderRelease() {}", "function upgrade_372()\n {\n }", "public function compatVersionConditionMatchesSameRelease() {}", "public function compatVersionConditionMatchesSameRelease() {}", "function upgrade_330()\n {\n }", "function rename_component_checkversion()\n{\n // Needs permission fix in reconfigure_nagios.sh script in 2011R2.4\n if (!function_exists('get_product_release') || get_product_release() < 300) {\n return false;\n }\n return true;\n}", "function alertstream_component_checkversion()\n{\n if(!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 500) {\n return false;\n }\n return true;\n}", "function alertcloud_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 126) {\n return false;\n }\n return true;\n}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "public function compatVersionConditionDoesNotMatchNewerRelease() {}", "function plugin_compatible_with_this_geeklog_version()\n{\n if (!function_exists('COM_truncate') || !function_exists('MBYTE_strpos')) {\n return false;\n }\n\n if (!function_exists('SEC_createToken')) {\n return false;\n }\n\n return true;\n}", "function mrl_check_versions()\r\n{\r\n $versions = get_option('MyReadingLibraryVersions');\r\n if (empty($versions) ||\r\n\t\t$versions['db'] < MY_READING_LIBRARY_DB ||\r\n\t\t$versions['options'] < MY_READING_LIBRARY_OPTIONS ||\r\n\t\t$versions['rewrite'] < MY_READING_LIBRARY_REWRITE)\r\n {\r\n\t\tmrl_install();\r\n }\r\n}", "function scheduledreporting_component_checkversion()\n{\n if (!function_exists('get_product_release')) {\n return false;\n }\n if (get_product_release() < 512) {\n return false;\n }\n return true;\n}", "function is_support_swap_mobile_below_header_sections() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound\n\t_deprecated_function( __FUNCTION__, '3.6.2', 'astra_addon_swap_mobile_below_header_sections()' );\n\treturn astra_addon_swap_mobile_below_header_sections();\n}", "function hideforums_is_installed() {\n\tglobal $mybb;\n\t\n\tif(empty($mybb->settings['hideforum_fid'])) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "private static function is_version_1_8_or_higher() {\r\n\t\tswitch (Config::get_value(ConfigJQueryUI::VERSION)) {\r\n\t\t\tcase '1.8':\r\n\t\t\tcase '1.9':\r\n\t\t\tcase '1.10':\r\n\t\t\t\treturn true;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t}", "function is_support_swap_mobile_above_header_sections() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound\n\t_deprecated_function( __FUNCTION__, '3.6.2', 'astra_addon_support_swap_mobile_above_header_sections()' );\n\treturn astra_addon_support_swap_mobile_above_header_sections();\n}", "function upgrade_460()\n {\n }", "private static function is_version_1_8() {\r\n\t\treturn Config::get_value(ConfigJQueryUI::VERSION) == '1.8';\r\n\t}", "public function getLibraryVersion()\n {\n }", "function sitemgr_upgrade0_9_14_002()\n{\n\tglobal $setup_info;\n\t$setup_info['sitemgr']['currentver'] = '0.9.14.003';\n\n\t//$cat_db_so =& CreateObject('sitemgr.Categories_db_SO');\n\n\t//$cat_db_so->convert_to_phpgwapi();\n\n\t// Finally, delete the categories table\n\t//$GLOBALS['egw_setup']->oProc->DropTable('phpgw_sitemgr_categories');\n\n\t// Turns out that convert_to_phpgwapi() must be run under\n\t// the normal phpgw environment and not the setup env.\n\t// This upgrade routine has been moved to the main body\n\t// of code.\n\n\treturn $setup_info['sitemgr']['currentver'];\n}", "function wpmudev_remove_version() {\nreturn '';\n}", "function is_android()\n {\n return dev::isAndroid();\n }", "function upgrade_431()\n {\n }", "function version() {\n\t\treturn 2;\n\t}", "function fiftyone_degrees_get_supported_version() {\n return '3.1';\n}", "function upgrade_450()\n {\n }", "function upgrade_340()\n {\n }", "function fiorello_mikado_core_plugin_installed() {\n\t\treturn defined( 'FIORELLO_CORE_VERSION' );\n\t}", "public function hasVersion(){\n return $this->_has(3);\n }", "function upgrade_280()\n {\n }", "function _isBrowserLinuxFF($ua_ok) {\r\n\t\t return ( (eregi( \"Linux\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"rv:[1]\\.[7]\\.[5]\", $ua_ok ) && eregi( \"[1]\\.[0]\", $ua_ok ) ) ||\r\n\t\t\t\t\t(eregi( \"Linux\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"[1]\\.[8]\\.[1]\\.[1]\", $ua_ok ) ) ||\r\n\t\t\t\t\t(eregi( \"Linux\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"[1]\\.[0]\\.[7]\", $ua_ok ) ) ||\r\n\t\t\t\t\t(eregi( \"Linux\", $ua_ok ) && eregi( \"firefox\", $ua_ok ) && eregi( \"[1]\\.[5]\\.[0]\", $ua_ok ) ) ||\r\n\t\t\t\t\t(eregi( \"Linux\", $ua_ok ) && eregi( \"mozilla\", $ua_ok ) && eregi( \"rv:[1]\\.[7]\\.[12]\", $ua_ok ) )\r\n\t\t\t\t );\r\n\t}", "function __requirements(){\n\nglobal $__settings, $error, $software;\n\n\t//If there are some shorfalls then pass it to $error and return false\n\tif(sversion_compare($__settings['ver'], '5.5.2.1', '<')){\n\t\t$error[] = 'You cannot upgrade to '.$software['ver'].' unless you have upgraded to 5.5.2.1';\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\n}", "private static function isPhpBug61767Fixed() {\n if (\\PHP_VERSION_ID >= 50400)\n return \\PHP_VERSION_ID >= 50408;\n return \\PHP_VERSION_ID >= 50318;\n }", "function sitemgr_upgrade1_4_002()\n{\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'] = '1.5.001';\n}", "function upgrade_370()\n {\n }", "function is_samsung()\n {\n return dev::isSamsung();\n }", "function upgrade_270()\n {\n }", "function upgrade_590()\n {\n }", "function upgrade_210()\n {\n }", "function find_odbc(){\n /* \n check on 32/64 bits system ubuntu/centos\n /usr/lib/libodbcinst.so /usr/lib/libodbc.so\n /usr/lib64/libodbcinst.so /usr/lib64/libodbc.so\n */\n if (file_exists('/usr/lib/libodbc.so') && file_exists('/usr/lib/libodbcinst.so')){\n return True;\n }\n else if(file_exists('/usr/lib64/libodbc.so') && file_exists('/usr/lib64/libodbcinst.so')){\n return True;\n }\n else return False;\n}", "public static function isStable()\n {\n return (bool) preg_match('/^[0-9\\.]+$/', static::VERSION);\n }", "public static function old_version() {\n\n\t\tif ( class_exists( 'TM_Custom_Prices' ) ) {\n\t\t\treturn TRUE;\n\t\t}\n\n\t\treturn FALSE;\n\n\t}", "function upgrade_290()\n {\n }", "public function isAboveShopwareVersion52()\n {\n // return if this is shopware 5.2\n return $this->versionCompare( '5.2.0', '>=' );\n }", "function get_api_version()\n\t{\n\t\treturn 6;\n\t}", "public function hasVersion(){\n return $this->_has(1);\n }", "function plugin_compatible_with_this_geeklog_version ()\n{\n return true;\n}", "function ifi_CIM_checkforupdates()\n{\n//ifi_pmpro_CIM_db_version\nglobal $ifi_pmpro_CIM_db_version;\nif($ifi_pmpro_CIM_db_version < 2.0)\nifi_pmpro_CIM_setDBTables();\n}", "public function isAndroid () : bool {\n\t}", "function xmldb_cognitivefactory_upgrade($oldversion = 0) {\n/// older versions to match current functionality \n\n global $CFG;\n\n $result = true;\n\n // Moodle 2.0 line\n \n return true;\n}", "function is_astra_theme_3_5_0_version() { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedFunctionFound\n\t_deprecated_function( __FUNCTION__, '3.6.2', 'astra_addon_check_theme_3_5_0_version()' );\n\treturn astra_addon_check_theme_3_5_0_version();\n}", "public function testLibraryNameConflicts() {\n /** @var \\Drupal\\Core\\Asset\\LibraryDiscoveryInterface $library_discovery */\n $library_discovery = \\Drupal::service('library.discovery');\n $farbtastic = $library_discovery->getLibraryByName('common_test', 'jquery.farbtastic');\n $this->assertEquals('0.1', $farbtastic['version'], 'Alternative libraries can be added to the page.');\n }", "function plugin_depends_core($core_version)\n\t{\n\t\tglobal $version;\n\t\t$core_version = (int) $core_version;\n\t\t\n\t\tif ($version < $core_version)\n\t\t\tthrow new PluginException(sprintf(_echo('plugins:exception:platformdependency'), $core_version, $version)); \n\t\t\t\n\t\treturn true;\n\t}", "public function library()\n\t{\n\t\n\t}", "function is_php_version_compatible($required)\n {\n }", "function tidypics_is_upgrade_available() {\n\t// sets $version based on code\n\trequire_once elgg_get_plugins_path() . \"tidypics/version.php\";\n\n\t$local_version = elgg_get_plugin_setting('version', 'tidypics');\n\tif ($local_version === false) {\n\t\t// no version set so either new install or really old one\n\t\tif (!get_subtype_class('object', 'image') || !get_subtype_class('object', 'album')) {\n\t\t\t$local_version = 0;\n\t\t} else {\n\t\t\t// set initial version for new install\n\t\t\telgg_set_plugin_setting('version', $version, 'tidypics');\n\t\t\t$local_version = $version;\n\t\t}\n\t} elseif ($local_version === '1.62') {\n\t\t// special work around to handle old upgrade system\n\t\t$local_version = 2010010101;\n\t\telgg_set_plugin_setting('version', $local_version, 'tidypics');\n\t}\n\n\tif ($local_version == $version) {\n\t\treturn false;\n\t} else {\n\t\treturn true;\n\t}\n}", "function version() {\r\n return(\"4.0\");\r\n }", "function microblog_upgrade($nom_meta_base_version,$version_cible){\n\t$current_version = 0.0;\n\tif ( (!isset($GLOBALS['meta'][$nom_meta_base_version]) )\n\t\t\t|| (($current_version = $GLOBALS['meta'][$nom_meta_base_version])!=$version_cible)){\n\n\t\tif ($current_version==0.0){\n\t\t\tsql_alter(\"table spip_articles ADD microblog VARCHAR(140) DEFAULT '' NOT NULL\");\n\t\t\tecrire_meta($nom_meta_base_version,$current_version=$version_cible);\n\t\t}\n\t}\n}", "function mrl_header_stats() {\r\n echo '\r\n\t<meta name=\"my_reading_library-version\" content=\"' . MY_READING_LIBRARY_VERSION . '\" />\r\n\t';\r\n}", "function raw_get_db_version()\r\n{\r\n\treturn sqlite_libversion();\r\n}", "private function compatibility_check_for_ios() {\n $reges = '/ip(?:hone|[ao]d); cpu os \\K[\\d_]+/i';\n preg_match($reges, $_SERVER['HTTP_USER_AGENT'], $matches, PREG_OFFSET_CAPTURE, 0);\n\n if (empty($matches))\n return true;\n\n $ios_version = $matches[0][0];\n $ios_version = (int)explode('_', $ios_version)[0];\n\n if ($ios_version === 0)\n return true;\n\n return $ios_version > 9;\n }", "function sitemgr_upgrade0_9_15_006()\n{\n\t$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_sitemgr_categories_state','index_page_id',array(\n\t\t'type' => 'int',\n\t\t'precision' => '4',\n\t\t'default' => '0'\n\t));\n\n\t$GLOBALS['setup_info']['sitemgr']['currentver'] = '0.9.15.007';\n\treturn $GLOBALS['setup_info']['sitemgr']['currentver'];\n}", "function rawpheno_function_sreader_version() {\n if (libraries_get_path('d3')) {\n $file = libraries_get_path('spreadsheet-reader') . '/CHANGELOG.md';\n\n $f = fopen($file, 'r');\n if ($f === FALSE) {\n $ver = 0;\n }\n else {\n $c = fread($f, filesize($file));\n\n $lines = explode(\"\\n\", $c);\n $i = 0;\n\n $ver = str_replace('#', '', $lines[0]);\n }\n }\n else {\n $ver = 0;\n }\n\n return $ver;\n}", "function upgrade_420()\n {\n }", "function sitemgr_upgrade0_9_13_001()\n{\n\tglobal $setup_info;\n\t$setup_info['sitemgr']['currentver'] = '0.9.14.001';\n\n\t$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_sitemgr_pages',\n\t\t'sort_order',array('type'=>int, 'precision'=>4));\n\t$GLOBALS['egw_setup']->oProc->AddColumn('phpgw_sitemgr_categories',\n\t\t'sort_order',array('type'=>int, 'precision'=>4));\n\n\treturn $setup_info['sitemgr']['currentver'];\n}", "function has_release_on_freemius() {\n\t\t\treturn ! $this->is_org_repo_compliant() ||\n\t\t\t $this->has_premium_version();\n\t\t}", "function wp_check_browser_version()\n {\n }", "private static function initVersionCompatibility()\n {\n $reflection = new ReflectionClass('Iterator');\n $extension = strtolower($reflection->getExtensionName());\n $extension = ($extension === '' ? 'standard' : $extension);\n\n if (defined('CORE_PACKAGE') === false ) {\n define('CORE_PACKAGE', '+' . $extension);\n }\n }", "public static function isTypo3VersionAboveTypo343() {\r\n\t\tif(!defined('TX_MULTICOLUMN_TYPO3_4-3')) return true;\r\n\t}", "function uf_create_release_db_libre_V_3_52()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_2008_1_20\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: NOMINA\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 14/03/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n\t\t\t $ls_sql=\"ALTER TABLE sno_hpersonalnomina \".\r\n\t\t\t \t\t \" ADD COLUMN grado CHAR(4) DEFAULT '0000';\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\"ALTER TABLE sno_hpersonalnomina \".\r\n\t\t\t \t\t \" ADD COLUMN grado CHAR(4) DEFAULT '0000';\";\r\n\t\t\t break;\t\t\t \r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.52\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}", "function uf_create_release_db_libre_V_3_56()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_3_56\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: Caja y banco\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 30/04/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql=\"ALTER TABLE scb_cheques ADD COLUMN orden SMALLINT(3) UNSIGNED DEFAULT 0;\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\"ALTER TABLE scb_cheques ADD COLUMN orden int2 DEFAULT 0;\";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.56\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}", "public function libraryOk(): bool;", "private function getVersionInfo() {\n $store = $this->dataStoreGet(array('platform'));\n $server = (!empty($store) && isset($store['platform'])) ? $store['platform']['php_quantum']['SERVER'] : \\Drupal::request()->server->all();\n $ver = array();\n\n $ver['base_version'] = \\Drupal::VERSION;\n $install_root = $server['DOCUMENT_ROOT'] . base_path();\n $ver['distribution'] = '';\n\n // Determine if this puppy is Acquia Drupal.\n acquia_connector_load_versions();\n\n if (IS_ACQUIA_DRUPAL) {\n $ver['distribution'] = 'Acquia Drupal';\n $ver['ad']['version'] = ACQUIA_DRUPAL_VERSION;\n $ver['ad']['series'] = ACQUIA_DRUPAL_SERIES;\n $ver['ad']['branch'] = ACQUIA_DRUPAL_BRANCH;\n $ver['ad']['revision'] = ACQUIA_DRUPAL_REVISION;\n }\n\n // @todo: Review all D8 distributions!\n // Determine if we are looking at Pressflow.\n if (defined('CACHE_EXTERNAL')) {\n $ver['distribution'] = 'Pressflow';\n $press_version_file = $install_root . './PRESSFLOW.txt';\n if (is_file($press_version_file)) {\n $ver['pr']['version'] = trim(file_get_contents($press_version_file));\n }\n }\n // Determine if this is Open Atrium.\n elseif (is_dir($install_root . '/profiles/openatrium')) {\n $ver['distribution'] = 'Open Atrium';\n $version_file = $install_root . 'profiles/openatrium/VERSION.txt';\n if (is_file($version_file)) {\n $ver['oa']['version'] = trim(file_get_contents($version_file));\n }\n }\n // Determine if this is Commons.\n elseif (is_dir($install_root . '/profiles/commons')) {\n $ver['distribution'] = 'Commons';\n }\n // Determine if this is COD.\n elseif (is_dir($install_root . '/profiles/cod')) {\n $ver['distribution'] = 'COD';\n }\n\n return $ver;\n }", "function complete_version_removal() { return ''; }", "function uf_create_release_db_libre_V_3_55()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_3_55\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: Configuracion\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 23/04/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql=\"ALTER TABLE tepuy_empresa ADD COLUMN estvaldis CHAR(1) DEFAULT 1;\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\"ALTER TABLE tepuy_empresa ADD COLUMN estvaldis CHAR(1) DEFAULT 1;\";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.55\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}", "function bajweb_remove_meta_version() {\n\treturn '';\n}", "function plugin_compatible_with_this_version_calendarv2($pi_name)\n{\n global $_CONF, $_DB_dbms;\n\n // check if we support the DBMS the site is running on\n $dbFile = $_CONF['path'] . 'plugins/' . $pi_name . '/sql/'\n . $_DB_dbms . '_install.php';\n if (!file_exists($dbFile)) {\n return false;\n }\n\n // add checks here\n //FIXME: Check PHP/Geeklog version\n\n return true;\n}", "function logonscreener_requirements() {\n if (version_compare(PHP_VERSION, '5.2.1') < 0) {\n logonscreener_log('Your PHP is too old. Go get the latest.');\n exit;\n }\n if (!function_exists('imagegd2') && (!function_exists('dl') || !@dl('php_gd2.dll'))) {\n logonscreener_log('GD is disabled.');\n }\n}", "function shGetSobi2Config($key, $section)\n{\n\tShlSystem_Log::debug('sh404sef', 'Using removed shGetSobi2Config function, not applicable anymore');\n\treturn false;\n}", "function _isCurl()\n{\n return function_exists('curl_version');\n}", "function gd_version_check($user_ver = 0)\n\t{\n\t\tif (! extension_loaded('gd'))\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\n\t\tstatic $gd_ver = 0;\n\t\t// Just accept the specified setting if it's 1.\n\t\tif ($user_ver == 1) \n\t\t{\n\t\t\t$gd_ver = 1;\n\t\t \treturn 1; \n\t\t}\n\t\t// Use the static variable if function was called previously.\n\t\tif ($user_ver !=2 && $gd_ver > 0 ) \n\t\t{ \n\t\t\treturn $gd_ver;\n\t\t}\n\t\t// Use the gd_info() function if possible.\n\t\tif (function_exists('gd_info')) \n\t\t{\n\t\t\t$ver_info = gd_info();\n\t\t\tpreg_match('/\\d/', $ver_info['GD Version'], $match);\n\t\t\t$gd_ver = $match[0];\n\t\t\treturn $match[0];\n\t\t}\n\t\t// If phpinfo() is disabled use a specified / fail-safe choice...\n\t\tif (preg_match('/phpinfo/', ini_get('disable_functions'))) \n\t\t{\n\t\t\tif ($user_ver == 2) \n\t\t\t{\n\t\t\t\t$gd_ver = 2;\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t$gd_ver = 1;\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\t// ...otherwise use phpinfo().\n\t\tob_start();\n\t\tphpinfo(INFO_MODULES);\n\t\t$info = ob_get_contents();\n\t\tob_end_clean();\n\t\t$info = stristr($info, 'gd version');\n\t\tpreg_match('/\\d/', $info, $match);\n\t\t$gd_ver = $match[0];\n\t\treturn $match[0];\n\t}", "function module_builder_drush_init_helper() {\n // Set up the MB factory.\n \\DrupalCodeBuilder\\Factory::setEnvironmentLocalClass('Drush')\n ->setCoreVersionNumber(drush_drupal_version());\n}", "function plugin_estimation_check_prerequisites() {\n\n //Version check is not done by core in GLPI < 9.2 but has to be delegated to core in GLPI >= 9.2.\n $version = preg_replace('/^((\\d+\\.?)+).*$/', '$1', GLPI_VERSION);\n if (version_compare($version, '9.2', '<')) {\n echo \"This plugin requires GLPI >= 9.2\";\n return false;\n }\n return true;\n}", "function wp_check_php_mysql_versions()\n {\n }", "function uf_create_release_db_libre_V_3_53()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_2008_1_21\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: NOMINA\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 14/03/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n\t\t\t $ls_sql=\"ALTER TABLE sno_thpersonalnomina \".\r\n\t\t\t \t\t \" ADD COLUMN grado CHAR(4) DEFAULT '0000';\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\"ALTER TABLE sno_thpersonalnomina \".\r\n\t\t\t \t\t \" ADD COLUMN grado CHAR(4) DEFAULT '0000';\";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.53\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t return $lb_valido;\t\r\n\t}", "function uf_create_release_db_libre_V_3_61()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_3_61\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: Caja y Banco\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 07/05/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql= \" ALTER TABLE scb_cheques ADD COLUMN codusu VARCHAR(30) NOT NULL DEFAULT '-'\";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\t\" ALTER TABLE scb_cheques ADD COLUMN codusu VARCHAR(30) NOT NULL DEFAULT '-'\";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.61\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t\t\r\n\t return $lb_valido;\t\r\n\t}", "function is_mobile(){\n $init =& get_instance();\n\n $init->load->library('Mobile_Detect');\n $detect = new Mobile_Detect;\n if (!$detect->isMobile()) {\n return false;\n } else {\n return true;\n }\n}", "private function isMySQL8AfterFix()\n {\n $results = DB::select(DB::raw('select version()')->getValue(DB::connection()->getQueryGrammar()));\n $mysql_version = $results[0]->{'version()'};\n\n return version_compare($mysql_version, '8.0.4', '>=');\n }", "protected function supportsBoris()\n\t{\n\t\treturn extension_loaded('readline') && extension_loaded('posix') && extension_loaded('pcntl');\n\t}", "function dimaan_remove_version() { return ''; }", "function upgrade_230()\n {\n }", "function uf_create_release_db_libre_V_3_47()\r\n\t{\r\n\t\t$lb_valido=true;\r\n\t\t$ls_sql=\"\";\r\n\t\tswitch($_SESSION[\"ls_gestor\"])\r\n\t\t{\r\n\t\t\tcase \"MYSQL\":\r\n\t\t\t$ls_sql=\" ALTER TABLE tepuy_empresa ADD COLUMN confiva VARCHAR(1) DEFAULT 'P'; \";\r\n\t\t\tbreak;\r\n\t\t\t\r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t$ls_sql=\" ALTER TABLE tepuy_empresa ADD COLUMN confiva varchar(1) DEFAULT 'P'; \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.47\");\t\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n return $lb_valido;\t\r\n\t}", "function uf_create_release_db_libre_V_3_34()\r\n\t\t{\r\n\t\t\t$lb_valido=true;\r\n\t\t\t$ls_sql=\"\";\r\n\t\t\tswitch($_SESSION[\"ls_gestor\"])\r\n\t\t\t{\r\n\t\t\t\tcase \"MYSQL\":\r\n\t\t\t\t$ls_sql=\"ALTER TABLE tepuy_empresa ADD COLUMN confi_ch char(1);\";\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\t\tcase \"POSTGRE\":\r\n\t\t\t\t$ls_sql=\"ALTER TABLE tepuy_empresa ADD COLUMN confi_ch char(1);\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\t\tif($li_row===false)\r\n\t\t\t{ \r\n\t\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.34\");\t\r\n\t\t\t\t $lb_valido=false;\r\n\t\t\t}\r\n\t return $lb_valido;\t\r\n\t }", "function isBrandNew()\n\t{\n\t\treturn !$this->getHandler()->isExists();\n\t}", "function uf_create_release_db_libre_V_3_59()\r\n\t{\r\n\t\t/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t\t//\t Function: uf_create_release_db_libre_V_3_59\r\n\t\t//\t\t Access: public \r\n\t\t// Modulos: Activos Fijos\r\n\t\t//\t Description: \r\n\t\t// Fecha Creacion: 05/05/2008 \t\t\t\t\t\t\t\tFecha Ultima Modificacion : \r\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////\r\n\t $lb_valido=true;\r\n\t $ls_sql=\"\";\r\n\t switch($_SESSION[\"ls_gestor\"])\r\n\t {\r\n\t\t\tcase \"MYSQL\":\r\n \t\t\t $ls_sql= \" ALTER TABLE saf_dta ADD estactpre SMALLINT DEFAULT 0; \";\r\n\t\t\t break;\r\n\t\t\t \r\n\t\t\tcase \"POSTGRE\":\r\n\t\t\t $ls_sql=\t\" ALTER TABLE saf_dta ADD estactpre INT2 DEFAULT 0; \";\r\n\t\t\t break;\r\n\t\t}\t\r\n\t\t$li_row=$this->io_sql->execute($ls_sql);\r\n\t\tif($li_row===false)\r\n\t\t{ \r\n\t\t\t $this->io_msg->message(\"Problemas al ejecutar Release 3.59\");\r\n\t\t\t $lb_valido=false;\r\n\t\t}\r\n\t\t\r\n\t return $lb_valido;\t\r\n\t}", "function joe_uah_plugins_check() {\n\n\t// Set constants for active third party plugins\n\tdefine( 'JOE_UAH_MINIORANGE_2_FACTOR', class_exists( 'Miniorange_Authentication' ) );\n\n}", "abstract public function version();", "abstract public function version();" ]
[ "0.547371", "0.5401517", "0.5400816", "0.5395058", "0.5249138", "0.5248671", "0.5239694", "0.5206099", "0.5184621", "0.5157504", "0.51514", "0.5150201", "0.51059", "0.5060673", "0.5039128", "0.49627578", "0.4958531", "0.4942118", "0.49242577", "0.48297217", "0.48185757", "0.4818494", "0.48121884", "0.48114848", "0.4806028", "0.48015726", "0.47842032", "0.47659522", "0.47649014", "0.4752864", "0.4748646", "0.4748444", "0.4746363", "0.47121608", "0.4710954", "0.46962878", "0.4693163", "0.4692321", "0.46887204", "0.4661672", "0.46430814", "0.4642361", "0.46366635", "0.46313214", "0.46301568", "0.46300966", "0.4627292", "0.4619555", "0.46081555", "0.46014127", "0.45993567", "0.45912465", "0.45844948", "0.45815155", "0.45806372", "0.45678413", "0.45676592", "0.45487818", "0.4546113", "0.45394447", "0.4537746", "0.45329234", "0.4529376", "0.45270625", "0.45106083", "0.45046088", "0.450336", "0.4499982", "0.44995004", "0.44957805", "0.44897848", "0.4476894", "0.4466711", "0.4461389", "0.44581223", "0.44524184", "0.44507658", "0.44489416", "0.4442432", "0.44419336", "0.44397497", "0.44326407", "0.4420248", "0.44172913", "0.44164816", "0.44160584", "0.4410123", "0.44010094", "0.43932065", "0.43917477", "0.43917227", "0.438948", "0.4389098", "0.43888032", "0.43879116", "0.43854654", "0.43768576", "0.4376392", "0.43733233", "0.43731877", "0.43731877" ]
0.0
-1
Helper method to quickly create a form with given fields and requirements.
protected function createForm(array $fields, array $requiredFields = []): Form { $fieldList = FieldList::create(); foreach ($fields as $name => $value) { $fieldList->add(TextField::create($name, $name, $value)); } $validator = new DependentRequiredFields($requiredFields); return Form::create(null, 'test', $fieldList, null, $validator); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function createFormFields() {\n\t}", "abstract public function createForm();", "abstract public function createForm();", "public function createForm();", "public function createForm();", "protected function form()\n {\n $form = new Form(new Purchase());\n if ($form->isCreating()) {\n $form->select('consumer_id', \"客户\")->options(Consumer::all()->pluck('full_name', 'id'))->required();\n $form->select('house_id', \"购买房源\")->options(House::purchasable()->pluck('readable_name', 'id'))->required();\n }\n $form->datetime('started_at', \"生效日期\");\n $form->datetime('ended_at', \"结束日期\");\n $form->select('sell_type', \"出售方式\")->options(Purchase::$type)->required();\n $form->currency('price', \"成交价格\")->symbol('¥')->required();\n\n return $form;\n }", "public static function createForm($request)\n {\n $db = Core::$db;\n $LANG = Core::$L;\n\n $rules = array();\n $rules[] = \"required,form_name,{$LANG[\"validation_no_form_name\"]}\";\n $rules[] = \"required,num_fields,{$LANG[\"validation_no_num_form_fields\"]}\";\n $rules[] = \"digits_only,num_fields,{$LANG[\"validation_invalid_num_form_fields\"]}\";\n $rules[] = \"required,access_type,{$LANG[\"validation_no_access_type\"]}\";\n\n $errors = validate_fields($request, $rules);\n if (!empty($errors)) {\n array_walk($errors, create_function('&$el','$el = \"&bull;&nbsp; \" . $el;'));\n $message = join(\"<br />\", $errors);\n return array(false, $message);\n }\n\n $config = array(\n \"form_type\" => \"form_builder\",\n \"form_name\" => $request[\"form_name\"],\n \"access_type\" => $request[\"access_type\"],\n \"submission_type\" => \"code\"\n );\n\n // set up the entry for the form\n list($success, $message, $new_form_id) = CoreForms::setupForm($config);\n\n $form_data = array(\n \"form_tools_form_id\" => $new_form_id,\n \"form_tools_display_notification_page\" => false\n );\n\n for ($i=1; $i<=$request[\"num_fields\"]; $i++) {\n $form_data[\"field{$i}\"] = $i;\n }\n CoreForms::initializeForm($form_data);\n\n $form_fields = Fields::getFormFields($new_form_id);\n\n $order = 1;\n\n // if the user just added a form with a lot of fields (over 50), the database row size will be too\n // large. Varchar fields (which with utf-8 equates to 1220 bytes) in a table can have a combined row\n // size of 65,535 bytes, so 53 is the max. The client-side validation limits the number of fields to\n // 1000. Any more will throw an error.\n $field_size_clause = ($request[\"num_fields\"] > 50) ? \", field_size = 'small'\" : \"\";\n\n foreach ($form_fields as $field_info) {\n if (preg_match(\"/field(\\d+)/\", $field_info[\"field_name\"], $matches)) {\n $db->query(\"\n UPDATE {PREFIX}form_fields\n SET field_title = :field_title,\n col_name = :col_name\n $field_size_clause\n WHERE field_id = :field_id\n \");\n $db->bindAll(array(\n \"field_title\" => \"{$LANG[\"word_field\"]} $order\",\n \"col_name\" => \"col_$order\",\n \"field_id\" => $field_info[\"field_id\"]\n ));\n $db->execute();\n $order++;\n }\n }\n\n CoreForms::finalizeForm($new_form_id);\n\n // if the form has an access type of \"private\" add whatever client accounts the user selected\n if ($request[\"access_type\"] == \"private\") {\n $selected_client_ids = $request[\"selected_client_ids\"];\n $queries = array();\n\n foreach ($selected_client_ids as $client_id) {\n $queries[] = \"($client_id, $new_form_id)\";\n }\n\n if (!empty($queries)) {\n $insert_values = implode(\",\", $queries);\n $db->query(\"\n INSERT INTO {PREFIX}client_forms (account_id, form_id)\n VALUES $insert_values\n \");\n }\n }\n\n // now apply a few simple changes to the View we just created, to simplify things for the\n $views = Views::getFormViews($new_form_id);\n $view_id = $views[0][\"view_id\"];\n\n // 1. Change the View name to \"Form Builder View\"\n $db->query(\"UPDATE {PREFIX}views SET view_name = 'Form Builder View' WHERE view_id = :view_id\");\n $db->bind(\"view_id\", $view_id);\n $db->execute();\n\n // 2. Change the View's first tab (the only one defined!) to be called \"Page 1\"\n $db->query(\"UPDATE {PREFIX}view_tabs SET tab_label = 'Page 1' WHERE view_id = :view_id AND tab_number = 1 LIMIT 1\");\n $db->bind(\"view_id\", $view_id);\n $db->execute();\n\n // 3. Change the View Field Group label to \"Fields\" instead of \"DATA\"\n $db->query(\"UPDATE {PREFIX}list_groups SET group_name = 'Fields' WHERE group_type = :group_type LIMIT 1\");\n $db->bind(\"group_type\", \"view_fields_{$view_id}\");\n $db->execute();\n\n return array(true, $LANG[\"notify_internal_form_created\"], $new_form_id);\n }", "private function createForm()\n\t{\n\t\t$builder = $this->getService('form')->create();\n\t\t$builder->setValidatorService($this->getService('validator'));\n\t\t$builder->setFormatter(new BasicFormFormatter());\n\t\t$builder->setDesigner(new DoctrineDesigner($this->getDoctrine(), 'Entity\\User',array('location')));\n\n\t\t$builder->getField('location')->setRequired(true);\n\t\t$builder->submit($this->getRequest());\n\n\t\treturn $builder;\n\t}", "public function CreateForm();", "function makeForm($request, $formOpts){\n\t\t#print_r ($request);\n\t\t$formDescriptor = array(\n\t\t\t'radioForm' => array(\n \t\t\t\t'type' => 'radio',\n \t\t\t\t'label' => 'Select a search type:',\n \t\t\t\t'options' => array( # The options available within the checkboxes (displayed => value)\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 0' => 0,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 1' => 1,\n\t\t\t\t\t\t\t\t\t\t\t\t'Radio button label 2' => 2,\n\t\t\t\t\t\t\t\t\t\t\t),\n \t\t\t\t'default' => 0 # The option selected by default (identified by value)\n \t\t\t),\n 'textfield1' => array(\n\t\t\t\t\t\t\t\t'label' => 'textfield 1 label', # What's the label of the field\n\t\t\t\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t\t\t\t),\n\t\t\t'textfield2' => array(\n\t\t\t\t\t'label' => 'textfield 2 label', # What's the label of the field\n\t\t\t\t\t'class' => 'HTMLTextField' # What's the input type\n\t\t\t\t\t), \t\t\t\t\n \t\t);\n\t\t\n\t\tswitch($formOpts){\n\t\t\tcase '1':\n\t\t\t\t$formDescriptor['textfield1']['label'] = 'textfield 1 label'; # What's the label of the field\n\t\t\t\t$formDescriptor['textfield2']['label'] = 'textfield 2 label'; # What's the label of the field\t\n\t\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t\t#same as case 1\n\t\t\tdefault:\n\t\t}\n\n\t\t#Submit button structure and page callback. \n $htmlForm = new HTMLForm( $formDescriptor, $this->getContext(), 'myform'); # We build the HTMLForm object, calling the form 'myform'\n $htmlForm->setSubmitText( 'Submit button text' ); # What text does the submit button display\n\t\t\n\t\t/* We set a callback function */ \n\t\t#This code has no function to the special page. It used to produce red wiki text callback such as \"Try Again\" commented-out below under processInput function. \n\t\t$htmlForm->setSubmitCallback( array( 'specialpagetemplate', 'processInput' ) ); # Call processInput() in specialpagetemplate on submit\n $htmlForm->show(); # Displaying the form\n\t}", "public function createForm()\n {\n }", "function create_from( \n $form_name, $action, $method = 'POST', $attributes = null \n ){\n // get class to create from\n $form_class = $form_name.'_form';\n return new $form_class( \n $this->app, $action, $method, $attributes \n );\n }", "public static function create() {\n\t\tFrmAppHelper::permission_check('frm_edit_forms');\n check_ajax_referer( 'frm_ajax', 'nonce' );\n\n\t\t$field_type = FrmAppHelper::get_post_param( 'field_type', '', 'sanitize_text_field' );\n\t\t$form_id = FrmAppHelper::get_post_param( 'form_id', 0, 'absint' );\n\n\t\t$field = self::include_new_field( $field_type, $form_id );\n\n // this hook will allow for multiple fields to be added at once\n do_action('frm_after_field_created', $field, $form_id);\n\n wp_die();\n }", "public static function generate($fields) {\n $form=\"\";\n $extraOptions=[];\n // wildCard will be applied all inputs\n $wildCard=isset($fields[\"*\"]) ? $fields[\"*\"]:[];\n // exclude given elements\n if(isset($fields[\"_exclude\"])) {\n foreach ($fields[\"_exclude\"] as $value) {\n unset($fields[$value]);\n }\n }\n foreach ($fields as $key => $val) {\n if($key==\"*\"||$key==\"_exclude\") continue;\n if(!empty($wildCard)) {\n $val=array_replace_recursive($val,$wildCard);\n }\n $inputOptions=isset($val[\"options\"]) ? $val[\"options\"] : [];\n \n $placeholder=isset($val[\"placeholder\"]) ? $val[\"placeholder\"] : null;\n switch ($val[\"type\"]) {\n case 'select':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$val[\"data\"],$inputOptions);\n break;\n case 'password':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$placeholder,$inputOptions);\n break;\n case 'checkbox':\n case 'radio':\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$val[\"value\"],null); // removed $val[\"checked\"] for unwanted results\n break;\n case 'color':\n case 'number':\n case 'file';\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$inputOptions);\n break;\n // other elements share the same parameters.\n default:\n try {\n\n $form.=cForm::{\"c\".ucfirst($val[\"type\"])}($key,$val[\"label\"],$placeholder,$inputOptions);\n }catch(\\Exception $err) {\n if(config('app.debug')==false) { // only show error on debug\n dump(\"Error on generating form\",$err,$key,$val);\n }\n }\n break;\n }\n }\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CompanyCulture());\n\n $form->text('name', '企业名称')->rules('required');\n $form->text('en_name', '企业名称(en)')->rules('required');\n $form->image('image_url', '图片')->rules('required|image');\n $form->editor('content', '内容')->rules('required');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`列表`按钮\n $tools->disableList();\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Customer);\n\n $form->text('code', '客户编号');\n $form->text('name', '客户名称');\n// $form->text('openid', '客户openid');\n $form->text('contactor', '联系人');\n $form->text('tel', '联系电话');\n $form->email('email', '邮箱');\n $form->text('address', '地址');\n $form->decimal('receivables', '应收账款数字')->default(0.00);\n $form->text('fax', '传真');\n $form->switch('is_delete', '是否删除');\n\n return $form;\n }", "public function createComponentQuestionForm() {\n $form = new Form;\n\n $form->addHidden('test_id');\n $form->addHidden('id');\n $form->addTextArea('text', 'Text')->setRequired();\n $form->addSubmit('submit');\n $form->setDefaults($this->questions->getById($this->questionId));\n $form->onSuccess[] = $this->questionFormSucceeded;\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goods);\n\n $form->text('title', trans('admin.title'))->required()->rules('required');\n $form->text('slogan', trans('admin.slogan'))->required()->rules('required');\n $form->text('name', trans('admin.name'))->required()->rules('required');\n $form->decimal('price', trans('admin.price'))->required()->rules('required');\n $form->display('created_at', trans('admin.created_at'));\n $form->display('updated_at', trans('admin.updated_at'));\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', 'No');\n $form->number('user_id', 'User id');\n $form->textarea('address', 'Address');\n $form->decimal('total_amount', 'Total amount');\n $form->textarea('remark', 'Remark');\n $form->datetime('paid_at', 'Paid at')->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', 'Payment method');\n $form->text('payment_no', 'Payment no');\n $form->text('refund_status', 'Refund status')->default('pending');\n $form->text('refund_no', 'Refund no');\n $form->switch('closed', 'Closed');\n $form->switch('reviewed', 'Reviewed');\n $form->text('ship_status', 'Ship status')->default('pending');\n $form->textarea('ship_data', 'Ship data');\n $form->textarea('extra', 'Extra');\n\n return $form;\n }", "private static function do_html_form_create($fields, $table){\n global $dbname;\n global $app_dir;\n $filename = Inflect::singularize($table);\n $form_str = '@extends(\\'layouts.bulma\\')'.\"\\n\";\n $form_str .= '@section(\\'title\\', \\'creating new '.Inflect::singularize($table).'\\')'.\"\\n\";\n $form_str .= '@section(\\'sidebar\\')'.\"\\n\";\n $form_str .= '@parent'.\"\\n\";\n $form_str .= '@endsection'.\"\\n\";\n $form_str .= '@section(\\'content\\')'.\"\\n\";\n $form_str .= '<form action=\"{{ route(\\''.$table.'.create\\') }}\" class=\"form container\" method=\"POST\" enctype=\"multipart/form-data\">';\n $form_str .= \"\\n\".' <h1 class=\"title is-3\">ADD '.strtoupper(str_replace(\"_\",\" \",Inflect::singularize($table))).'</h1>'.\"\\n\";\n foreach($fields as $field){\n $req = false;\n if(strpos($field[\"Type\"], \"int\")>-1 && $field[\"Key\"]!==\"MUL\"){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"number\", $table, $req);\n }else if($field[\"Key\"] === \"MUL\"){\n $form_str .= \" \".self::getSelectField($field[\"Field\"], $table);\n }else if(strpos($field[\"Type\"], \"varchar\")>-1){\n if($field[\"Null\"]===\"NO\") $req = true;\n $form_str .= \" \".self::getInputField($field[\"Field\"], \"text\", $table, $req);\n }else if(strpos($field[\"Type\"], \"text\")>-1){\n $form_str .= \" \".self::getTextarea($field[\"Field\"], $table);\n }\n }\n $form_str .= self::getButtonGrp();\n $form_str .= \"</form>\\n@endsection\";\n $file_dir = $app_dir.\"/resources/views/$table\";\n $views_file = $app_dir.\"/resources/views/$table/create.blade.php\";\n if(is_readable($views_file)){\n file_put_contents($views_file, $form_str);\n }else{\n exec(\"mkdir $file_dir\");\n exec(\"chmod -R 755 $app_dir./resources/views/\");\n $fp = fopen($views_file,\"w+\");\n fwrite($fp, \"file created\", 128);\n fclose($fp);\n file_put_contents($views_file, $form_str);\n }\n }", "protected function form()\n {\n $form = new Form(new RequestForConfirmation());\n\n $form->switch('status', __('Status'));\n $form->text('comment', __('Comment'));\n $form->select('user_id', __('User id'))->options(User::all()->pluck('name', 'id'))->required();\n $form->select('project_id', __('Project id'))->options(Project::all()->pluck('project_name', 'id'))->required();\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order());\n\n $form->switch('paid', __('Paid'));\n $form->datetime('reservation_expires', __('Reservation expires'))->default(date('Y-m-d H:i:s'));\n $form->decimal('price', __('Price'));\n\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableView();\n });\n\n\n\n return $form;\n }", "abstract function setupform();", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('name', __('Name'));\n $form->image('image', __('Image'));\n $form->text('intro', __('Intro'));\n $form->UEditor('details', __('Details'));\n $form->datetime('start_at', __('Start at'))->default(date('Y-m-d H:i:s'));\n $form->datetime('end_at', __('End at'))->default(date('Y-m-d H:i:s'));\n $form->text('location', __('Location'));\n $form->decimal('fee', __('Fee'))->default(0.00);\n $form->number('involves', __('Involves'));\n $form->number('involves_min', __('Involves min'));\n $form->number('involves_max', __('Involves max'));\n $form->switch('status', __('Status'));\n $form->text('organizers', __('Organizers'));\n $form->number('views', __('Views'));\n $form->switch('is_stick', __('Is stick'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new SpecificationTemplate());\n\n $form->text('name', __('Name'));\n $form->keyValues('content', __('Content'));\n $form->number('sort', __('Sort'))->default(0);\n $form->switch('is_display', __('Is display'))->default(1);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Resources);\n\n $form->text('name', '名称')->rules('required',['required' => '请输入 配置项的名称']);\n\n $form->radio('type', '类型')->options(Resources::TYPE);\n\n $form->cropper('url','图片');\n\n $form->number('sort_num','排序');\n\n $form->textarea('memo','备注');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Activity);\n\n $form->text('log_name', 'Log name');\n $form->textarea('description', 'Description');\n $form->number('subject_id', 'Subject id');\n $form->text('subject_type', 'Subject type');\n $form->number('causer_id', 'Causer id');\n $form->text('causer_type', 'Causer type');\n $form->text('properties', 'Properties');\n\n return $form;\n }", "public function createComponentGenerateForm() {\n $form = new Form;\n\n\n $groups = $this->groups->getForTest($this->user->id);\n\n $form->addSelect('groupBox', 'Skupina:', $groups);\n $form->addHidden('test_id', $this->getParameter('testId'));\n $form->addText('questionCount')->setRequired('Zadejte počet otázek');\n $form->addText('answerCount')->setRequired('Zadejte počet odpovědí');\n $form->addRadioList('pageFormat', 'Formát stránky', array('a4' => 'A4', 'a5' => 'A5'))\n ->setRequired('Vyberte formát stránky');\n $form->addTextArea('students');\n\n $form->onSuccess[] = callback($this, 'generateFormSubmitted');\n $form->addSubmit('submit');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Member);\n\n $form->text('open_id', 'Open id');\n $form->text('wx_open_id', 'Wx open id');\n $form->text('access_token', 'Access token');\n $form->number('expires', 'Expires');\n $form->text('refresh_token', 'Refresh token');\n $form->text('unionid', 'Unionid');\n $form->text('nickname', 'Nickname');\n $form->switch('subscribe', 'Subscribe');\n $form->switch('sex', 'Sex');\n $form->text('headimgurl', 'Headimgurl');\n $form->switch('disablle', 'Disablle');\n $form->number('time', 'Time');\n $form->mobile('phone', 'Phone');\n\n return $form;\n }", "protected function getTestForm()\n {\n $form = new T_Form_Get('test','A Test Form');\n $form->addChild(new T_Form_Fieldset('contact','Contact Details'));\n $form->contact->addChild(new T_Form_Text('name','Name'));\n $form->contact->name->setOptional();\n $form->contact->addChild(new T_Form_Text('email','Email'));\n $form->contact->email->setOptional();\n $form->contact->addChild(new T_Form_Upload('upload','Profile Image'));\n $form->contact->upload->setOptional();\n $form->addChild(new T_Form_Fieldset('register','Registration Details'));\n $form->register->addChild(new T_Form_Password('passwd','Password'));\n $form->register->passwd->setOptional();\n return $form;\n }", "protected function form()\n {\n $this->opt();\n $form = new Form(new ComDep);\n\n $form->text('alias', 'Alias');\n $form->text('name', 'Name');\n $form->select('company_id', 'Company')->options($this->optcom);\n $form->select('id_com_dep_admin', 'Company department admin')->options($this->optcomdep);\n $form->select('service_type_id', 'Service type')->options($this->optsertype);\n $form->textarea('info', 'Info');\n $form->textarea('info_for_vp_admin', 'Info for vp admin');\n $form->text('address', 'Address');\n $form->textarea('info_station', 'Info station');\n $form->text('telephone', 'Telephone');\n $form->text('e_mail', 'E mail');\n $form->text('class', 'Class');$form->saving(function (Form $form) {\n $form->model()->id_admin_add=Admin::user()->id;\n });\n\n return $form;\n }", "public function createForm($options = null) {\n if ($this->useTabbedForms) {\n $form = new \\Gems_TabForm($options);\n } else {\n $form = parent::createForm($options);\n //$form = new \\Gems_Form_TableForm($options);\n }\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->mobile('phone', __('手机号'));\n $form->text('uname', __('姓名'));\n $form->text('wechat', __('微信号'));\n $form->text('phonenumber', __('联系电话'));\n $form->text('position', __('岗位'));\n $form->text('company', __('公司'));\n $form->switch('role', __('角色'));\n $form->switch('state', __('核实状态'));\n $form->datetime('create_date', __('创建时间'))->default(date('Y-m-d H:i:s'));\n // $form->text('openid', __('Openid'));\n\n return $form;\n }", "public function buildFormFields()\n {\n $this->addField(\n SharpFormTextField::make('title')\n ->setLabel('Title')\n )->addField(\n SharpFormUploadField::make('cover')\n ->setLabel('Cover')\n ->setFileFilterImages()\n ->setCropRatio('1:1')\n ->setStorageBasePath('data/service')\n )->addField(\n SharpFormNumberField::make('price')\n ->setLabel('Price')\n )->addField(\n SharpFormMarkdownField::make('description')->setToolbar([\n SharpFormMarkdownField::B, SharpFormMarkdownField::I,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::IMG,\n SharpFormMarkdownField::SEPARATOR,\n SharpFormMarkdownField::A,\n ])\n )->addField(\n SharpFormTagsField::make('tags',\n Tag::orderBy('label')->get()->pluck('label', 'id')->all()\n )->setLabel('Tags')\n ->setCreatable(true)\n ->setCreateAttribute('name')\n );\n }", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('no', __('No'));\n $form->number('user_id', __('User id'));\n $form->textarea('address', __('Address'));\n $form->decimal('total_amount', __('Total amount'));\n $form->textarea('remark', __('Remark'));\n $form->datetime('paid_at', __('Paid at'))->default(date('Y-m-d H:i:s'));\n $form->text('payment_method', __('Payment method'));\n $form->text('payment_no', __('Payment no'));\n $form->text('refund_status', __('Refund status'))->default('pending');\n $form->text('refund_no', __('Refund no'));\n $form->switch('closed', __('Closed'));\n $form->switch('reviewed', __('Reviewed'));\n $form->text('ship_status', __('Ship status'))->default('pending');\n $form->textarea('ship_data', __('Ship data'));\n $form->textarea('extra', __('Extra'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Formulario());\n\n $form->text('name', 'Nombre')\n ->required()\n ->creationRules(['required', \"unique:formularios\"])\n ->updateRules(['required', \"unique:formularios,name,{{id}}\"]);\n $form->text('description', 'Descripción');\n\n $fields = Field::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('fields', 'Campos')->options($fields);\n\n $forms = Formulario::all()->pluck('name', 'id')->toArray();\n $form->select('go_to_formulario', 'Continuar a formulario')->options($forms);\n\n $form->divider('Quiénes tienen acceso a este Formulario?');\n\n $permissions = Permission::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('permissions', 'Permisos')->options($permissions);\n\n $roles = Role::all()->pluck('name', 'id')->toArray();\n $form->multipleSelect('roles', 'Roles')->options($roles);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User());\n\n $form->text('name', __('Name'));\n $form->email('email', __('Email'));\n $form->datetime('email_verified_at', __('Email verified at'))->default(date('Y-m-d H:i:s'));\n $form->password('password', __('Password'));\n $form->text('remember_token', __('Remember token'));\n $form->decimal('point', __('Point'))->default(0.000);\n $form->switch('status', __('field.status'));\n\n return $form;\n }", "protected function initializeForm()\n {\n $this->form = new Form();\n $this->form->add(Element::create(\"FieldSet\",\"Report Format\")->add\n (\n Element::create(\"SelectionList\", \"File Format\", \"report_format\")\n ->addOption(\"Hypertext Markup Language (HTML)\",\"html\")\n ->addOption(\"Portable Document Format (PDF)\",\"pdf\")\n ->addOption(\"Microsoft Excel (XLS)\",\"xls\")\n ->addOption(\"Microsoft Word (DOC)\",\"doc\")\n ->setRequired(true)\n ->setValue(\"pdf\"),\n Element::create(\"SelectionList\", \"Page Orientation\", \"page_orientation\")\n ->addOption(\"Landscape\", \"L\")\n ->addOption(\"Portrait\", \"P\")\n ->setValue(\"L\"),\n Element::create(\"SelectionList\", \"Paper Size\", \"paper_size\")\n ->addOption(\"A4\", \"A4\")\n ->addOption(\"A3\", \"A3\")\n ->setValue(\"A4\")\n )->setId(\"report_formats\")->addAttribute(\"style\",\"width:50%\")\n );\n $this->form->setSubmitValue(\"Generate\");\n $this->form->addAttribute(\"action\",Application::getLink($this->path.\"/generate\"));\n $this->form->addAttribute(\"target\",\"blank\");\n }", "protected function createForm()\n {\n if (!$this->form) {\n $this->form = new \\Gems_Form(array('class' => 'form-horizontal', 'role' => 'form'));\n $this->mailElements->setForm($this->form);\n }\n return $this->form;\n }", "public function create() {\r\n\t\r\n\t$form = new Form();\r\n\t$form->setTranslator($this->translator);\r\n\treturn $form;\r\n }", "public function create(): Form\n {\n $form = new Form();\n \n return $form;\n }", "protected function form()\n {\n $form = new Form(new Boarding()); \n \n $form->select('pet_id',__('Pet Name'))->options(Pet::all()->pluck('name','id'))->rules('required');\n $form->select('reservation_id',__('Reservation'))->options(Reservation::all()->pluck('date','id'))->rules('required');\n $form->select('cage_id',__('Available Cages'))->options(Cage::get()->where(\"availability\",\"Available\")->pluck('id','id'))->rules('required');\n $form->datetime('end_date', __('End date'))->default(date('Y-m-d H:i:s'))->rules('required');\n \n return $form; \n }", "protected function form()\n {\n $form = new Form(new Cate());\n\n $form->text('name', __('Name'));\n $form->url('link', __('Link'));\n $form->text('thumb', __('Thumb'));\n $form->switch('status', __('Status'));\n $form->number('sort', __('Sort'));\n $form->datetime('createtime', __('Createtime'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Task);\n\n $form->text('eid', 'Eid');\n $form->text('store', 'Store');\n $form->text('etype', 'Etype');\n $form->text('uid', 'Uid');\n $form->text('uname', 'Uname');\n $form->text('qq', 'Qq');\n $form->number('qtype', 'Qtype');\n $form->number('times', 'Times')->default(1);\n $form->textarea('content', 'Content');\n $form->text('deadline', 'Deadline');\n $form->file('file', 'File');\n $form->number('isok', 'Isok');\n $form->number('istag', 'Istag');\n $form->text('sid', 'Sid');\n $form->text('sname', 'Sname');\n $form->text('score', 'Score');\n\n return $form;\n }", "public function createFormField($fieldId, $request)\n {\n return $this->start()->uri(\"/api/form/field\")\n ->urlSegment($fieldId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }", "protected function form()\n {\n $form = new Form(new Activity());\n\n $form->text('log_name', __('Log name'));\n $form->text('description', __('Description'));\n $form->number('subject_id', __('Subject id'));\n $form->text('subject_type', __('Subject type'));\n $form->number('causer_id', __('Causer id'));\n $form->text('causer_type', __('Causer type'));\n $form->textarea('properties', __('Properties'));\n\n return $form;\n }", "private function createMyForm()\n {\n $form = $this->Form();\n\n $form->setElement(\n 'select',\n 'paypalPlusCountries',\n array(\n 'label' => 'Länder bei denen „PayPal PLUS“ angezeigt wird',\n 'value' => array(2),\n 'store' => 'base.Country',\n 'multiSelect' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'boolean',\n 'paypalHidePaymentSelection',\n array(\n 'label' => 'Zahlungsart-Auswahl im Bestellabschluss ausblenden (Shopware 4)',\n 'value' => true,\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'text',\n 'paypalPlusDescription',\n array(\n 'label' => 'Zahlungsart-Bezeichnung überschreiben',\n 'value' => 'PayPal, Lastschrift oder Kreditkarte',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n $form->setElement(\n 'text',\n 'paypalPlusAdditionalDescription',\n array(\n 'label' => 'Zahlungsart-Beschreibung ergänzen',\n 'value' => 'Zahlung per Lastschrift oder Kreditkarte ist auch ohne PayPal-Konto möglich.',\n 'scope' => \\Shopware\\Models\\Config\\Element::SCOPE_SHOP,\n )\n );\n }", "public function createComponentAddTaskForm() {\r\n $form = new UI\\Form;\r\n\r\n $form->getElementPrototype()->novalidate = 'novalidate';\r\n\r\n $form->addText('name', 'Task name:')\r\n ->setRequired('Please provide a task name.');\r\n\r\n $form->addTextArea('description', 'Description:');\r\n\r\n $form->addText('date', 'Deadline')->setOption('description', 'Use format: YYYY-MM-DD')\r\n ->addCondition(UI\\Form::FILLED)\r\n ->addRule(UI\\Form::PATTERN, 'Může být v rozmezí 2011-01-01 až 2019-12-31', '^(20)\\d\\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$');\r\n\r\n\r\n\r\n $form->addRadioList('priority', 'Priority', array(\r\n '1' => '1',\r\n '2' => '2',\r\n '3' => '3',\r\n ));\r\n\r\n $result = dibi::query('SELECT idcategory, name FROM `categories` WHERE iduser = %i', $this->getUser()->getId())->fetchPairs('idcategory', 'name');\r\n\r\n $form->addRadioList('category', 'Category', $result)\r\n ->setRequired('Please select category.')\r\n ->setDefaultValue($this->getParam('id'));\r\n\r\n $form->addSubmit('addtask', 'Add Task');\r\n\r\n $form->onSuccess[] = callback($this, 'AddTaskFormSubmitted');\r\n return $form;\r\n }", "protected function form()\n {\n $form = new Form(new Drug);\n\n $form->text('street_name', '«Уличное» название');\n $form->text('city', 'Город');\n $form->text('active_substance', 'Активное вещество');\n $form->text('symbol', 'Символ');\n $form->text('state', 'Состояние');\n $form->text('color', 'Цвет');\n $form->text('inscription', 'Надпись');\n $form->text('shape', 'Форма');\n $form->text('weight', 'Вес таблетки');\n $form->text('weight_active', 'Вес действующего вещества');\n $form->text('description', 'Описание');\n $form->text('negative_effect', 'Негативный эффект');\n $form->switch('confirm', 'Подтверждение');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Reservation());\n\n $form->select('user_id',__('Pet Owner'))->options(User::all()->pluck('name','id'))->rules('required');\n $form->select('pet_id',__('Pet Name'))->options(Pet::all()->pluck('name','id'))->rules('required');\n $form->select('service_id',__('Service'))->options(Service::all()->pluck('name','id'));\n $form->datetime('date', __('Date'))->default(date('Y-m-d H:i:s'))->rules('required|min:3');\n $form->select('status',__('Status'))->options([\n 'pending' => 'Pending',\n 'completed' => 'completed',\n 'canceled' => 'Canceled',\n ])->default('pending');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Terrace());\n\n $form->image('image', __('平台图片'))->rules('required', ['required' => '平台图片不能为空']);\n $form->text('name', __('平台名称'))->rules('required', ['required' => '平台名称不能为空']);\n $form->text('path', __('外链'))->rules('required', ['required' => '平台外链不能为空']);\n $form->text('notice_info', __('提示语'))->rules('required', ['required' => '平台提示语不能为空']);\n $form->radio('status','状态')->options(['1' => '未推荐', '2'=> '已推荐'])->default(1);\n\n return $form;\n }", "public function form_builder()\n {\n // ToDo run checks when form is being created, please.\n// if(!empty($this->check())):\n// throw new ValidationError(checks_html_output($this->check()));\n//\n// endif;\n\n return new form\\ModelForm($this, $this->_field_values());\n }", "protected function form()\n {\n $form = new Form(new Project());\n $form->text('name', '项目名称')->rules('required')->required();\n $form->url('url', '项目地址')->rules('required')->required();\n $form->text('username', '账号');\n $form->text('password', '密码');\n $status = [\n 'on' => ['value' => 1, 'text' => '启用', 'color' => 'success'],\n 'off' => ['value' => 2, 'text' => '禁用', 'color' => 'danger'],\n ];\n $form->switch('status', '状态')->states($status)->default(1);\n $form->tools(function (Form\\Tools $tools) {\n $tools->disableDelete();\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n $footer->disableReset();\n $footer->disableViewCheck();\n $footer->disableEditingCheck();\n $footer->disableCreatingCheck();\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Code());\n\n $form->mobile('phone', __('Phone'));\n $form->number('code', __('Code'));\n $form->ip('ip', __('IP'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new GuestBook);\n\n $form->textarea('body', __('Body'));\n $form->number('user_id', __('User id'));\n $form->number('guest_id', __('Guest id'));\n $form->number('guest_book_id', __('Guest book id'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Gys);\n\n $form->text('name', 'Name');\n $form->text('tel', 'Tel');\n $form->textarea('file', 'File');\n $form->number('type', 'Type');\n $form->text('username', 'Username');\n $form->password('password', 'Password');\n $form->number('status', 'Status');\n // 在表单提交前调用\n $form->saving(function (Form $form) {\n if ($form->password && $form->model()->password != $form->password) {\n $form->password = bcrypt($form->password);\n }\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Order);\n\n $form->text('currency', __('Currency'));\n $form->number('amount', __('Amount'));\n $form->number('state', __('State'));\n $form->number('game_id', __('Game id'));\n $form->number('user_id', __('User id'));\n $form->text('product_id', __('Product id'));\n $form->text('product_name', __('Product name'));\n $form->text('cp_order_id', __('Cp order id'));\n $form->text('callback_url', __('Callback url'));\n $form->text('callback_info', __('Callback info'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Engine());\n\n $form->text('name', __('Name'))\n ->required();\n $form->select('power_station_id', __('Power station'))\n ->options(PowerStation::all()->pluck('name', 'id'))\n ->required();\n $form->image('photo', __('Photo'));\n $form->textarea('details', __('Details'));\n\n return $form;\n }", "public function buildForm() {\n\t\techo \"<!DOCTYPE html>\n\t\t<html>\n\t\t<head>\n\t\t\t<title>$this->title</title>\n\t\t</head>\n\t\t<body>\n\t\t<form method=\\\"$this->method\\\">\";\n\t\tforeach ($this->_inputs as $key => $input) {\n\t\t\t// Check if email validation is required.\n\t\t\tif (isset($input['rule']) && in_array('email', $input['rule'])) {\n\t\t\t\t$input['inputType'] = 'email';\n\t\t\t}\n\n\t\t\techo \"<label>\".$input['label'].\"</label><input type=\\\"\".$input['inputType'].\"\\\" id=\\\"\".$input['name'].\"\\\" name=\\\"\".$input['name'].\"\\\" value=\\\"\".$input['defaultValue'].\"\\\"\";\n\n\t\t\t// Check if field was required.\n\t\t\tif (isset($input['rule']) && in_array('required', $input['rule'])) {\n\t\t\t\techo \" required\";\n\t\t\t}\n\n\t\t\techo \"><br></form>\";\n\t\t}\n\t}", "protected function makeFormCreator()\n {\n if ($this->isTestMode()) {\n return null;\n }\n\n if (empty($this->formConfiguration)) {\n throw new BadMethodCallException(\n 'Please define the form configuration to use via $this->setFormConfiguration().', 1333293139\n );\n }\n\n \\tx_rnbase::load(\\tx_mkforms_forms_Factory::class);\n $form = \\tx_mkforms_forms_Factory::createForm(null);\n\n /**\n * Configuration instance for plugin data. Necessary for LABEL translation.\n *\n * @var \\tx_rnbase_configurations $pluginConfiguration\n */\n $pluginConfiguration = \\tx_rnbase::makeInstance(tx_rnbase_configurations::class);\n $pluginConfiguration->init($this->conf, $this->cObj, 'mkforms', 'mkforms');\n\n // Initialize the form from TypoScript data and provide configuration for the plugin.\n $form->initFromTs(\n $this, $this->formConfiguration,\n ($this->getObjectUid() > 0) ? $this->getObjectUid() : false,\n $pluginConfiguration, 'form.'\n );\n\n return $form;\n }", "abstract public function generateFormField(FormMapper $formMapper);", "protected function createForm() \n {\n if ($this->form) {\n return $this->form;\n }\n $tm = $this->getContext()->getTranslationManager();\n $id = 0;\n $this->form = new Form_Form(\n array (\n 'method' => 'post',\n 'action' => $this->getContext()->getRouting()->gen('users.register'), //We should add action for ajax calls\n 'submit' => $tm->_('Register'),\n 'id' => $id++,\n 'renderer' => $this->getContainer()->getOutputType()->getRenderer()\n )\n );\n $username = new Form_Elements_TextField(\n array(\n 'name' => 'username',\n 'title' => $tm->_('User name'),\n 'required' => true,\n 'id' => $id++\n ), \n $this->form\n\t );\n $this->form->addChild($username);\n $email = new Form_Elements_TextField(\n array(\n 'name' => 'email',\n 'title' => $tm->_('Email address'),\n 'required' => true,\n 'email' => true,\n 'id' => $id++\n ), \n $this->form\n\t );\n $this->form->addChild($email);\n\n $password = new Form_Elements_PasswordField(\n array(\n 'name' => 'password',\n 'title' => $tm->_('Password'),\n 'required' => true,\n 'min' => 6,\n 'id' => $id++\n ), \n $this->form\n );\n $this->form->addChild($password);\n $confirm = new Form_Elements_PasswordField(\n array(\n 'name' => 'confirm',\n 'title' => $tm->_('Confirm'),\n 'required' => true,\n 'equal' => 'password', //Name of other field \n 'id' => $id++\n ), \n $this->form\n );\n\n $this->form->addChild($confirm);\n return $this->form;\n }", "protected function form()\n {\n $form = new Form(new Specialization);\n\n $form->text('full_name', 'Полное найменование')->rules('required|max:255');\n $form->text('short_name', 'Краткое найменование')->rules('required|max:255');\n $form->text('code', 'Код специальности')->rules('nullable|max:100');\n $form->select('cathedra_id', 'Кафедра')->options(Cathedra::all()->pluck('name', 'id'))\n ->rules('required|numeric|exists:cathedras,id');\n\n return $form;\n }", "public function getFormFieldBuilder(): FormFieldBuilder;", "protected function form()\n {\n $form = new Form(new WechatUser);\n\n $form->text('nick_name', __('昵称'));\n $form->text('name', __('用户名'));\n $form->password('password', __('密码'));\n $form->mobile('mobile', __('手机号'));\n $form->text('mini_program_open_id', __('OpenId'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new User);\n\n// $form->number('role_id', 'Role id');\n $form->text('name', 'Name');\n// $form->email('email', 'Email');\n// $form->image('avatar', 'Avatar')->default('users/default.png');\n// $form->password('password', 'Password');\n// $form->text('remember_token', 'Remember token');\n// $form->textarea('settings', 'Settings');\n $form->text('username', 'Username');\n// $form->text('access_token', 'Access token');\n// $form->text('no_hp', 'No hp');\n// $form->number('location_id', 'Location id');\n// $form->switch('gender', 'Gender')->default(1);\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new CompanyPortfolio);\n $form->text('title_ar', 'اسم العمل عربي')->rules('required');\n $form->text('title_en', 'اسم العمل انجليزي')->rules('required');\n $form->text('description_ar', 'وصف الشركة عربي')->rules('required');\n $form->text('description_en', 'وصف الشركة انجليزي')->rules('required');\n $form->select('company_id', 'الشركة')->options(Company::pluck('title_ar', 'id')->all())->rules('required');\n $form->multipleImage('images', 'الصور')->removable()->rules('required');\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Good);\n\n $form->hidden('group_id')->value(session('group_id'));\n $form->text('name', __('Наименование'));\n $form->text('size', __('Объем/кол-во'));\n $form->decimal('price', __('Цена'))->default(0);\n $form->image('file', 'Фото');\n\n\n return $form;\n }", "public function createForm($options = null)\n {\n if (\\MUtil_Bootstrap::enabled()) {\n $options['class'] = 'form-horizontal';\n $options['role'] = 'form';\n }\n return new \\Gems_Form($options);\n }", "public function xadmin_createform() {\n\t\t\n\t\t$args = $this->getAllArguments ();\n\t\t\n\t\t/* get the form field title */\n\t\t$form_title = $args [1];\n\t\t$form_type = @$args [2] ? $args [2] : 'blank';\n\t\t\n\t\t/* Load Model */\n\t\t$form = $this->getModel ( 'form' );\n\t\t$this->session->returnto ( 'forms' );\n\t\t\n\t\t/* create the form */\n\t\t$form->createNewForm ( $form_title, $form_type );\n\t\t\n\t\t$this->loadPluginModel ( 'forms' );\n\t\t$plug = Plugins_Forms::getInstance ();\n\t\t\n\t\t$plug->_pluginList [$form_type]->onAfterCreateForm ( $form );\n\t\t\n\t\t/* set the view file (optional) */\n\t\t$this->_redirect ( 'xforms' );\n\t\n\t}", "protected function form()\n {\n $form = new Form(new Order);\n\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Book());\n\n $form->select('author_id', __('Author id'))\n ->options(collect(Author::all())->mapWithKeys(function ($v){\n return [$v->id => $v->name];\n }));\n\n $form->text('title', __('Title'));\n $form->textarea('description', __('Description'));\n $form->text('year', __('Year'));\n\n return $form;\n }", "private function makeform() {\n\tglobal $qqi;\n\t\n\t$form=new llform($this,'form');\n\t$form->addFieldset('d','');\n\t$form->addControl('d',new ll_listbox($form,'users','Users'));\n\t$form->addControl('d',new ll_button($form,'allusers','Select All','button'));\n\t$form->addControl('d',new ll_listbox($form,'functions','Functions'));\n\t$form->addControl('d',new ll_button($form,'allfunctions','Select All','button'));\n\t$rg=new ll_radiogroup($form,'showby');\n\t\t$rg->addOption('byusers','Rows of Users');\n\t\t$rg->addOption('byfunctions','Rows of Functions');\n\t\t$rg->setValue('byfunctions');\n\t$form->addControl('d',$rg);\t\n\t$form->addControl('d',new ll_button($form,'update','Update Display','button'));\n\treturn $form;\n}", "protected function form()\n {\n $form = new Form(new Information);\n \n \n\n $form->text('name', __('项目名称'))->autofocus()->placeholder('例:上汽大众新能源汽车工厂项目')->required();\n $form->text('industry', __('行业类别'))->required();\n $form->currency('investment', __('投资金额'))->icon('fa-usd')->required(); \n $form->text('cont_name', __('资方联系人'))->placeholder('选填内容,可为空');\n $form->text('cont_phone', __('资方联系方式'))->placeholder('选填内容,可为空');\n $form->text('staff_name', __('工作人员姓名'));\n $form->text('staff_phone', __('工作人员电话'));\n $form->hidden('adminuser_id', __('adminuser_id'))->value(Admin::user()->id);\n $form->textarea('content', __('项目情况'))->required()->placeholder('请填写项目介绍(包括项目投资额度、产业类别等)、项目需求(如土地、排放、能耗等)、谈判进度等......');\n\n\n\n $form->tools(function (Form\\Tools $tools) {\n\n // 去掉`列表`按钮\n $tools->disableList();\n\n });\n\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n $footer->disableReset();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n\n $form->setAction('../admin/myinfo');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new LotteryCode());\n\n $form->text('code', __('Code'));\n $form->number('batch_num', __('Batch num'));\n $form->text('prizes_name', __('Prizes name'));\n $form->datetime('valid_period', __('Valid period'))->default(date('Y-m-d H:i:s'));\n $form->datetime('prizes_time', __('Prizes time'))->default(date('Y-m-d H:i:s'));\n $form->text('operator', __('Operator'));\n $form->switch('award_status', __('Award status'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Ticket);\n\n\n $form->text('ticket_article', 'Номер заявки')->default(mt_rand(100000, 999999))->placeholder(' ');\n $form->text('fio', 'ФІО')->placeholder(' ');\n $form->mobile('phone', 'Телефон')->options(['mask' => '+38(999) 999 99 99'])->placeholder(' ');\n $form->text('city', 'Місто')->placeholder(' ');\n $form->text('adress', 'Адреса')->placeholder(' ');\n $form->email('email', 'Email')->placeholder(' ');\n $form->select('type', 'Тип')->options([\n 'Ремонт' => 'Ремонт',\n 'Запчастини' => 'Запчастини',\n 'Дефект' => 'Дефект'\n ])->placeholder(' ');\n $form->text('brand', 'Бренд')->placeholder(' ');\n $form->text('model', 'Модель')->placeholder(' ');\n $form->text('serial_number', 'С/Н')->placeholder(' ');\n\n $form->date('date_sale', 'Дата продажу')->format('DD.MM.YYYY')->placeholder(' ');\n $form->textarea('description', 'Додатково')->placeholder(' ');\n $form->multipleFile('files', 'Файли')->placeholder(' ');\n $form->textarea('answer', 'Відповідь клієнту')->placeholder(' ');\n $form->select('status', 'Статус')->options([\n 'Відкрита' => 'Відкрита',\n 'В обробці' => 'В обробці',\n 'Закрита' => 'Закрита'\n ])->placeholder(' ');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Procurement);\n\n $form->number('u_id', 'U id');\n $form->number('brand', 'Brand');\n $form->number('type', 'Type');\n $form->number('models', 'Models');\n $form->number('material', 'Material');\n $form->decimal('area', 'Area');\n $form->radio('status', '审核')->options(['0' => '待审核', '1'=> '通过','2'=>'未通过'])->default('0');\n $form->number('room_city', 'Room city');\n $form->text('address', 'Address');\n $form->number('brick_time', 'Brick time')->default(1);\n $form->text('images', 'Images');\n $form->number('ctime', 'Ctime');\n $form->number('utime', 'Utime');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BackPeopleInfo());\n\n $form->text('name', __('姓名'));\n $form->text('id_num', __('身份证号码'));\n $form->mobile('phone', __('手机号码'));\n $form->text('address', __('楼栋房号'));\n $form->text('originatin', __('始发地'));\n $form->date('back_date', __('返回日期'))->default(date('Y-m-d'));\n $form->date('isolate_date', __('隔离日期'))->default(date('Y-m-d'));\n $form->text('isolate_flag', __('解除隔离'))->default('否');\n $form->text('isolate_level', __('隔离等级'))->default('普通');\n $form->text('qrcode_flag', __('网格化管理'))->default('否');\n $form->text('vehicle_info', __('交通工具'));\n $form->text('remarks', __('备注'));\n\n return $form;\n }", "public function buildForm()\n {\n }", "protected function form()\n {\n $form = new Form(new Cases);\n\n $form->select('cate_id', '分类')->options('/admin/api/getcasecate');\n $form->select('algw_id', '顾问')->options('/admin/api/getgw');\n $form->text('title', '标题');\n $form->text('keywords', 'SEO关键字');\n $form->text('description', 'SEO描述');\n $form->text('desc', '副标题');\n $form->text('author', '来源');\n $form->radio('is_tj', '推荐')->options([0=>'否',1=>'是']);\n $form->image('thumb', '缩略图')->uniqueName();\n $form->editor('data', '详情');\n\n\n return $form;\n }", "private function getCreateForm()\n\t{\n\t\t$form = new Zend_Form();\n\t\t$form->setAttrib('id', 'formCommentCreate');\n\n\t\t$comment_type = new Zend_Form_Element_Select('comment_type');\n\t\t$comment_type->setRequired(true)\n\t\t->setMultiOptions(\n\t\tarray(\tApplication_Model_Enum_CommentType::THUMBS_UP => 'Thumbs up',\n\t\t\t\t\tApplication_Model_Enum_CommentType::THUMBS_DOWN => 'Thumbs down'));\n\t\t$form->addElement($comment_type);\n\n\t\t$comment = new Zend_Form_Element_Textarea('comment');\n\t\t$comment->setRequired(true)\n\t\t->addValidator('stringLength', false, 50);\n\t\t$form->addElement($comment);\n\n\t\treturn $form;\n\t}", "protected function form()\n {\n $form = new Form(new BorrowComment);\n\n $form->text('shared_book_name', __('Shared book name'));\n $form->text('student_name', __('Student name'));\n $form->image('student_avatar', __('Student avatar'));\n $form->textarea('content', __('Content'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Direction());\n\n $form->text('name', __(trans('hhx.name')));\n $form->text('intro', __(trans('hhx.intro')));\n $form->image('Img', __(trans('hhx.img')))->move('daily/direction')->uniqueName();\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.status'));;\n $form->number('order_num', __(trans('hhx.order_num')));\n $form->hidden('all_num', __(trans('hhx.all_num')))->default(0.00);\n $form->decimal('stock', __(trans('hhx.stock')));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new rechargeOnline());\n\n $form->text('accountName', ___('AccountName'));\n $form->text('orderNo', ___('OrderNo'));\n $form->text('rechargeAmount', ___('RechargeAmount'));\n $form->text('rechargeWay', ___('RechargeWay'));\n $form->datetime('rechargeTime', ___('RechargeTime'));\n $form->text('rechargeSource', ___('RechargeSource'));\n $form->text('rechargeStatus', ___('RechargeStatus'));\n $form->text('nickName', ___('NickName'));\n $form->text('rechargeSubsidy', ___('RechargeSubsidy'));\n $form->text('payWay', ___('PayWay'));\n $form->text('orderStatus', ___('OrderStatus'));\n $form->text('orderDesc', ___('OrderDesc'));\n $form->datetime('orderTime', ___('OrderTime'))->default(date('Y-m-d H:i:s'));\n $form->datetime('orderCompleteTime', ___('OrderCompleteTime'))->default(date('Y-m-d H:i:s'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Goodss);\n $form->switch('is_enable','状态')->options([\n 'on' => ['value' => 1, 'text' => '正常', 'color' => 'primary'],\n 'off' => ['value' => 0, 'text' => '禁止', 'color' => 'default'],\n ]);\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n $form->footer(function ($footer) {\n\n // 去掉`重置`按钮\n //$footer->disableReset();\n\n // 去掉`提交`按钮\n //$footer->disableSubmit();\n\n // 去掉`查看`checkbox\n $footer->disableViewCheck();\n\n // 去掉`继续编辑`checkbox\n $footer->disableEditingCheck();\n\n // 去掉`继续创建`checkbox\n $footer->disableCreatingCheck();\n\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new News);\n\n $form->text('title', '题目');\n // $form->number('category_id', '分类');\n $form->select('category_id','分类')->options('/api/admin_categories');\n // $form->textarea('content', 'Content');\n $form->ueditor('content','新闻内容')->rules('required');\n // $form->text('thumbnail', '封面图');\n $form->image('thumbnail', '封面图')->move('public/uploads/thunbnails');\n $form->number('status', '状态');\n $form->number('read_count', '阅读次数');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new BoxOrder);\n\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new FinancialPrizeModel);\n\n $form->display('id', 'ID');\n $form->select('user_id', '用户名')->options(UserModel::getAllUsersPluck())->rules('required');\n $form->select('type', '类型')->options(FinancialPrizeModel::getCommonPluck())->rules('required');\n $form->month('date', '所属月份')->format('YYYY-MM')->rules('required');\n $form->number('money', '金额');\n $form->text('mark', '简要说明')->help('奖项具体名称等,最多输入100字');\n $form->hidden('year', 'year');\n\n $form->tools(function (Form\\Tools $tools) {\n // 去掉`删除`按钮\n $tools->disableDelete();\n // 去掉`查看`按钮\n $tools->disableView();\n });\n\n $form->saving(function (Form $f) {\n $f->year = substr($f->date, 0, 4);\n $f->date = $f->date . '-01';\n });\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new WithdrawDepositOrder);\n\n $form->number('apply_amount', __('Apply amount'));\n $form->number('transfer_amount', __('Transfer amount'));\n $form->number('master_id', __('Master id'));\n $form->switch('status', __('Status'));\n $form->textarea('comment', __('Comment'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Student);\n\n $form->text('surname', 'Фамилия')->rules('required|max:50');\n $form->text('name', 'Имя')->rules('required|max:50');\n $form->text('family_name', 'Отчество')->rules('required|max:255');\n $form->text('telegram_id', 'Telegram-id')->rules('nullable');\n $form->email('email', 'Email');\n $form->text('number', 'Контактный телефон')->rules('max:100');;\n $form->select('groups_id', 'Ид группы')->options(Group::all()->pluck('name', 'id'))\n ->rules('required');\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new City());\n $form->disableViewCheck();\n $form->disableEditingCheck();\n $form->disableCreatingCheck();\n\n $form->text('name', __('field.name'));\n $form->text('slug', __('field.slug'));\n $form->text('description', __('field.description'));\n $form->number('sort', __('field.sort'))->default(0);\n $form->hasMany('files', __('field.images'), function (Form\\NestedForm $form) {\n $form->image('file', __('field.image'))\n ->options(['showClose'=>false])\n ->options(['fileActionSettings'=>['showRemove'=>true]])\n ->options(['otherActionButtons'=>ImageHelper::previewRotateButtons()])\n ->uniqueName();\n $form->number('sort', __('field.sort'))->default(0);\n });\n $form->saving(function (Form $form) {\n if ($form->slug === null) {\n $form->slug = Str::slug($form->option);\n }\n });\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Feedback);\n\n $form->select('user_id', __('feedback::feedback.user_id'))\n ->options(function ($id) {\n $user = User::find($id);\n if ($user) {\n return [$user->id => $user->username];\n }\n })\n ->ajax(route('admin.select.user'))\n ->required();\n $form->text('title', __('feedback::feedback.title'))->readonly();\n $form->UEditor('content', __('feedback::feedback.content'));\n $form->text('contact', __('feedback::feedback.contact'))->readonly();\n $form->image('file', __('feedback::feedback.file'))->readonly();\n $form->UEditor('reply', __('feedback::feedback.reply'));\n $form->select('status', __('feedback::feedback.status.label'))\n ->options(__('feedback::feedback.status.value'));\n\n return $form;\n }", "public function createAddForm()\n {\n $this->song = new Song();\n $form = new Form();\n $this->addCommonFields($form);\n $form->onValidate[] = $this->songFormValidate;\n $form->onSuccess[] = $this->songFormSuccess;\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Enseignant());\n\n $form->text('matricule', __('Matricule'));\n $form->text('nom', __('Nom'));\n $form->text('postnom', __('Postnom'));\n $form->text('prenom', __('Prenom'));\n $form->text('sexe', __('Sexe'));\n $form->text('grade', __('Grade'));\n $form->text('fonction', __('Fonction'));\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new Good);\n $form->text('name', __('名称'))->rules('required');\n $form->decimal('amount', __('价格'))->default(0.00)->rules('required');\n $form->text('unit', __('单位'))->rules('required');\n $form->image('list_img', __('缩略图(320*320)'))->creationRules('required');\n $form->hasMany('goodsimgs', __('轮播图(640*640)'),function(Form\\NestedForm $form){\n $form->image('img',__('轮播图'))->creationRules('required');\n });\n $form->kindeditor('describe', __('描述'));\n // 去掉`查看`checkbox\n $form->disableViewCheck();\n // 去掉`继续编辑`checkbox\n $form->disableEditingCheck();\n // 去掉`继续创建`checkbox\n $form->disableCreatingCheck();\n return $form;\n }", "protected function form()\n {\n $form = new Form(new HhxEquip());\n\n $form->text('name', __(trans('hhx.name')));\n $form->select('hhx_travel_id', __(trans('hhx.hhx_travel_id')))->options(self::getTravelService()->getThereTravel());\n $form->select('status', __(trans('hhx.status')))->options(config('hhx.equip_status'))->default(0);\n\n return $form;\n }", "protected function form()\n {\n $form = new Form(new NewEnergy());\n\n $form->number('user_id', __('User id'));\n $form->text('car_id', __('车辆ID'));\n $form->image('start_mileage', __('开始'));\n $form->image('end_mileage', __('介绍'));\n $form->decimal('mileage', __('里程 / 时间'));\n $form->select('type', __('类型'))->options([\n \"1\" => \"电动车\",\n \"2\" => \"燃油车\",\n ]);\n $form->select('status', __('状态'))->options([\n \"1\" => \"审核中\",\n \"10\" => \"审核拒绝\",\n \"20\" => \"审核撤销\",\n \"30\" => \"审核通过\"\n ]);\n $form->text('remark', __('Remark'));\n\n return $form;\n }", "public abstract function createFields();", "protected function form()\n {\n $form = new Form(new TaskOrder);\n\n $form->display('ID');\n $form->text('eid',\"快递单号\");\n $form->text('sname','客服名称');\n $form->select('store','快递网点')->options(storedatas(1));\n $form->select('etype','快递公司')->options(edatas());\n $form->display('Created at');\n $form->display('Updated at');\n\n return $form;\n }", "abstract function builder_form(): string;" ]
[ "0.7197657", "0.71927226", "0.71927226", "0.7121654", "0.7121654", "0.6883486", "0.6753936", "0.67229515", "0.66542315", "0.6616685", "0.6465313", "0.64645696", "0.64194053", "0.64187574", "0.63703305", "0.63674444", "0.6357836", "0.63466984", "0.6311902", "0.6310263", "0.6288638", "0.62596416", "0.6248976", "0.6243032", "0.62170994", "0.6210732", "0.6194092", "0.619135", "0.61881816", "0.6181341", "0.6181144", "0.617426", "0.61712795", "0.61694765", "0.6168842", "0.6165117", "0.6160575", "0.6159476", "0.6158483", "0.6155778", "0.61372405", "0.6133049", "0.6126112", "0.6125724", "0.6124207", "0.61214346", "0.6117894", "0.6117646", "0.6113275", "0.6111973", "0.611007", "0.6104508", "0.60977024", "0.60937566", "0.6082107", "0.60679525", "0.604514", "0.6041982", "0.6041514", "0.6036391", "0.6028473", "0.6028307", "0.6021256", "0.6019367", "0.6013619", "0.60127354", "0.6008917", "0.6004959", "0.598605", "0.5984722", "0.5982538", "0.5982266", "0.59793276", "0.59730875", "0.59608114", "0.5957185", "0.59499097", "0.5949621", "0.59481066", "0.59414", "0.59397", "0.593121", "0.59202516", "0.59154266", "0.5912321", "0.5909332", "0.590624", "0.5904008", "0.58965474", "0.58946526", "0.58923084", "0.5889932", "0.58897644", "0.58873713", "0.58823925", "0.5879494", "0.5878767", "0.58679503", "0.5865194", "0.586507" ]
0.720951
0
Get an associative array of field name to message type from a ValidationResult.
protected function getFlatValidationResult(ValidationResult $result) { $flatResults = array(); foreach ($result->getMessages() as $key => $metadata) { $flatResults[$metadata['fieldName']] = $metadata['messageType']; } return $flatResults; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function validationErrors() {\n\t\t$return = array();\n\n\t\t$models = ClassRegistry::keys();\n\t\tforeach ($models as $currentModel) {\n\t\t\t$currentObject = ClassRegistry::getObject($currentModel);\n\t\t\tif ($currentObject instanceof Model) {\n\t\t\t\t$return[$currentObject->alias] = $currentObject->validationErrors;\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}", "public function getValidationErrors()\n {\n $fields = $this->getFields();\n if (!$fields) {\n return [];\n }\n\n $result = [];\n foreach ($fields as $field) {\n if ($field instanceof AbstractFormField) {\n if (!$field->isValid()) {\n $result = array_merge($result, $field->getErrorMessages());\n }\n }\n }\n\n return $result;\n }", "public function getValidatedFields()\n {\n $retVal = array();\n $errors = $this->validateFields();\n foreach($this->_fields as $field)\n {\n $retVal[$field['id']] = $field['validatedData'];\n }\n return array( $retVal, $errors );\n }", "public function getValidationMessages();", "public function _getValidationErrors(): array\n\t{\n\t\t$errs = parent::_getValidationErrors();\n\t\t$validationRules = $this->_getValidationRules();\n\t\tif (null !== ($v = $this->getUrl())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_URL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getIdentifier())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getName())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_NAME] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDisplay())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DISPLAY] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getStatus())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_STATUS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getExperimental())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getPublisher())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_PUBLISHER] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContact())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTACT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDate())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DATE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDescription())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DESCRIPTION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getUseContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_USE_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getRequirements())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getCopyright())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_COPYRIGHT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getCode())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CODE, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getFhirVersion())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getMapping())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_MAPPING, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getKind())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_KIND] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getConstrainedType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getAbstract())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_ABSTRACT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getContextType())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif ([] !== ($vs = $this->getContext())) {\n\t\t\tforeach ($vs as $i => $v) {\n\t\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t\t$errs[sprintf('%s.%d', self::FIELD_CONTEXT, $i)] = $fieldErrs;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getBase())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_BASE] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getSnapshot())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_SNAPSHOT] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (null !== ($v = $this->getDifferential())) {\n\t\t\tif ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = $fieldErrs;\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_URL])) {\n\t\t\t$v = $this->getUrl();\n\t\t\tforeach ($validationRules[self::FIELD_URL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_URL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_URL])) {\n\t\t\t\t\t\t$errs[self::FIELD_URL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_URL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IDENTIFIER])) {\n\t\t\t$v = $this->getIdentifier();\n\t\t\tforeach ($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_IDENTIFIER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IDENTIFIER])) {\n\t\t\t\t\t\t$errs[self::FIELD_IDENTIFIER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IDENTIFIER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_VERSION])) {\n\t\t\t$v = $this->getVersion();\n\t\t\tforeach ($validationRules[self::FIELD_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_NAME])) {\n\t\t\t$v = $this->getName();\n\t\t\tforeach ($validationRules[self::FIELD_NAME] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_NAME,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_NAME])) {\n\t\t\t\t\t\t$errs[self::FIELD_NAME] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_NAME][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DISPLAY])) {\n\t\t\t$v = $this->getDisplay();\n\t\t\tforeach ($validationRules[self::FIELD_DISPLAY] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DISPLAY,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DISPLAY])) {\n\t\t\t\t\t\t$errs[self::FIELD_DISPLAY] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DISPLAY][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_STATUS])) {\n\t\t\t$v = $this->getStatus();\n\t\t\tforeach ($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_STATUS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_STATUS])) {\n\t\t\t\t\t\t$errs[self::FIELD_STATUS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_STATUS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXPERIMENTAL])) {\n\t\t\t$v = $this->getExperimental();\n\t\t\tforeach ($validationRules[self::FIELD_EXPERIMENTAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_EXPERIMENTAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXPERIMENTAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXPERIMENTAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_PUBLISHER])) {\n\t\t\t$v = $this->getPublisher();\n\t\t\tforeach ($validationRules[self::FIELD_PUBLISHER] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_PUBLISHER,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_PUBLISHER])) {\n\t\t\t\t\t\t$errs[self::FIELD_PUBLISHER] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_PUBLISHER][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTACT])) {\n\t\t\t$v = $this->getContact();\n\t\t\tforeach ($validationRules[self::FIELD_CONTACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DATE])) {\n\t\t\t$v = $this->getDate();\n\t\t\tforeach ($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DATE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DATE])) {\n\t\t\t\t\t\t$errs[self::FIELD_DATE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DATE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DESCRIPTION])) {\n\t\t\t$v = $this->getDescription();\n\t\t\tforeach ($validationRules[self::FIELD_DESCRIPTION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DESCRIPTION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DESCRIPTION])) {\n\t\t\t\t\t\t$errs[self::FIELD_DESCRIPTION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DESCRIPTION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_USE_CONTEXT])) {\n\t\t\t$v = $this->getUseContext();\n\t\t\tforeach ($validationRules[self::FIELD_USE_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_USE_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_USE_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_USE_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_REQUIREMENTS])) {\n\t\t\t$v = $this->getRequirements();\n\t\t\tforeach ($validationRules[self::FIELD_REQUIREMENTS] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_REQUIREMENTS,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_REQUIREMENTS])) {\n\t\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_REQUIREMENTS][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_COPYRIGHT])) {\n\t\t\t$v = $this->getCopyright();\n\t\t\tforeach ($validationRules[self::FIELD_COPYRIGHT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_COPYRIGHT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_COPYRIGHT])) {\n\t\t\t\t\t\t$errs[self::FIELD_COPYRIGHT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_COPYRIGHT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CODE])) {\n\t\t\t$v = $this->getCode();\n\t\t\tforeach ($validationRules[self::FIELD_CODE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CODE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CODE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CODE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CODE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_FHIR_VERSION])) {\n\t\t\t$v = $this->getFhirVersion();\n\t\t\tforeach ($validationRules[self::FIELD_FHIR_VERSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_FHIR_VERSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_FHIR_VERSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_FHIR_VERSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MAPPING])) {\n\t\t\t$v = $this->getMapping();\n\t\t\tforeach ($validationRules[self::FIELD_MAPPING] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_MAPPING,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MAPPING])) {\n\t\t\t\t\t\t$errs[self::FIELD_MAPPING] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MAPPING][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_KIND])) {\n\t\t\t$v = $this->getKind();\n\t\t\tforeach ($validationRules[self::FIELD_KIND] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_KIND,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_KIND])) {\n\t\t\t\t\t\t$errs[self::FIELD_KIND] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_KIND][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t$v = $this->getConstrainedType();\n\t\t\tforeach ($validationRules[self::FIELD_CONSTRAINED_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONSTRAINED_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONSTRAINED_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONSTRAINED_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ABSTRACT])) {\n\t\t\t$v = $this->getAbstract();\n\t\t\tforeach ($validationRules[self::FIELD_ABSTRACT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_ABSTRACT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ABSTRACT])) {\n\t\t\t\t\t\t$errs[self::FIELD_ABSTRACT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ABSTRACT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t$v = $this->getContextType();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT_TYPE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT_TYPE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT_TYPE])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT_TYPE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTEXT])) {\n\t\t\t$v = $this->getContext();\n\t\t\tforeach ($validationRules[self::FIELD_CONTEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_CONTEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_BASE])) {\n\t\t\t$v = $this->getBase();\n\t\t\tforeach ($validationRules[self::FIELD_BASE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_BASE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_BASE])) {\n\t\t\t\t\t\t$errs[self::FIELD_BASE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_BASE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_SNAPSHOT])) {\n\t\t\t$v = $this->getSnapshot();\n\t\t\tforeach ($validationRules[self::FIELD_SNAPSHOT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_SNAPSHOT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_SNAPSHOT])) {\n\t\t\t\t\t\t$errs[self::FIELD_SNAPSHOT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_SNAPSHOT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_DIFFERENTIAL])) {\n\t\t\t$v = $this->getDifferential();\n\t\t\tforeach ($validationRules[self::FIELD_DIFFERENTIAL] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_STRUCTURE_DEFINITION,\n\t\t\t\t\tself::FIELD_DIFFERENTIAL,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_DIFFERENTIAL])) {\n\t\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_DIFFERENTIAL][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_TEXT])) {\n\t\t\t$v = $this->getText();\n\t\t\tforeach ($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_TEXT,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_TEXT])) {\n\t\t\t\t\t\t$errs[self::FIELD_TEXT] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_TEXT][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_CONTAINED])) {\n\t\t\t$v = $this->getContained();\n\t\t\tforeach ($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_CONTAINED,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_CONTAINED])) {\n\t\t\t\t\t\t$errs[self::FIELD_CONTAINED] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_CONTAINED][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_EXTENSION])) {\n\t\t\t$v = $this->getExtension();\n\t\t\tforeach ($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t$v = $this->getModifierExtension();\n\t\t\tforeach ($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE,\n\t\t\t\t\tself::FIELD_MODIFIER_EXTENSION,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n\t\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_ID])) {\n\t\t\t$v = $this->getId();\n\t\t\tforeach ($validationRules[self::FIELD_ID] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_ID,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_ID])) {\n\t\t\t\t\t\t$errs[self::FIELD_ID] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_ID][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_META])) {\n\t\t\t$v = $this->getMeta();\n\t\t\tforeach ($validationRules[self::FIELD_META] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_META,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_META])) {\n\t\t\t\t\t\t$errs[self::FIELD_META] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_META][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t$v = $this->getImplicitRules();\n\t\t\tforeach ($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_IMPLICIT_RULES,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n\t\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (isset($validationRules[self::FIELD_LANGUAGE])) {\n\t\t\t$v = $this->getLanguage();\n\t\t\tforeach ($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n\t\t\t\t$err = $this->_performValidation(\n\t\t\t\t\tPHPFHIRConstants::TYPE_NAME_RESOURCE,\n\t\t\t\t\tself::FIELD_LANGUAGE,\n\t\t\t\t\t$rule,\n\t\t\t\t\t$constraint,\n\t\t\t\t\t$v,\n\t\t\t\t);\n\t\t\t\tif (null !== $err) {\n\t\t\t\t\tif (!isset($errs[self::FIELD_LANGUAGE])) {\n\t\t\t\t\t\t$errs[self::FIELD_LANGUAGE] = [];\n\t\t\t\t\t}\n\t\t\t\t\t$errs[self::FIELD_LANGUAGE][$rule] = $err;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $errs;\n\t}", "public function getValidatorMessages()\n {\n $messages = [];\n \n foreach ($this->owner->getValidatorRules() as $rule) {\n \n if ($rule->hasMessage()) {\n $messages[$rule->getType()] = $rule->getMessage();\n }\n \n }\n \n return $messages;\n }", "function getMessages() {\n\t\t$fields = $this->getFields();\n\t\t$allMessages = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldMessages = $field->getValidationMessages();\n\t\t\tif ($fieldMessages) {\n\t\t\t\t$allMessages[$field->getName()] = $fieldMessages;\n\t\t\t}\n\n\t\t}\n\n\t\treturn $allMessages;\n\t}", "public function getErrors(): array\n {\n return $this->getInputFilter()->getMessages();\n }", "public function getValidationErrorMessages() {}", "public function getValidationErrors() {\n if (true == ($this->validation instanceof Validation)) {\n return $this->validation->getErrors();\n }\n\n return array();\n }", "public function errors() {\n $Errors = array();\n foreach ($this->__fields() as $field) {\n $E = $this->$field->errorsList();\n if ($E) $Errors[$field] = $E;\n }\n return $Errors;\n }", "public function fieldNameArray($result = false){\n $names = array();\n\n $field = $this->numFields($result);\n\n for ( $i = 0; $i < $field; $i++ ){\n $names[] = $this->fieldName($result, $i);\n }\n\n return $names;\n }", "public function messages()\n {\n $key = $this->csvHeader();\n\n return [\n sprintf('%s.required', $key) => trans('validation.required', ['attribute' => trans('element.activity_status')]),\n sprintf('%s.size', $key) => trans('validation.multiple_values', ['attribute' => trans('element.activity_status')]),\n sprintf('%s.in', $key) => trans('validation.code_list', ['attribute' => trans('element.activity_status')])\n ];\n }", "public function getMessages()\n {\n foreach (parent::getMessages() as $message) {\n switch ($message->getType()) {\n case 'PresenceOf':\n $message->setMessage('The field ' . $message->getField() . ' is required');\n break;\n case 'Uniqueness':\n $message->setMessage('The field ' . $message->getField() . ' must be unique');\n break;\n case 'Email':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid email');\n break;\n case 'Url':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid url');\n break;\n case 'InclusionIn':\n $message->setMessage('The field ' . $message->getField() . ' must contain a value in [' . implode(',', $message->getDomain()) . ']');\n break;\n case 'DateValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid date.');\n break;\n case 'TimestampValidator':\n $message->setMessage('The field ' . $message->getField() . ' must contain a valid timestamps.');\n break;\n }\n }\n\n return parent::getMessages();\n }", "public function getErrorsAsArray() {\n return $this->validation_errors;\n }", "public function getErrorMessages()\n {\n $errors = [];\n foreach ($this->fields as $field) {\n if ($field instanceof AbstractFormField && !$field->isValid()) {\n $fldErrors = $field->getErrorMessages();\n $errors = array_merge($errors, $fldErrors);\n }\n }\n\n return $errors;\n }", "public function getValidationErrors();", "public function getValidationErrors();", "public function _getValidationErrors(): array\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getYear())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_YEAR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getMonth())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MONTH] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDay())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DAY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSeason())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SEASON] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATE])) {\n $v = $this->getDate();\n foreach($validationRules[self::FIELD_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE])) {\n $errs[self::FIELD_DATE] = [];\n }\n $errs[self::FIELD_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_YEAR])) {\n $v = $this->getYear();\n foreach($validationRules[self::FIELD_YEAR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_YEAR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_YEAR])) {\n $errs[self::FIELD_YEAR] = [];\n }\n $errs[self::FIELD_YEAR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MONTH])) {\n $v = $this->getMonth();\n foreach($validationRules[self::FIELD_MONTH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_MONTH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MONTH])) {\n $errs[self::FIELD_MONTH] = [];\n }\n $errs[self::FIELD_MONTH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DAY])) {\n $v = $this->getDay();\n foreach($validationRules[self::FIELD_DAY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_DAY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DAY])) {\n $errs[self::FIELD_DAY] = [];\n }\n $errs[self::FIELD_DAY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SEASON])) {\n $v = $this->getSeason();\n foreach($validationRules[self::FIELD_SEASON] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_SEASON, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SEASON])) {\n $errs[self::FIELD_SEASON] = [];\n }\n $errs[self::FIELD_SEASON][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CITATION_DOT_DATE_OF_PUBLICATION, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_BACKBONE_ELEMENT, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "private function getErrorMessages(): array\n {\n return [\n 'notEmpty' => 'Campo {{name}} obligatorio',\n 'date' => '{{name}} debe tener una fecha valida. Ejemplo de formato: {{format}}\\'',\n 'intVal' => '',\n 'between' => '',\n 'in' => '',\n 'floatVal' => '',\n 'length' => '',\n 'stringType' => '',\n 'objectType' => '',\n 'cantidadRegistros' => 'dsfsdfsd',\n 'periodo.notEmpty' => 'Campo Periodo: es obligatorio',\n 'periodo' => 'Campo Periodo: Debe tener el formato AAAAMM, donde AAAA indica el año y MM el mes en números',\n 'orden.notEmpty' => 'Campo Orden: es obligatorio',\n 'orden' => 'Campo Orden: Debe ser igual a 1 ó 2.',\n 'codigoComprobante.notEmpty' => 'Campo Codigo de Comprobante: es obligatorio',\n 'codigoComprobante' => 'Campo Codigo de Comprobante: Debe debe estar comprendido entre 1 y 9998.',\n 'numeroComprobante.notEmpty' => 'Campo Numero de Comprobante: es obligatorio',\n 'numeroComprobante' => 'Campo Numero de Comprobante: Debe debe estar comprendido entre 1 y 99999999.',\n 'puntoVenta.notEmpty' => 'Punto de venta: es obligatorio',\n 'puntoVenta' => 'Punto de venta: Debe debe estar comprendido entre 1 y 9998.',\n ];\n }", "public function errorMessages() : array\n {\n return [\n self::RULE_REQUIRED => 'Required.',\n self::RULE_EMAIL => 'Must be a valid email address.',\n self::RULE_MIN => 'Must be at least {min} characters.',\n self::RULE_MAX => 'Must be less than {max} characters.',\n self::RULE_MATCH => 'Must match {match}.',\n self::RULE_UNIQUE => '{column} is already in use.'\n ];\n }", "protected function structureValidationErrorMessages($validation_result)\n {\n\n }", "public function getErrors(): array {\n return $this->validationError;\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "protected function validationErrorMessages()\n {\n return [];\n }", "public function messages()\n {\n $items = [];\n foreach (static::attributes() as $key => $val) {\n $items[$key . '.required'] = t('common.form.errors.required', [\n 'attribute' => $val,\n ]);\n }\n \n return $items;\n }", "public function messages(): array\n {\n return [\n 'required' => 'O campo :attribute é obrigatório.',\n 'integer' => 'O campo :attribute não é um número válido.',\n ];\n }", "public function fieldValidationArray()\n {\n return [\n 'name' => 'required|codename|min:2|max:255',\n 'label' => 'string',\n 'description' => 'string',\n 'required' => 'boolean',\n 'mode' => 'string|in:prefer_local,prefer_external,only_local,only_external',\n 'script' => 'string'\n ];\n }", "public function getErrors() {\n /** @var Table $this */\n $errors = $this->entity->getErrors();\n\n $getThis = function ($association, $path, &$current, &$previous) {\n $key = array_pop($path);\n\n foreach ($current as $k => $v) {\n\n if ($association == 'embedded') {\n\n if (is_scalar($v)) {\n return;\n }\n $k = \"$key.$k\";\n }\n $previous[$k] = $v;\n }\n unset($previous[$key]);\n };\n\n $this->walkWithAssociated($errors, $getThis);\n $result = [];\n\n foreach ($errors as $field => $error) {\n $alias = $this->getAliasByField($field);\n\n foreach ($error as $key => $value) {\n // hasMany\n if (is_numeric($key)) {\n $result[$alias . \"[$key].\" . key($value)] = array_values(array_values($value)[0])[0];\n }\n else {\n $result[$alias] = $value;\n break;\n }\n }\n }\n\n return $result;\n }", "public function getErrorMessages()\n {\n $translator = Mage::helper('importexport');\n $messages = array();\n\n foreach ($this->_errors as $errorCode => $errorRows) {\n if (isset($this->_messageTemplates[$errorCode])) {\n $errorCode = $translator->__($this->_messageTemplates[$errorCode]);\n }\n foreach ($errorRows as $errorRowData) {\n $key = $errorRowData[1] ? sprintf($errorCode, $errorRowData[1]) : $errorCode;\n $messages[$key][] = $errorRowData[0];\n }\n }\n return $messages;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getDataRequirement())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DATA_REQUIREMENT, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEncounter())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENCOUNTER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getEvaluationMessage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EVALUATION_MESSAGE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getModuleCanonical())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CANONICAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleCodeableConcept())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getModuleUri())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_MODULE_URI] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getNote())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_NOTE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOccurrenceDateTime())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOutputParameters())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPerformer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERFORMER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getReasonCode())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_CODE, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getReasonReference())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_REASON_REFERENCE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getRequestIdentifier())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getResult())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESULT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_DATA_REQUIREMENT])) {\n $v = $this->getDataRequirement();\n foreach($validationRules[self::FIELD_DATA_REQUIREMENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_DATA_REQUIREMENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_REQUIREMENT])) {\n $errs[self::FIELD_DATA_REQUIREMENT] = [];\n }\n $errs[self::FIELD_DATA_REQUIREMENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENCOUNTER])) {\n $v = $this->getEncounter();\n foreach($validationRules[self::FIELD_ENCOUNTER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_ENCOUNTER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENCOUNTER])) {\n $errs[self::FIELD_ENCOUNTER] = [];\n }\n $errs[self::FIELD_ENCOUNTER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EVALUATION_MESSAGE])) {\n $v = $this->getEvaluationMessage();\n foreach($validationRules[self::FIELD_EVALUATION_MESSAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_EVALUATION_MESSAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EVALUATION_MESSAGE])) {\n $errs[self::FIELD_EVALUATION_MESSAGE] = [];\n }\n $errs[self::FIELD_EVALUATION_MESSAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CANONICAL])) {\n $v = $this->getModuleCanonical();\n foreach($validationRules[self::FIELD_MODULE_CANONICAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CANONICAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CANONICAL])) {\n $errs[self::FIELD_MODULE_CANONICAL] = [];\n }\n $errs[self::FIELD_MODULE_CANONICAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $v = $this->getModuleCodeableConcept();\n foreach($validationRules[self::FIELD_MODULE_CODEABLE_CONCEPT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_CODEABLE_CONCEPT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_CODEABLE_CONCEPT])) {\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT] = [];\n }\n $errs[self::FIELD_MODULE_CODEABLE_CONCEPT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODULE_URI])) {\n $v = $this->getModuleUri();\n foreach($validationRules[self::FIELD_MODULE_URI] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_MODULE_URI, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODULE_URI])) {\n $errs[self::FIELD_MODULE_URI] = [];\n }\n $errs[self::FIELD_MODULE_URI][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_NOTE])) {\n $v = $this->getNote();\n foreach($validationRules[self::FIELD_NOTE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_NOTE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_NOTE])) {\n $errs[self::FIELD_NOTE] = [];\n }\n $errs[self::FIELD_NOTE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $v = $this->getOccurrenceDateTime();\n foreach($validationRules[self::FIELD_OCCURRENCE_DATE_TIME] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OCCURRENCE_DATE_TIME, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OCCURRENCE_DATE_TIME])) {\n $errs[self::FIELD_OCCURRENCE_DATE_TIME] = [];\n }\n $errs[self::FIELD_OCCURRENCE_DATE_TIME][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_OUTPUT_PARAMETERS])) {\n $v = $this->getOutputParameters();\n foreach($validationRules[self::FIELD_OUTPUT_PARAMETERS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_OUTPUT_PARAMETERS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_OUTPUT_PARAMETERS])) {\n $errs[self::FIELD_OUTPUT_PARAMETERS] = [];\n }\n $errs[self::FIELD_OUTPUT_PARAMETERS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERFORMER])) {\n $v = $this->getPerformer();\n foreach($validationRules[self::FIELD_PERFORMER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_PERFORMER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERFORMER])) {\n $errs[self::FIELD_PERFORMER] = [];\n }\n $errs[self::FIELD_PERFORMER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_CODE])) {\n $v = $this->getReasonCode();\n foreach($validationRules[self::FIELD_REASON_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_CODE])) {\n $errs[self::FIELD_REASON_CODE] = [];\n }\n $errs[self::FIELD_REASON_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REASON_REFERENCE])) {\n $v = $this->getReasonReference();\n foreach($validationRules[self::FIELD_REASON_REFERENCE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REASON_REFERENCE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REASON_REFERENCE])) {\n $errs[self::FIELD_REASON_REFERENCE] = [];\n }\n $errs[self::FIELD_REASON_REFERENCE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REQUEST_IDENTIFIER])) {\n $v = $this->getRequestIdentifier();\n foreach($validationRules[self::FIELD_REQUEST_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_REQUEST_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REQUEST_IDENTIFIER])) {\n $errs[self::FIELD_REQUEST_IDENTIFIER] = [];\n }\n $errs[self::FIELD_REQUEST_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESULT])) {\n $v = $this->getResult();\n foreach($validationRules[self::FIELD_RESULT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_RESULT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESULT])) {\n $errs[self::FIELD_RESULT] = [];\n }\n $errs[self::FIELD_RESULT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_GUIDANCE_RESPONSE, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "protected function _getValidationErrors()\n {\n if (is_null($this->validationErrors)) {\n return array();\n }\n\n return $this->validationErrors;\n }", "public function getMessages($key)\n {\n return isset($this->errors[$key]) ? $this->errors[$key] : [];\n }", "public static function checkErrors(): array\n {\n $data = self::validateData();\n $errors = [];\n\n if (!empty($data['errorName'])) {\n $errors['errorName'] = $data['errorName'];\n }\n if (!empty($data['errorLastName'])) {\n $errors['errorLastName'] = $data['errorLastName'];\n }\n if (!empty($data['errorEmail'])) {\n $errors['errorEmail'] = $data['errorEmail'];\n }\n if (!empty($data['errorGender'])) {\n $errors['errorGender'] = $data['errorGender'];\n }\n if (!empty($data['errorPassword'])) {\n $errors['errorPassword'] = $data['errorPassword'];\n }\n if (!empty($data['errorBirth'])) {\n $errors['errorBirth'] = $data['errorBirth'];\n }\n\n return $errors;\n }", "public function getErrors()\n {\n $errors = $this->getValue('klarna_validation_errors');\n return $errors ? $errors : array();\n }", "public function getValidationErrors()\n\t{\n\t\tif(is_array($this->validation_errors) && \n\t\t\tsizeof($this->validation_errors))\n\t\t{\n\t\t\treturn array_unique($this->validation_errors);\n\t\t}\n\t\treturn array();\n\t}", "public function getErrors(): array\n {\n $errors = [];\n\n /** @var string $name @var HashSet $messages */\n foreach ($this->errors as $name => $messages) {\n $errors[$name] = [];\n foreach ($messages as $message) {\n $errors[$name][] = $message;\n }\n }\n\n return $errors;\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getAccident())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getAccidentType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ACCIDENT_TYPE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getAdditionalMaterials())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ADDITIONAL_MATERIALS, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCondition())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_CONDITION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getCoverage())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COVERAGE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getCreated())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CREATED] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getDiagnosis())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_DIAGNOSIS, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getEnterer())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ENTERER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getFacility())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FACILITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getFundsReserve())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_FUNDS_RESERVE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getInterventionException())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_INTERVENTION_EXCEPTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getItem())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_ITEM, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getMissingTeeth())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_MISSING_TEETH, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getOrganization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORGANIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getOriginalRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_ORIGINAL_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPatient())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PATIENT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPayee())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PAYEE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPrescription())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRESCRIPTION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPriority())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PRIORITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProvider())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROVIDER] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getReferral())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REFERRAL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRuleset())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RULESET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSchool())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SCHOOL] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getTarget())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TARGET] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT])) {\n $v = $this->getAccident();\n foreach($validationRules[self::FIELD_ACCIDENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT])) {\n $errs[self::FIELD_ACCIDENT] = [];\n }\n $errs[self::FIELD_ACCIDENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ACCIDENT_TYPE])) {\n $v = $this->getAccidentType();\n foreach($validationRules[self::FIELD_ACCIDENT_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ACCIDENT_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ACCIDENT_TYPE])) {\n $errs[self::FIELD_ACCIDENT_TYPE] = [];\n }\n $errs[self::FIELD_ACCIDENT_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ADDITIONAL_MATERIALS])) {\n $v = $this->getAdditionalMaterials();\n foreach($validationRules[self::FIELD_ADDITIONAL_MATERIALS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ADDITIONAL_MATERIALS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ADDITIONAL_MATERIALS])) {\n $errs[self::FIELD_ADDITIONAL_MATERIALS] = [];\n }\n $errs[self::FIELD_ADDITIONAL_MATERIALS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONDITION])) {\n $v = $this->getCondition();\n foreach($validationRules[self::FIELD_CONDITION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CONDITION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONDITION])) {\n $errs[self::FIELD_CONDITION] = [];\n }\n $errs[self::FIELD_CONDITION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COVERAGE])) {\n $v = $this->getCoverage();\n foreach($validationRules[self::FIELD_COVERAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_COVERAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COVERAGE])) {\n $errs[self::FIELD_COVERAGE] = [];\n }\n $errs[self::FIELD_COVERAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CREATED])) {\n $v = $this->getCreated();\n foreach($validationRules[self::FIELD_CREATED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_CREATED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CREATED])) {\n $errs[self::FIELD_CREATED] = [];\n }\n $errs[self::FIELD_CREATED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DIAGNOSIS])) {\n $v = $this->getDiagnosis();\n foreach($validationRules[self::FIELD_DIAGNOSIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_DIAGNOSIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DIAGNOSIS])) {\n $errs[self::FIELD_DIAGNOSIS] = [];\n }\n $errs[self::FIELD_DIAGNOSIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ENTERER])) {\n $v = $this->getEnterer();\n foreach($validationRules[self::FIELD_ENTERER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ENTERER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ENTERER])) {\n $errs[self::FIELD_ENTERER] = [];\n }\n $errs[self::FIELD_ENTERER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXCEPTION])) {\n $v = $this->getException();\n foreach($validationRules[self::FIELD_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXCEPTION])) {\n $errs[self::FIELD_EXCEPTION] = [];\n }\n $errs[self::FIELD_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FACILITY])) {\n $v = $this->getFacility();\n foreach($validationRules[self::FIELD_FACILITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FACILITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FACILITY])) {\n $errs[self::FIELD_FACILITY] = [];\n }\n $errs[self::FIELD_FACILITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_FUNDS_RESERVE])) {\n $v = $this->getFundsReserve();\n foreach($validationRules[self::FIELD_FUNDS_RESERVE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_FUNDS_RESERVE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_FUNDS_RESERVE])) {\n $errs[self::FIELD_FUNDS_RESERVE] = [];\n }\n $errs[self::FIELD_FUNDS_RESERVE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERVENTION_EXCEPTION])) {\n $v = $this->getInterventionException();\n foreach($validationRules[self::FIELD_INTERVENTION_EXCEPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_INTERVENTION_EXCEPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERVENTION_EXCEPTION])) {\n $errs[self::FIELD_INTERVENTION_EXCEPTION] = [];\n }\n $errs[self::FIELD_INTERVENTION_EXCEPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ITEM])) {\n $v = $this->getItem();\n foreach($validationRules[self::FIELD_ITEM] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ITEM, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ITEM])) {\n $errs[self::FIELD_ITEM] = [];\n }\n $errs[self::FIELD_ITEM][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MISSING_TEETH])) {\n $v = $this->getMissingTeeth();\n foreach($validationRules[self::FIELD_MISSING_TEETH] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_MISSING_TEETH, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MISSING_TEETH])) {\n $errs[self::FIELD_MISSING_TEETH] = [];\n }\n $errs[self::FIELD_MISSING_TEETH][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORGANIZATION])) {\n $v = $this->getOrganization();\n foreach($validationRules[self::FIELD_ORGANIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORGANIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORGANIZATION])) {\n $errs[self::FIELD_ORGANIZATION] = [];\n }\n $errs[self::FIELD_ORGANIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $v = $this->getOriginalPrescription();\n foreach($validationRules[self::FIELD_ORIGINAL_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_PRESCRIPTION])) {\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_ORIGINAL_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ORIGINAL_RULESET])) {\n $v = $this->getOriginalRuleset();\n foreach($validationRules[self::FIELD_ORIGINAL_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_ORIGINAL_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ORIGINAL_RULESET])) {\n $errs[self::FIELD_ORIGINAL_RULESET] = [];\n }\n $errs[self::FIELD_ORIGINAL_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PATIENT])) {\n $v = $this->getPatient();\n foreach($validationRules[self::FIELD_PATIENT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PATIENT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PATIENT])) {\n $errs[self::FIELD_PATIENT] = [];\n }\n $errs[self::FIELD_PATIENT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PAYEE])) {\n $v = $this->getPayee();\n foreach($validationRules[self::FIELD_PAYEE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PAYEE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PAYEE])) {\n $errs[self::FIELD_PAYEE] = [];\n }\n $errs[self::FIELD_PAYEE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRESCRIPTION])) {\n $v = $this->getPrescription();\n foreach($validationRules[self::FIELD_PRESCRIPTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRESCRIPTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRESCRIPTION])) {\n $errs[self::FIELD_PRESCRIPTION] = [];\n }\n $errs[self::FIELD_PRESCRIPTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PRIORITY])) {\n $v = $this->getPriority();\n foreach($validationRules[self::FIELD_PRIORITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PRIORITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PRIORITY])) {\n $errs[self::FIELD_PRIORITY] = [];\n }\n $errs[self::FIELD_PRIORITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROVIDER])) {\n $v = $this->getProvider();\n foreach($validationRules[self::FIELD_PROVIDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_PROVIDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROVIDER])) {\n $errs[self::FIELD_PROVIDER] = [];\n }\n $errs[self::FIELD_PROVIDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REFERRAL])) {\n $v = $this->getReferral();\n foreach($validationRules[self::FIELD_REFERRAL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_REFERRAL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REFERRAL])) {\n $errs[self::FIELD_REFERRAL] = [];\n }\n $errs[self::FIELD_REFERRAL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RULESET])) {\n $v = $this->getRuleset();\n foreach($validationRules[self::FIELD_RULESET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_RULESET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RULESET])) {\n $errs[self::FIELD_RULESET] = [];\n }\n $errs[self::FIELD_RULESET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SCHOOL])) {\n $v = $this->getSchool();\n foreach($validationRules[self::FIELD_SCHOOL] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_SCHOOL, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SCHOOL])) {\n $errs[self::FIELD_SCHOOL] = [];\n }\n $errs[self::FIELD_SCHOOL][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TARGET])) {\n $v = $this->getTarget();\n foreach($validationRules[self::FIELD_TARGET] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TARGET, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TARGET])) {\n $errs[self::FIELD_TARGET] = [];\n }\n $errs[self::FIELD_TARGET][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_CLAIM, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function messages()\n {\n $illegalFields = [ 'email', 'type', 'status', 'branches', ];\n $messages = [];\n\n foreach ($illegalFields as $key => $attribute) {\n $messages[\"{$attribute}.not_present\"] = __('The field :attribute must not be present.');\n }\n\n return $messages;\n }", "public function validation_errors()\n\t{\n\t\t$errors = array();\n\n\t\tforeach ($this->validators as $fld=>$arr)\n\t\t{\n\t\t\tforeach ($arr as $vl)\n\t\t\t{\n\t\t\t\t$vl->page = $this;\n\n\t\t\t\tif (!$vl->validate($fld, $this->vars))\n\t\t\t\t{\n\t\t\t\t\t$errors[$fld] = $vl->error_message($fld, $this->vars);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $errors;\n\t}", "private static function EventsResultValidatorArray(){\n\t\t\treturn array('object' => array(array(\n\t\t\t\t'eventID' => array('integer' => array()),\n\t\t\t\t'creator' => array('string' => array()),\n\t\t\t\t'name' => array('string' => array()),\n\t\t\t\t'category' => array('string' => array()),\n\t\t\t\t'description' => array('string' => array()),\n\t\t\t\t'date' => array('string' => array()),\n\t\t\t\t'dateUTC' => array('integer' => array()),\n\t\t\t\t'duration' => array('integer' => array()),\n\t\t\t\t'cover' => array('integer' => array()),\n\t\t\t\t'amount' => array('integer' => array()),\n\t\t\t\t'simName' => array('string' => array()),\n\t\t\t\t'globalPos' => array('array' => array()),\n\t\t\t\t'eventFlags' => array('integer' => array()),\n\t\t\t\t'maturity' => array('integer' => array())\n\t\t\t)));\n\t\t}", "public function getValidationErrors() {\n\t\tif ($this->_errors === null) {\n\t\t\treturn array();\n\t\t}\n\n\t\treturn $this->_errors->toArray();\n\t}", "public function getValidationErrors() {\n\t\treturn (array)$this -> _errors;\n\t}", "public function getMessage(): array\n {\n return [\n self::RULE_REQUIRED => 'This Field is required',\n self::RULE_EMAIL => 'Please input valid email address',\n self::RULE_MATCH => 'The Passwords must match',\n self::RULE_UNIQUE => 'This record exists in the database',\n self::RULE_VALID_START_DATE => 'Project start date cannot be before today',\n self::RULE_VALID_END_DATE => 'Project end date cannot be before start date'\n\n ];\n }", "protected function importValidationMessages()\n {\n return [];\n }", "protected function formatErrors(Validator $validator)\n {\n return $validator->getMessageBag()->toArray();\n }", "public function errorMessages()\n {\n return [\n self::RULE_REQUIRED => 'This field is required',\n self::RULE_EMAIL => 'This field must be a valid email address',\n self::RULE_MIN => 'Min length of this field must be {min}',\n self::RULE_MAX => 'Max length of this field must be {max}',\n self::RULE_MATCH => 'This field must be the same as {match}',\n self::RULE_UNIQUE => 'Record with this {field} already exists'\n ];\n }", "public function getErrors() : array;", "protected function _getFields()\n {\n return array(\n 'xf_keywordalert_keyword' => array(\n 'keyword_id' => array('type' => XenForo_DataWriter::TYPE_UINT, 'autoIncrement' => true),\n 'name' => array('type' => XenForo_DataWriter::TYPE_STRING, 'required' => true, 'maxLength' => 255,\n 'requiredError' => 'keywordalert_you_must_give_the_keyword_set_a_name'),\n 'keywords' => array('type' => XenForo_DataWriter::TYPE_SERIALIZED),\n 'notify_frequency' => array('type' => XenForo_DataWriter::TYPE_UINT, 'required' => true),\n 'send_alert' => array('type' => XenForo_DataWriter::TYPE_BOOLEAN, 'default' => 0),\n 'user_id' => array('type' => XenForo_DataWriter::TYPE_UINT, 'required' => true),\n 'forum_mode' => array(\n 'type' => XenForo_DataWriter::TYPE_STRING,\n 'required' => true,\n 'allowedValues' => array('whitelist', 'blacklist', 'all')\n ),\n 'forum_data' => array('type' => XenForo_DataWriter::TYPE_SERIALIZED),\n 'excluded_rules' => array('type' => XenForo_DataWriter::TYPE_SERIALIZED)\n )\n );\n }", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if ([] !== ($vs = $this->getCountry())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_COUNTRY, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getDataExclusivityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDateOfFirstAuthorization())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getHolder())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_HOLDER] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getIdentifier())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_IDENTIFIER, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getInternationalBirthDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getJurisdiction())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTION, $i)] = $fieldErrs;\n }\n }\n }\n if ([] !== ($vs = $this->getJurisdictionalAuthorization())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_JURISDICTIONAL_AUTHORIZATION, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getLegalBasis())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_LEGAL_BASIS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getProcedure())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PROCEDURE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRegulator())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_REGULATOR] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getRestoreDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_RESTORE_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatus())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getStatusDate())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATUS_DATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getSubject())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_SUBJECT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getValidityPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_VALIDITY_PERIOD] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $v = $this->getDataExclusivityPeriod();\n foreach($validationRules[self::FIELD_DATA_EXCLUSIVITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATA_EXCLUSIVITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD])) {\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD] = [];\n }\n $errs[self::FIELD_DATA_EXCLUSIVITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $v = $this->getDateOfFirstAuthorization();\n foreach($validationRules[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_DATE_OF_FIRST_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION])) {\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_DATE_OF_FIRST_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_HOLDER])) {\n $v = $this->getHolder();\n foreach($validationRules[self::FIELD_HOLDER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_HOLDER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_HOLDER])) {\n $errs[self::FIELD_HOLDER] = [];\n }\n $errs[self::FIELD_HOLDER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IDENTIFIER])) {\n $v = $this->getIdentifier();\n foreach($validationRules[self::FIELD_IDENTIFIER] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_IDENTIFIER, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IDENTIFIER])) {\n $errs[self::FIELD_IDENTIFIER] = [];\n }\n $errs[self::FIELD_IDENTIFIER][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $v = $this->getInternationalBirthDate();\n foreach($validationRules[self::FIELD_INTERNATIONAL_BIRTH_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_INTERNATIONAL_BIRTH_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_INTERNATIONAL_BIRTH_DATE])) {\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE] = [];\n }\n $errs[self::FIELD_INTERNATIONAL_BIRTH_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTION])) {\n $v = $this->getJurisdiction();\n foreach($validationRules[self::FIELD_JURISDICTION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTION])) {\n $errs[self::FIELD_JURISDICTION] = [];\n }\n $errs[self::FIELD_JURISDICTION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $v = $this->getJurisdictionalAuthorization();\n foreach($validationRules[self::FIELD_JURISDICTIONAL_AUTHORIZATION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_JURISDICTIONAL_AUTHORIZATION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION])) {\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION] = [];\n }\n $errs[self::FIELD_JURISDICTIONAL_AUTHORIZATION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LEGAL_BASIS])) {\n $v = $this->getLegalBasis();\n foreach($validationRules[self::FIELD_LEGAL_BASIS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_LEGAL_BASIS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LEGAL_BASIS])) {\n $errs[self::FIELD_LEGAL_BASIS] = [];\n }\n $errs[self::FIELD_LEGAL_BASIS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PROCEDURE])) {\n $v = $this->getProcedure();\n foreach($validationRules[self::FIELD_PROCEDURE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_PROCEDURE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PROCEDURE])) {\n $errs[self::FIELD_PROCEDURE] = [];\n }\n $errs[self::FIELD_PROCEDURE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_REGULATOR])) {\n $v = $this->getRegulator();\n foreach($validationRules[self::FIELD_REGULATOR] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_REGULATOR, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_REGULATOR])) {\n $errs[self::FIELD_REGULATOR] = [];\n }\n $errs[self::FIELD_REGULATOR][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_RESTORE_DATE])) {\n $v = $this->getRestoreDate();\n foreach($validationRules[self::FIELD_RESTORE_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_RESTORE_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_RESTORE_DATE])) {\n $errs[self::FIELD_RESTORE_DATE] = [];\n }\n $errs[self::FIELD_RESTORE_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS])) {\n $v = $this->getStatus();\n foreach($validationRules[self::FIELD_STATUS] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS])) {\n $errs[self::FIELD_STATUS] = [];\n }\n $errs[self::FIELD_STATUS][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATUS_DATE])) {\n $v = $this->getStatusDate();\n foreach($validationRules[self::FIELD_STATUS_DATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_STATUS_DATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATUS_DATE])) {\n $errs[self::FIELD_STATUS_DATE] = [];\n }\n $errs[self::FIELD_STATUS_DATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_SUBJECT])) {\n $v = $this->getSubject();\n foreach($validationRules[self::FIELD_SUBJECT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_SUBJECT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_SUBJECT])) {\n $errs[self::FIELD_SUBJECT] = [];\n }\n $errs[self::FIELD_SUBJECT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_VALIDITY_PERIOD])) {\n $v = $this->getValidityPeriod();\n foreach($validationRules[self::FIELD_VALIDITY_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_MEDICINAL_PRODUCT_AUTHORIZATION, self::FIELD_VALIDITY_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_VALIDITY_PERIOD])) {\n $errs[self::FIELD_VALIDITY_PERIOD] = [];\n }\n $errs[self::FIELD_VALIDITY_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_CONTAINED])) {\n $v = $this->getContained();\n foreach($validationRules[self::FIELD_CONTAINED] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_CONTAINED, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CONTAINED])) {\n $errs[self::FIELD_CONTAINED] = [];\n }\n $errs[self::FIELD_CONTAINED][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_MODIFIER_EXTENSION])) {\n $v = $this->getModifierExtension();\n foreach($validationRules[self::FIELD_MODIFIER_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_MODIFIER_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_MODIFIER_EXTENSION])) {\n $errs[self::FIELD_MODIFIER_EXTENSION] = [];\n }\n $errs[self::FIELD_MODIFIER_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_DOMAIN_RESOURCE, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_IMPLICIT_RULES])) {\n $v = $this->getImplicitRules();\n foreach($validationRules[self::FIELD_IMPLICIT_RULES] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_IMPLICIT_RULES, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_IMPLICIT_RULES])) {\n $errs[self::FIELD_IMPLICIT_RULES] = [];\n }\n $errs[self::FIELD_IMPLICIT_RULES][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LANGUAGE])) {\n $v = $this->getLanguage();\n foreach($validationRules[self::FIELD_LANGUAGE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_LANGUAGE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LANGUAGE])) {\n $errs[self::FIELD_LANGUAGE] = [];\n }\n $errs[self::FIELD_LANGUAGE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_META])) {\n $v = $this->getMeta();\n foreach($validationRules[self::FIELD_META] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_RESOURCE, self::FIELD_META, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_META])) {\n $errs[self::FIELD_META] = [];\n }\n $errs[self::FIELD_META][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "public function getErrorMessages() : array\n {\n return $this->errors_messages;\n }", "protected function getErrorData()\n {\n $error = [\n 'message' => $this->getErrorMessage(),\n ];\n\n if ($this->debug && \\is_object($this->error)) {\n $error['exception'] = \\get_class($this->error);\n $error['file'] = $this->error->getFile();\n $error['line'] = $this->error->getLine();\n $error['trace'] = \\collect($this->error->getTrace())->map(function ($trace) {\n return Arr::except($trace, ['args']);\n })->all();\n }\n\n if ($this->error instanceof ValidationException && $this->error->validator) {\n if ($this->error->validator) {\n $error['errors'] = $this->error->validator->errors();\n } else {\n $error['errors'] = [];\n }\n } elseif ($this->error instanceof MessageBag) {\n $error['errors'] = $this->error->getMessages();\n }\n\n return $error;\n }", "public function getErrorMessage()\n {\n return $this->validator->errors()->all();\n }", "public function getErrorMessagesList(){\n \t$errors = $this->getMessages();\n \tif(count($errors)){\n \t\t$result = [];\n \t\tforeach ($errors as $elementName => $elementErrors){\n \t\t\tforeach ($elementErrors as $errorMsg){\n \t\t\t\t$result[] = $errorMsg;\n \t\t\t}\n \t\t}\n \t\treturn $result;\n \t}\n \treturn null;\n }", "protected function validationMessages(): array\n {\n return [];\n }", "public function messages()\n {\n $messages = [];\n foreach($this->request->get('users') as $key => $val)\n {\n $messages['users.'. $key . '.name.max'] = 'The field labeled \"Name ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.phone.max'] = 'The field labeled \"Phone ' . $key . '\" must be less than :max characters.';\n $messages['users.'. $key . '.name.min'] = 'The field labeled \"Name ' . $key . '\" must be more than :min characters.';\n $messages['users.'. $key . '.phone.min'] = 'The field labeled \"Phone ' . $key . '\" must be more than :min characters.';\n }\n return $messages;\n }", "public function get_clear_error_msgs()\n {\n $msgs = array();\n foreach ($this->errors as $e) {\n $msgs[$e['field']][$e['rule']] = $this->get_validation_error_msg($e['field'], $e['rule'], $e['value']);\n\n }\n return $msgs;\n }", "public function getMandatoryValidationMessages() {}", "private function err_to_array() {\n return array(\n 'code' => $this->code,\n 'reason' => $this->http_status_code_string($this->code),\n 'message' => $this->message,\n );\n }", "public function getFieldData(): array\n {\n return array_map(fn ($fieldIndex) => (object) [\n 'name' => oci_field_name($this->resultID, $fieldIndex),\n 'type' => oci_field_type($this->resultID, $fieldIndex),\n 'max_length' => oci_field_size($this->resultID, $fieldIndex),\n ], range(1, $this->getFieldCount()));\n }", "public function getErrors()\n {\n return $this->getInputFilter()->getMessages();\n }", "function errors_list() \n {\n $errors = array();\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n if (!$obj->errors->not_errors())\n {\n $list = array();\n foreach ($obj->errors as $error) \n {\n $list[] = $error;\n }\n $errors[$obj->name] = $list;\n } \n }\n }\n return $errors;\n }", "protected function messages()\n {\n return [\n 'id.required' => HttpAttributeInvalidCode::ID_REQUIRED,\n 'password.required' => HttpAttributeInvalidCode::PASSWORD_REQUIRED,\n 'password.same' => HttpAttributeInvalidCode::CONFIRM_PASSWORD_NOT_SAME,\n 'display_name.required' => HttpAttributeInvalidCode::DISPLAY_NAME_REQUIRED,\n 'role_id.required' => HttpAttributeInvalidCode::ROLE_REQUIRED,\n 'status.required' => HttpAttributeInvalidCode::STATUS_REQUIRE\n ];\n }", "public function validationCreate()\n\t{\n\t\t$validationCreate=array();\n\t\tforeach($this->getTable()->result_array() as $row)\n\t\t{\n\t\t\tif($row['Extra']!=='auto_increment')\n\t\t\t{\n\t\t\t\t$validationCreate[]=array(\n\t\t\t\t\t'field'=>$row['Field'],\n\t\t\t\t\t'maxlength'=>preg_match('/varchar/',$row['Type']) ? (preg_replace('/[A-Za-z()]/','',$row['Type'])!=='' ? '\\'maxlength\\'=>'.preg_replace('/[A-Za-z()]/','',$row['Type']).',' : false) : false,\n\t\t\t\t\t'required'=>$row['Null']=='NO' ? '\\'required\\'=>true,' : false,\n\t\t\t\t\t'email'=>preg_match('/email/',$row['Field']) ? '\\'email\\'=>true,' : false,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn $validationCreate;\n\t}", "public function _getValidationErrors()\n {\n $errs = parent::_getValidationErrors();\n $validationRules = $this->_getValidationRules();\n if (null !== ($v = $this->getCity())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_CITY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getCountry())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_COUNTRY] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getDistrict())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_DISTRICT] = $fieldErrs;\n }\n }\n if ([] !== ($vs = $this->getLine())) {\n foreach($vs as $i => $v) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[sprintf('%s.%d', self::FIELD_LINE, $i)] = $fieldErrs;\n }\n }\n }\n if (null !== ($v = $this->getPeriod())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_PERIOD] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getPostalCode())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_POSTAL_CODE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getState())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_STATE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getText())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TEXT] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getType())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_TYPE] = $fieldErrs;\n }\n }\n if (null !== ($v = $this->getUse())) {\n if ([] !== ($fieldErrs = $v->_getValidationErrors())) {\n $errs[self::FIELD_USE] = $fieldErrs;\n }\n }\n if (isset($validationRules[self::FIELD_CITY])) {\n $v = $this->getCity();\n foreach($validationRules[self::FIELD_CITY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_CITY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_CITY])) {\n $errs[self::FIELD_CITY] = [];\n }\n $errs[self::FIELD_CITY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_COUNTRY])) {\n $v = $this->getCountry();\n foreach($validationRules[self::FIELD_COUNTRY] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_COUNTRY, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_COUNTRY])) {\n $errs[self::FIELD_COUNTRY] = [];\n }\n $errs[self::FIELD_COUNTRY][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_DISTRICT])) {\n $v = $this->getDistrict();\n foreach($validationRules[self::FIELD_DISTRICT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_DISTRICT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_DISTRICT])) {\n $errs[self::FIELD_DISTRICT] = [];\n }\n $errs[self::FIELD_DISTRICT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_LINE])) {\n $v = $this->getLine();\n foreach($validationRules[self::FIELD_LINE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_LINE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_LINE])) {\n $errs[self::FIELD_LINE] = [];\n }\n $errs[self::FIELD_LINE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_PERIOD])) {\n $v = $this->getPeriod();\n foreach($validationRules[self::FIELD_PERIOD] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_PERIOD, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_PERIOD])) {\n $errs[self::FIELD_PERIOD] = [];\n }\n $errs[self::FIELD_PERIOD][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_POSTAL_CODE])) {\n $v = $this->getPostalCode();\n foreach($validationRules[self::FIELD_POSTAL_CODE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_POSTAL_CODE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_POSTAL_CODE])) {\n $errs[self::FIELD_POSTAL_CODE] = [];\n }\n $errs[self::FIELD_POSTAL_CODE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_STATE])) {\n $v = $this->getState();\n foreach($validationRules[self::FIELD_STATE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_STATE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_STATE])) {\n $errs[self::FIELD_STATE] = [];\n }\n $errs[self::FIELD_STATE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TEXT])) {\n $v = $this->getText();\n foreach($validationRules[self::FIELD_TEXT] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TEXT, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TEXT])) {\n $errs[self::FIELD_TEXT] = [];\n }\n $errs[self::FIELD_TEXT][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_TYPE])) {\n $v = $this->getType();\n foreach($validationRules[self::FIELD_TYPE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_TYPE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_TYPE])) {\n $errs[self::FIELD_TYPE] = [];\n }\n $errs[self::FIELD_TYPE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_USE])) {\n $v = $this->getUse();\n foreach($validationRules[self::FIELD_USE] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ADDRESS, self::FIELD_USE, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_USE])) {\n $errs[self::FIELD_USE] = [];\n }\n $errs[self::FIELD_USE][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_EXTENSION])) {\n $v = $this->getExtension();\n foreach($validationRules[self::FIELD_EXTENSION] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_EXTENSION, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_EXTENSION])) {\n $errs[self::FIELD_EXTENSION] = [];\n }\n $errs[self::FIELD_EXTENSION][$rule] = $err;\n }\n }\n }\n if (isset($validationRules[self::FIELD_ID])) {\n $v = $this->getId();\n foreach($validationRules[self::FIELD_ID] as $rule => $constraint) {\n $err = $this->_performValidation(PHPFHIRConstants::TYPE_NAME_ELEMENT, self::FIELD_ID, $rule, $constraint, $v);\n if (null !== $err) {\n if (!isset($errs[self::FIELD_ID])) {\n $errs[self::FIELD_ID] = [];\n }\n $errs[self::FIELD_ID][$rule] = $err;\n }\n }\n }\n return $errs;\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.regex' => 'Password must contain at least 1 uppercase letter and 1 number.',\n ];\n }", "public function customValidationMessages()\n {\n return [\n 'role_id.required' => 'The role ID is required.',\n 'role_id.exists' => 'The role ID provided does not exist.',\n 'staff_code.required' => 'The staff code is required.',\n 'name.required' => 'The name field is required.',\n 'name.max' => 'The name field exceeds the maximum length of 255.',\n 'email.email' => 'Please provide an email address.',\n ];\n }", "function getErrors($a_bool_allowMultipleErrors = false)\n\t{\n\t\t$arr_returnedErrors = array();\n\t\t$arr_fieldNames = array();\n\t\t\n\t\tif($a_bool_allowMultipleErrors)\n\t\t{\n\t\t\t$arr_returnedErrors = $this->arr_validationErrors;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor($i = 0; $i < sizeof($this->arr_validationErrors); $i++)\n\t\t\t{\n\t\t\t\tif(!in_array($this->arr_validationErrors[$i]->getFieldName(), $arr_fieldNames))\n\t\t\t\t{\n\t\t\t\t\tarray_push($arr_fieldNames, $this->arr_validationErrors[$i]->getFieldName());\n\t\t\t\t\tarray_push($arr_returnedErrors, $this->arr_validationErrors[$i]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $arr_returnedErrors;\n\t}", "public static function isolateErrors($result) {\n\t\tif (is_array($result) && $result['errors']) {\n\t\t\treturn $result['errors'];\n\t\t} else if (is_string($result)) {\n\t\t\t$result = json_decode($result, true);\n\t\t\tif ($result && $result['errors']) {\n\t\t\t\treturn $result['errors'];\n\t\t\t} else {\n\t\t\t\treturn array();\n\t\t\t}\n\t\t}\n\t\treturn [];\n\t}", "public function messages()\n {\n return $messages = [\n 'source_funds.required' => trans('common.error_messages.req_this_field'),\n 'jurisdiction_funds.required' => trans('common.error_messages.req_this_field'),\n 'annual_income.required' => trans('common.error_messages.req_this_field'),\n 'other_source.required' => trans('common.error_messages.req_this_field'),\n 'estimated_wealth.required' => trans('common.error_messages.req_this_field'),\n 'wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'other_wealth_source.required' => trans('common.error_messages.req_this_field'),\n 'tin_code.required' => trans('common.error_messages.req_this_field'),\n 'is_abandoned.required' => trans('common.error_messages.req_this_field'),\n 'date_of_abandonment.required' => trans('common.error_messages.req_this_field'),\n 'abandonment_reason.required' => trans('common.error_messages.req_this_field'),\n 'justification.required' => trans('common.error_messages.req_this_field'),\n 'tin_country_name.required' => trans('common.error_messages.req_this_field'),\n 'tin_number.required' => trans('common.error_messages.req_this_field'),\n ];\n }", "public function getFields()\r\n\t{\r\n\t \tforeach($this->mapping_rules as $field => $rule)\r\n\t \t{\r\n\t\t\tif(!strlen($rule['value']))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tif(strpos($rule['value'],',') === false)\r\n\t\t\t{\r\n\t\t\t\t$fields[] = strtolower($rule['value']);\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t \t$tmp_fields = explode(',',$rule['value']);\r\n\t\t\t$value = '';\r\n\t\t \tforeach($tmp_fields as $tmp_field)\r\n\t \t\t{\r\n\t\t\t\t$fields[] = trim(strtolower($tmp_field));\r\n\t \t\t}\r\n\t \t}\r\n\t\treturn $fields ? $fields : array();\r\n\t}", "public function getErrors(): array\n {\n $error = [];\n\n foreach ($this->list as $r) {\n $error[$r->getPropertyPath()] = $r->getMessage();\n }\n\n return $error;\n }", "protected function validationErrorMessages()\n {\n return [\n 'password.required' => trans('strings.request_password_required'),\n 'password.confirmed' => trans('strings.request_password_confirmed'),\n 'password.min' => trans('strings.request_password_min', ['chars' => config('db_limits.users.minPasswordLength')]),\n ];\n }", "public function errors() {\n $errors = array();\n foreach ($this->properties as $property) {\n if (!$property->rulesPassed()) {\n $errors[$property->getName()] = $property->getErrors();\n }\n }\n return $errors;\n }", "public function getErrors(): array;", "public function getErrors(): array;", "public function getErrors(): array;", "public function getAllMessage()\n {\n $messages = [];\n foreach (array_keys($this->errors) as $key) {\n $messages[$key] = $this->getMessage($key);\n }\n return $messages;\n }", "public function getValidationMessages()\n {\n return $this->validationMessages;\n }", "public function errors()\n {\n return $this->validation->messages()->messages();\n }", "public function errors()\n {\n $errors = [];\n foreach($this->errors as $type => $error) {\n if (!empty($error)) {\n $errors[] = $error;\n }\n }\n return $errors;\n }", "protected function getAllFields($result)\n {\n $res = array();\n // per ogni riga\n foreach ($result as $row) {\n // per ogni campo\n foreach ($row as $key=>$field) {\n // se non esiste la chiave nell'array, la crea\n $res[$key] = null;\n }\n }\n \n return $res;\n }", "private function dataCreateValidate()\n\t{\n\t\treturn array(\n\t\t\t'file_date' => form_error('file_date'),\n\t\t\t'type_file' => form_error('type_file')\n\t\t);\n\t}", "public function getFields() {\n $columns = $this->schema();\n if (empty($columns)) {\n trigger_error(__d('cake_dev', '(Model::getColumnTypes) Unable to build model field data. If you are using a model without a database table, try implementing schema()'), E_USER_WARNING);\n }\n\n $results = array();\n foreach ($columns as $key => $col) {\n $results[] = $key;\n }\n unset($columns);\n return $results;\n }", "public function errors()\n {\n return $this->validator->errors()->messages();\n }", "public function messages()\n {\n return [\n 'contractor_account_id.exists' => 'Invalid data.',\n 'truck_id.exists' => 'Invalid data.',\n 'source_id.exists' => 'Invalid data.',\n 'destination_id.exists' => 'Invalid data.',\n 'driver_id.exists' => 'Invalid data.',\n 'material_id.exists' => 'Invalid data.',\n ];\n }", "public function getValidationErrors($value)\n\t{\n\t\treturn array();\n\t}", "public function getFieldDefinitions() {\n\t\treturn array(\n\t\t\tself::LOCAL_FIELD_MESSAGE => 'Message',\n\t\t\tself::FIELD_FILE => 'File',\n\t\t\tself::FIELD_LINE => 'Line',\n\t\t);\n\t}", "public function validationData()\n {\n $jsMessages = array();\n $jsValidations = $this->generateJavascriptValidations();\n\n return [\n 'rules' => $jsValidations,\n 'messages' => $jsMessages,\n ];\n }", "public function getFieldDeserializers(): array {\n $o = $this;\n return array_merge(parent::getFieldDeserializers(), [\n 'result' => fn(ParseNode $n) => $o->setResult($n->getObjectValue([EvaluateLabelJobResultGroup::class, 'createFromDiscriminatorValue'])),\n ]);\n }", "public static function getValidationArray()\n {\n return static::$_validate;\n }", "public function errorsOf($value): array;", "private function get_field_value_types() : array {\n $fields_with_value_types = array_filter( $this->instances, function( $instance ) {\n return $instance instanceof Field && $this->does_field_have_value_type( $instance );\n } );\n\n return array_reduce( $fields_with_value_types, function( $value_types, $field ) {\n $value_types[ $field::TYPE ] = $field::TYPE . 'Value';\n\n return $value_types;\n }, [] );\n }", "public function getFormErrors(): array\n {\n return $this->formErrors;\n }", "public function getFieldValidationErrors()\n {\n return $this->_aInputValidationErrors;\n }", "public static function getValidationTypeList()\n {\n return [\n self::VALIDATION_FREE_TEXT => '',\n self::VALIDATION_NUMBER => '',\n ];\n }", "public function getErrors():array;", "final public function getFieldErrorMessages(string $field)\n {\n $messages = $this->getErrorMessages();\n $fieldName = $this->fieldNameToDot($field);\n return isset($messages[$fieldName]) ? Arr::dot([$fieldName => $messages[$fieldName]]) : [];\n }", "abstract public function getFieldsArray(\n &$result, \n $make_lower_case = false);", "function field_data()\n\t{\n\t\t$retval = array();\n\t\tforeach(sqlsrv_field_metadata($this->result_id) as $offset => $field)\n\t\t{\n\t\t\t$F \t\t\t\t= new stdClass();\n\t\t\t$F->name \t\t= $field['Name'];\n\t\t\t$F->type \t\t= $field['Type'];\n\t\t\t$F->max_length\t= $field['Size'];\n\t\t\t$F->primary_key = 0;\n\t\t\t$F->default\t\t= '';\n\t\t\t\n\t\t\t$retval[] = $F;\n\t\t}\n\t\t\n\t\treturn $retval;\n\t}" ]
[ "0.64899147", "0.63041604", "0.62535137", "0.62530774", "0.62438506", "0.61968607", "0.6152149", "0.60276747", "0.6023718", "0.60085267", "0.60082537", "0.6002118", "0.5929467", "0.5928846", "0.5918402", "0.5910823", "0.5874207", "0.5874207", "0.5849684", "0.584697", "0.5837981", "0.58368737", "0.5836732", "0.58205706", "0.58205706", "0.57643056", "0.5762544", "0.5748257", "0.57107645", "0.57072407", "0.56992257", "0.5697529", "0.5679326", "0.5659469", "0.56562597", "0.5652636", "0.5642084", "0.564112", "0.5632549", "0.5625569", "0.56125474", "0.5609722", "0.5585909", "0.55856854", "0.55686843", "0.55679685", "0.55642366", "0.55611587", "0.55557597", "0.55555063", "0.55459315", "0.5539804", "0.5518224", "0.55174124", "0.55146915", "0.5508937", "0.5498437", "0.54951936", "0.54945266", "0.5493982", "0.54920995", "0.5489727", "0.5485511", "0.54826015", "0.5481527", "0.54798913", "0.54733455", "0.54717386", "0.54706705", "0.5456494", "0.54556507", "0.54534984", "0.5451243", "0.5443484", "0.5441575", "0.5441575", "0.5441575", "0.5441476", "0.5439076", "0.543447", "0.5432126", "0.54278725", "0.54267937", "0.5419529", "0.54113173", "0.5410929", "0.54074514", "0.5405506", "0.5403688", "0.54023707", "0.54004204", "0.53974426", "0.5394746", "0.5388087", "0.53845596", "0.5382008", "0.5380486", "0.5372501", "0.5369226", "0.5358287" ]
0.6721982
0
Constructor dari Class Login
public function __construct() { parent::__construct(); $this->load->model('Admin_m', 'admin'); if ($this->session->userdata('is_login_in') !== TRUE) { redirect('login'); } $this->idUser = $this->session->userdata('id_admin'); $this->tokenSession = $this->session->userdata('token'); $this->tokenServer = $this->admin->get_token_byId($this->idUser)->row()->token; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __construct($idusuario, $idlogin, $passwordlogin) {//constructor de la clase login\n $this->idusuario = $idusuario;\n $this->idlogin = $idlogin;\n $this->passwordlogin = $passwordlogin;\n }", "function __construct($login, $password) {\n $this->login = $login;\n $this->password = $password;\n }", "public function __construct (){\n\n \tparent::__construct();\n\n// essa pagina precisa estar logado para acessar \n$u = new Usuarios();\n \t$u->verificarLogin();\n \n \t \n }", "public function __construct(){\n\t\t$u = new Login();\n\n\t\tif(!$u->isLogged()){\n\t\t\theader(\"Location: \".BASE_URL.\"login\");\n\t\t}\n\n\t}", "public function __construct(){\n\t\t\tparent::__construct();\n\t\t\t//----------\n\t\t\tif($_SERVER[\"REQUEST_METHOD\"] == \"POST\"){\n\t\t\t\t$c_username = $_POST[\"c_username\"];\n\t\t\t\t$c_password = $_POST[\"c_password\"];\n\t\t\t\t$c_password = md5($c_password);\n\t\t\t\t$arr = $this->model->fetch_one(\"select c_username,c_password from tbl_user where c_username='$c_username'\");\n\t\t\t\tif(isset($arr[\"c_username\"])){\n\t\t\t\t\t//kiem tra password\n\t\t\t\t\tif($arr[\"c_password\"] == $c_password){\n\t\t\t\t\t\t//dang nhap thanh cong\n\t\t\t\t\t\t$_SESSION[\"c_username\"] = $c_username;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\techo \"not ok\";\n\t\t\t\t}\n\t\t\t\theader(\"location:index.php\");\n\t\t\t}\n\t\t\t//----------\n\t\t\t//load view\n\t\t\tinclude \"view/view_login.php\";\n\t\t}", "public function __construct() {\n $this->isLogin();\n }", "function __construct() {\r\n parent::__construct(false, $name = 'CSH Login');\t\r\n }", "public function __construct()\n\t{\n\t\t$this->check_login();\n\t}", "private function login(){\n \n }", "public function login(){\n\n }", "public function login()\n {\n }", "public function login()\n {\n }", "public function login()\n {\n //$this->username = $username; // we are gonnna use the above property: $username here\n //$this->password = $password;\n // we want to call authuser from within login so\n $this->auth_user(); // we don't need to pass any arguments here because we know the class properties above this line\n\n }", "public function login();", "public function login();", "public function __construct($login = null, $password = null) {\n \n if(func_num_args() == 0)\n return;\n \n $this->login = $login;\n $this->password = $password;\n \n $userInfo = self::getUserFromDb($login, $password);\n \n if($userInfo) {\n $this->id = $userInfo['id'];\n $this->role = $userInfo['role'];\n $this->lastLoginTime = $userInfo['last_login'];\n $this->authKey = $userInfo['auth_key'];\n $this->authExpired = $userInfo['auth_expire'];\n }\n }", "public function __construct($l,$s) {\n $this->login = $l;\n $this->senha = $s;\n }", "public function __construct() {\n parent::__construct();\n\n \t$this->must_login();\n }", "public function __construct($usuario,$password){\n\t\t$this->user = $usuario;\n\t\t$this->pass = $password;\n\t}", "public function __construct()\n {\n parent::__construct();\n isLogin();\n }", "public function __construct(){\n\t\t\tparent::__construct();\n\t\t\t//-----------\n\t\t\tif($_SERVER[\"REQUEST_METHOD\"] == \"POST\"){\n echo \"fdfdsf\";\n\t\t\t\t$c_username = $_POST[\"c_username\"];\n\t\t\t\t$c_password = $_POST[\"c_password\"];\n\t\t\t\t$check = $this->model->fetch_one(\"select c_username,c_password from tbl_user where c_username= '$c_username' \");\n print_r($check);\n\t\t\t\tif(isset($check->c_username)){\n\t\t\t\t\t//kiem tra password\n\t\t\t\t\tif($check->c_password == md5($c_password)){\n\t\t\t\t\t\t//dang nhap thanh cong\n\t\t\t\t\t\t$_SESSION[\"c_username\"] = $c_username;\n\t\t\t\t\t\t//di chuyen den trang can chi dinh\n //echo \"dang nhap thanh cong\" . $_SESSION[\"c_username\"];\n\n\t\t\t\t\t\theader(\"location:admin.php\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\theader(\"location:admin.php?err=invalid\");\n\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\theader(\"location:admin.php?err=invalid\");\n //echo \"dang nhap thanh cong\" . $_SESSION[\"c_username\"];\n\t\t\t\t}\n\t\t\t}\n\t\t\t//-----------\n\t\t\t//load view\n\t\t\tinclude \"view/backend/view_login.php\";\n\t\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t$this->load->helper('security'); /* Load the Security Helper for password */\n\t\t$this->load->library('form_validation');\t/* Load the Form Validation Library to do login form validation */\n\t\t$this->load->model('login_model'); \t\t\t/* Load the Login Model to do Database Transaction */\n\n\t\t$this->check_is_user_login();\t\t\t\t/* Check that the session is exist or not */\n\t}", "public function __construct() {\n parent::__construct();\n $u = new Users(); //verifica se o usuario ta logado\n if ($u->isLogged() == false) {\n header(\"Location:\" . BASE_URL . \"/login\");\n exit;\n }\n }", "public function __construct(){\n //Se solicita informacion a la BD, se llama al metodo modelo de la clase Controlador, que devuelve una instacia del objeto \n $this->ConsultaLogin_M = $this->modelo(\"Login_M\");\n }", "public function __construct() {\n parent::__construct();\n // Verifica se está logado, se não vai para pagina de login \n $u = new Users();\n if($u->isLogged() == false) {\n header(\"Location:\".BASE_URL.\"/login\");\n exit;\n }\n }", "public function __construct()\r\n {\r\n //Auth Security\r\n loginSecurity();\r\n }", "function __construct(){\r\n if(isset($_SESSION['login']) && $_SESSION['login'] == 'true' && isset($_SESSION['username'])){\r\n $this->username = $_SESSION['username'];\r\n $this->login = $_SESSION['login'];\r\n $this->email = $_SESSION['email'];\r\n $this->credential = $_SESSION['credential'];\r\n $this->picture = $_SESSION['picture'];\r\n $this->academy = $_SESSION['fullname'];\r\n }\r\n }", "public function __construct()\n\t{\n\t\t$this->import('BackendUser', 'User');\n\t\tparent::__construct();\n\n\t\t// Login\n\t\tif ($this->User->login())\n\t\t{\n\t\t\t$strUrl = 'contao/main.php';\n\n\t\t\t// Redirect to the last page visited\n\t\t\tif (\\Input::get('referer', true) != '')\n\t\t\t{\n\t\t\t\t$strUrl = base64_decode(\\Input::get('referer', true));\n\t\t\t}\n\n\t\t\t$this->redirect($strUrl);\n\t\t}\n\n\t\t// Reload the page if authentication fails\n\t\telseif (!empty($_POST['username']) && !empty($_POST['password']))\n\t\t{\n\t\t\t$this->reload();\n\t\t}\n\n\t\t// Reload the page once after a logout to create a new session_id()\n\t\telseif ($this->User->logout())\n\t\t{\n\t\t\t$this->reload();\n\t\t}\n\n\t\t\\System::loadLanguageFile('default');\n\t\t\\System::loadLanguageFile('tl_user');\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n\t\t$this->load->helper('url');\n\n\t\t$this->load->library('session');\n\n\t\t$this->load->model('login_model');\n\t\t\n\t\t$this->user = $this->login_model->verifica_login();\n\n\t\t$this->load->model('livro_model');\n\n\t}", "function __construct(string $username, string $password, $db)\n {\n $this->username = $username;\n $this->password = $password;\n $this->db = $db;\n\n //Check of de user al is ingelogd wanneer deze class word gemaakt.\n if (empty($_SESSION['auth'])) {\n if ($this->verifyAccount()) {\n }\n }\n }", "public function login(){\n\n }", "public function __construct() {\n\t\tparent::__construct();\n\t\t$this->load->model('Data_model');\n\t\tcek_login();\n\t}", "function __construct() {\n\t\t\tsession_start();\n\t\t\t$this->check_login();\n\t\t}", "public function __construct()\n {\n if(isset($_SESSION['user_login'])){\n $this->user_login = $_SESSION['user_login'];\n $this->access_level = $_SESSION['access_level'];\n $this->logged_in = true;\n }\n else{\n $this->user_login = null;\n $this->access_level=self::ACCESS_LEVEL_NONE;\n $this->logged_in=false;\n }\n }", "public function __construct($username, $password) {\n $this->login($username, $password);\n }", "function __construct(){\n\n\t\tparent::__construct(); //Llamada al constructor de la clase padre\n\n\t\t$this->id = \"\";\n\t\t$this->password = \"\";\n\n\t}", "function __construct() {\n\t\tparent::__construct();\n\t\t$this->url = str_replace(ADMIN_PATH, \"\", $_SERVER['PHP_SELF']);\n\n\t\t// login in progress\n\t\tif($this->getStatus() == \"login\") {\n\n\n\t\t\tglobal $username;\n\t\t\tglobal $password;\n\n\t\t\tSession::setLogin(new Login());\n\t\t\tSession::getLogin()->doLogin($username, $password, defined('ADMIN_FRONT') ? ADMIN_FRONT :\"/front/index.php\");\n\n// //\t\t\thttp_post_fields('http://api.users.local/login', array('username' => $username, 'password' => $password));\n// //\t\t\tprint_r(http_parse_message($response));\n// \n// \n// \t\t\t$request = new HttpRequest('http://wiresusers.dearapi.com/login', HttpRequest::METH_POST);\n// //\t\t\t$request = new HttpRequest('http://users.wires.dk/login', HttpRequest::METH_POST);\n// \t\t\t$request->addPostFields(array('username' => $username, 'password' => $password));\n// \n// \t\t\ttry {\n// \n// //\t\t\t\tprint \"#.#\".$request->send()->getBody().\"#:#\";\n// \t\t\t\t$response = new DOMDocument('1.0', 'UTF-8');\n// //\t\t\t\tprint $request->send()->getBody();\n// \t\t\t\t$response->loadXML($request->send()->getBody());\n// \n// \t\t\t\tif($response->schemaValidate(FRAMEWORK_PATH.\"/library/translations/login.xsd\")) {\n// \n// \t\t\t\t\t// $user_id = $response->getElementById(\"user_id\");\n// \t\t\t\t\t// $nickname = $response->getElementById(\"nickname\");\n// \n// \t\t\t\t\t// getElementById doesn't work (works on my 5.3 on mac)\n// \t\t\t\t\t// use this workaround instead\n// \t\t\t\t\t$xpath = new DOMXPath($response);\n// \t\t\t\t\t$user_id = $xpath->query(\"//*[@id='user_id']\")->item(0);\n// \t\t\t\t\t$nickname = $xpath->query(\"//*[@id='nickname']\")->item(0);\n// \n// \t\t\t\t\tif($user_id && $nickname) {\n// \n// \t\t\t\t\t\t// print $user_id->nodeValue;\n// \n// \t\t\t\t\t\tSession::setLogin(new Login());\n// \t\t\t\t\t\tSession::getLogin()->doLogin($user_id->nodeValue, $nickname->nodeValue, defined('ADMIN_FRONT') ? ADMIN_FRONT :\"/front/index.php\");\n// \t\t\t\t\t}\n// \t\t\t\t}\n// \t\t\t}\n// \t\t\tcatch (HttpException $e) {\n// \n// //\t\t\t\treturn false;\n// \t\t\t}\n\t\t}\n\t\telse if($this->getStatus() == \"logoff\") {\n\n\t\t\t$this->logOff();\n\t\t}\n\t\t// no login, send to login page\n\t\telse if(!Session::getLogin()) {\n\t\t\tSession::setLoginForward($this->url);\n\t\t\theader(\"Location: /index.php\");\n\t\t\texit();\n\t\t}\n\n\t\t$this->addTranslation(__FILE__);\n\t\t$this->addTranslation(LOCAL_PATH.\"/library/admin.navigation.summary.php\");\n\t}", "public function __construct($username=\"\",$password=\"\")\n {\n \tif(empty($username)) $this->username = \"esiise\";\n \tif(empty($password)) $this->password = \"137070\";\n }", "public function __construct() {\n /**\n * Dit is de constructor.\n */\n parent::__construct();\n $this->load->helper('form');\n $this->load->helper('notation');\n if (!$this->authex->loggedIn()) {\n redirect('home/login');\n }\n }", "public function __construct($username='',$password=''){\n\n $this->username = $username;\n $this->password = $password;\n }", "public function __construct()\n {\n // create/read session, absolutely necessary\n @session_start();\n\n // check the possible login actions:\n // if user tried to log out (happen when user clicks logout button)\n if (isset($_GET[\"logout\"])) {\n $this->doLogout();\n }\n // login via post data (if user just submitted a login form)\n elseif (isset($_POST[\"login\"])) {\n $this->dologinWithPostData();\n }\n // mark account for reset and email token\n elseif (isset($_POST[\"reset\"])) {\n $this->sendResetLink();\n }\n // validate token and reset password\n elseif (isset($_POST[\"update_password\"])) {\n $this->updatePassword();\n }\n }", "function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->library('template');\n\t\t$this->load->helper(array('form', 'url', 'html'));\n\t\t$this->load->library(array('form_validation', 'table', 'simple_login', 'session'));\n\t\t$this->load->model('Admin_model');\n\t\t$this->load->database();\n\t\t\n\t\t$this->simple_login->cek_login();//memproteksi semua method\n\t\t//$this->load->library('table');\n\t}", "function __construct(){ //method construct\n parent::__construct(); //agar dijalankan pertama kali\n\t\t$this->load->model('m_login'); //load data di m login\n\n\t}", "public function __construct(){\n\t\t\t$this->authentication();\n\t\t}", "public function __construct($username, $password)\n {\n //echo 'Constructor Called <br />';\n $this->username = $username;\n $this->password = $password;\n }", "public function __construct()\n {\n if(isset($_POST[\"login\"])){\n $this->Login();\n }\n //si les session exist on appel loginUser sinon on Actualise la page Accueil\n \n else if (isset($_SESSION[\"password1\"]) && isset($_SESSION[\"username1\"])){\n if(isset($_SESSION[\"pass\"]) && isset($_SESSION[\"user\"])){\n $this->LoginAdmin();\n } \n elseif(isset($_SESSION[\"password\"]) && isset($_SESSION[\"username\"])){\n $this->LoginUser();\n } \n else{\n echo \"rien\";\n }\n }\n \n else {\n echo \"wttf\";\n header(\"Location: http://127.0.0.1:8888/edsa-pfe-mvc/ \");\n } \n \n \n \n}", "public function __construct() {\n parent::__construct();\n //chama o método que faz a validação de login de usuario\n $this->load->model('Noticia_model');\n \n $this->load->view('Header/Header');\n $this->load->model('Jornalista_model');\n $this->Jornalista_model->verificaLogin();\n }", "public function __construct(){\n\n\t\tparent::__construct();\n\n\t\t// Check Authentication\n\t\tif(!$this->session->userdata(\"accUsername\")){\n\n\t\t\tredirect(\"/Font-end/Auth/signIn/0\");\n\t\t}\n\n\t\t//lang load\n\t\t$languaue = $this->session->userdata(\"languaue\");\n\t\t$this->lang->load('ktt', $languaue);\n\n\t\t//echo $this->lang->line(\"signInFail\");\n\t}", "public function login(){\n if ($_SERVER[\"REQUEST_METHOD\"] == \"POST\" && isset($_POST[\"Anmelden\"]) && $_POST[\"Anmelden\"] == \"Anmelden\") {\n if ($this->error == false) {\n $datenbank = new DatenbankAufrufe;\n #Prüfung ob der Benutzer bereits existiert\n $result = $datenbank->existBenutzer();\n if ($result == true) {\n $dbPasswort = $datenbank->passwortAuslesen();\n $pwKrypto = new PasswortSpeichern;\n $result2 = $pwKrypto->passwortAbgleich($_POST['passwort'], $dbPasswort);\n if ($result2 == true) {\n #SESSION\n $session = new sessionClass;\n $name = $datenbank->benutzernameAuslesen();\n $session->SessionStart($name, $datenbank);\n\n header(\"Location: index.php?site=main\");\n }\n else {\n echo \"Das Passwort ist nicht korrekt\";\n }\n } else {\n echo \"Bitte zuerst Registrieren\";\n }\n }\n }\n }", "function __construct()\n {\n\t\tparent::__construct();\n\t if(!$this->session->userdata('uid'))\n\t { \n\t\t\tredirect('home');\n\t }\n\t\telse\n\t\t{\n\t\t\t$this->loginuser = $this->Admin_mo->getrow('users',array('uid'=>$this->session->userdata('uid')));\n\t\t}\n\t}", "function __construct($code){\n\t\t$this->code = $code;\n\t\t$this->DB = $GLOBALS['DB'];\n\t\t$this->login = new Login();\n\t}", "public function __construct() {\r\n parent::__construct(); \r\n \r\n //llamo al helper url\r\n $this->load->helper(\"url\"); \r\n \r\n //llamo o incluyo el modelo\r\n $this->load->model(\"FichaModel\");\r\n \r\n $this->load->model('ModelLogin');\r\n\t\t\r\n\t\tif(!$this->ModelLogin->valida_session()){ redirect('Home'); }\r\n\t\t//cargo la libreria de sesiones\r\n $this->load->library(\"session\");\r\n }", "function __construct(){\n\n\t\t\tparent::__construct();\n\n\t\t\tif($this->value('action')){\n\n\t\t\t\t/*\n\n\t\t\t\t\tThis block of statement(s) are to handle all the actions supported by this Login class\n\n\t\t\t\t\tthat is it could be the case that more then one action are handled by login\n\n\t\t\t\t\tfor example at first the action is \"login\" then after submit say action is submit\n\n\t\t\t\t\tso if login is explicitly called we have the login action set (which is also our default action)\n\n\t\t\t\t\telse whatever action is it is set in $str.\t\t\t\t\n\n\t\t\t\t*/\n\n\t\t\t\t$str = $this->value('action');\n\n\t\t\t}else{\n\n\t\t\t\t$str = \"therapistEhsPlan\"; //default if no action is specified\n\n\t\t\t}\n\n\t\t\t$this->action = $str;\n\n\t\t\tif($this->get_checkLogin($this->action) == \"true\" ){\n\n\t\t\t\tif( isset($_SESSION['username']) && isset($_SESSION['password']) ){\n\n\t\t\t\t\tif(!$this->chk_login($_SESSION['username'],$_SESSION['password'])){\n\n\t\t\t\t\t\theader(\"location:index.php\");\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telse{\n\n\t\t\t\t\theader(\"location:index.php\");\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif($this->userAccess($str)){\n\n\t\t\t\t$str = $str.\"()\";\n\n\t\t\t\teval(\"\\$this->$str;\"); \n\n\t\t\t}\n\n\t\t\telse{\n\n\t\t\t\t$this->output =$this->config['error_message'];\n\n\t\t\t} \n\n\t\t\t$this->display();\n\n\t\t}", "public function __construct()\r\n {\r\n parent::__construct('login_form');\r\n $this->addLoginForm();\r\n }", "public function __construct($password);", "public function __construct()\r\n {\r\n parent::__construct();\r\n\r\n $this->sesion = Sesion::getInstance();\r\n // comprobar si hay una sesión activa\r\n if(!$this->sesion->checkActiveSession()):\r\n loginController::login();\r\n \r\n endif;\r\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('RaporModel');\n\t\t$this->check_login();\n\t}", "function __construct(){\n\t\t\tparent::__construct();\n\n\t\t\t$this->load->model('stud_login_model', 'login_model');\n\t\t}", "abstract protected function doLogin();", "public function __construct()\n {\n parent::__construct();\n cek_login();\n cek_admin();\n }", "public function __construct()\r\n\t{\r\n\t\t//require(BATH_PATH.'/view/login.php');\r\n\t}", "public function __construct() \r\n {\r\n \t$this->id = 0;\r\n\t\t$this->nombre = \"\";\r\n\t\t$this->clave = \"\";\r\n\t\t$this->privilegio = \"\";\r\n \t$this->con = new cConexion();\r\n\t\t$this->tabla = \"usuario\";\r\n\t\t//$this->con->Conectar();\r\n }", "function __construct () {\n\t\tif (!isset($_SESSION)) {\n\t\t\tsession_start();\n\t\t}\n\t\t$this->check_login();\n\t}", "public function __construct(){\r\n\r\n\t\t\t$typelist = array('login','do_login');\r\n\r\n\r\n\t\t\tif(empty($_SESSION['admin'])){\r\n\t\t\t\t//\r\n\t\t\t\tif(@!in_array($_GET['a'],$typelist)){\r\n\r\n\t\t\r\n\t\t\t\t\techo header('location:./index.php?m=index&a=login');\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\tif ($_SESSION['login']['check'] == FALSE) { redirect(base_url()); }\n\t}", "public function __construct() {\r\n parent::__construct();\r\n $this->load->model('login_model');\r\n }", "public function __construct() {\n session_start();\n $this->check_stored_login();\n }", "public function __construct() {\r\n\t\tif(!$this->isLoggedIn()) {\r\n\t\t\theader('location: ' . URL . 'authentication/index');\r\n\t\t\texit();\r\n\t\t}\r\n\t\t\r\n\t $this->loadModel($this->modelToLoad);\r\n\t $this->model->setAuth($_SESSION['ID'], $_SESSION['PASSWORD']);\r\n\t\t\r\n\t\tparent::__construct();\r\n\t}", "public function connexionAdminStructureLogin(){\n }", "public function __construct($login = null) {\n $this->initialize($login);\n }", "public function __construct(){\n\n\t\tparent:: __construct(); \n\n\t\t$this->load->database();\n\n\t\t$this->load->helper('url'); \n\n\t\t$this->load->model('m_rawat'); \n\n\t\t$this->load->model('m_login'); \n\n\t\t$this->load->library('session'); \n\n\t\tif(!$this->m_login->is_login()) redirect('login'); \n\n\t}", "public function login($name, $password);", "public function __construct()\r\r\n\t{\r\r\n\t\t$this->import('BackendUser', 'User');\r\r\n\t\tparent::__construct();\r\r\n\r\r\n\t\t$this->User->authenticate();\r\r\n\t}", "public function __construct($username, $password) {\n\t\t$this->login($username, $password);\n $this->checkUserId();\n $this->getProfile();\n\t}", "function __construct()\n\t{\n\t\t$testSession = (isset($_SESSION['boLogin']) && $_SESSION['boLogin'] == 'logged');\n\t\t$testLogin = boRequest::string('login') == LOGIN;\n\t\t$testPass = boRequest::string('pwd') == PASSWORD;\n\t\t$logOut = boRequest::bool('logout');\n\t\tif (!$testSession)\n\t\t{\n\t\t\tif ($testLogin && $testPass)\n\t\t\t{\n\t\t\t\t$_SESSION['boLogin']='logged';\n\t\t\t\t$_SESSION['boLevel']=20; // should be enough\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//TODO maybe test something else like users from a database\n\t\t\t\trequire(VIEWSPATH . 'login.php');\n\t\t\t\tdie();\n\t\t\t}\n\t\t}else if($logOut){\n\t\t\tunset($_SESSION['boLogin']);\n\t\t\tunset($_SESSION['boLevel']);\n\t\t\trequire(VIEWSPATH . 'login.php');\n\t\t\tdie();\n\t\t}\n\t}", "public function __construct () {\n\t\t\tif (isset($_COOKIE['username']) && isset($_COOKIE['remember_token'])) {\n\t\t\t\t$username = $_COOKIE['username'];\n\t\t\t\t$remember_token = $_COOKIE['remember_token'];\n\t\t\t\t$user = User::findByName($username);\n\t\t\t\tif ($user->remember_token == $remember_token) {\n\t\t\t\t\t$_SESSION['username'] = $username;\n\t\t\t\t\t$_SESSION['isLogged'] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (isset($_SESSION['isLogged']) && $_SESSION['isLogged'] == true) {\n\t\t\t\theader('Location: '.BASE_URL.'/index.php?controller=product&action=list');\n\t\t\t}\n\t\t\t// set view folder\n\t\t\t$this->folder = 'auth';\n\t\t}", "public function __construct(){\n throw new Exception(\"Cannot instantiate this class. Please use the static methods validateLogin() and logout() instead.\");\n }", "public function executeLogin()\n {\n }", "public function __construct()\n {\n parent::__construct();\n\n /** Comprobamos que tenga hecho el login */\n $url='entrar';\n $this->redirect = $this->input->server(\"REQUEST_URI\");\n if (($this->redirect != '/') && ($this->redirect != '')) {\n $url .= '?redirect='.$this->redirect;\n }\n\n if ($this->is_logged == false) {\n redirect(base_url($url));\n }\n }", "public function __construct($args){\r\n\t\t\t$this->userName= $args[0];\r\n\t\t\t$this->password= $args[1];\r\n\t\t\t$this->level= $args[2];\r\n\t\t\t$this->name= $args[3];\r\n\t\t\t$this->lastName= $args[4];\r\n\t\t\t$this->email= $args[5];\r\n\t\t\t$this->image= $args[6];\r\n\t\t\t$this->active= $args[7];\r\n\t\t\t$this->idUser= $args[8];\r\n\t\t\t//Variable de conexión\r\n\t\t\t$this->con= new csConexion();\r\n\t\t}", "public function login(){\n echo $this->name . ' logged in';\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\n\t\t//make sure that we are not yet logged in\n\t\tModules::run('login/is_not_logged_in');\n\t}", "function __construct($email,$password)\n\t\t{\n\t\t\tif ($this->password_hash_comp($email,$password)) \n\t\t\t{\n\t\t\t\tinclude 'dbms/dbms_imp.php';\n\t\t\t\t$query_run=$connection-> query(\"SELECT `uniqueid` FROM `userdetail` WHERE `emailid`='$email'\");\t\n\t\t\t\tmysqli_close($connection);\n\t\t\t\t$row=$query_run->fetch_array();\n\n\t\t\t\t$id=$row[0];\n\t\t\t\t$_SESSION['id']=$id;\n\t\t\t\t$GLOBALS[$id]=$_SESSION['id'];\n\n\t\t\t\t// redirect to userpage\n\t\t\t\t$current_file=$_SERVER['SCRIPT_NAME'];\n\t\t\t\theader('location: '.$current_file); \t//to redirect to current page\n\t\t\t\techo \"Logged in\";\n\t\t\t} \n\t\t\telse \n\t\t\t{\n\t\t\t\techo \"Email and password combination is not correct\";\n\t\t\t}\n\t\t\t\n\t\t}", "function __construct()\n\t{\n\t parent::__construct();\n\t if (!isset($_SESSION['usuario']))\n\t { \n\t \theader(\"Location: \".base_url().\"login\");\n\t }\n\t}", "public function __construct() {\n parent::__construct();\n if (!isset($_SESSION[\"login\"])) {\n redirect(HOSTURL);\n }\n }", "function __construct()\n {\n parent::__construct();\n\n if($this->value('action'))\n {\n\n /*\n\n This block of statement(s) are to handle all the actions supported by this Login class\n\n that is it could be the case that more then one action are handled by login\n\n for example at first the action is \"login\" then after submit say action is submit\n\n so if login is explicitly called we have the login action set (which is also our default action)\n\n else whatever action is it is set in $str.\n\n */\n\n $actionstr = $this->value('action');\n }\n else\n {\n\n $actionstr = \"notepad\"; //default if no action is specified\n }\n\n $this->action = $actionstr;\n\n if($this->get_checkLogin($this->action) == \"true\")\n {\n\n if(isset($_SESSION['username']) && isset($_SESSION['password']))\n {\n\n if(!$this->chk_login($_SESSION['username'], $_SESSION['password']))\n {\n\n header(\"location:index.php\");\n }\n }\n else\n {\n\n header(\"location:index.php\");\n }\n }\n\n if($this->userAccess($actionstr))\n {\n $actionstr = $actionstr . \"()\";\n eval(\"\\$this->$actionstr;\");\n }\n else\n {\n $this->output = $this->config['error_message'];\n }\n\n $this->display();\n }", "public function login(){\n \t\t//TODO redirect if user already logged in\n \t\t//TODO Seut up a form\n \t\t//TODO Try to log in\n \t\t//TODO Redirect\n \t\t//TODO Error message\n \t\t//TODO Set subview and load layout\n\n \t}", "public function __construct() {\n $this->model = new \\model\\LoginModel();\n $this->view = new \\view\\LoginView($this->model);\n $this->messages = new \\view\\MessageView();\n $this->autoLogin = new \\view\\CookieStorageView();\n }", "public function __construct()\r\n {\r\n parent::__construct();\r\n\t\t$this->load->model('login_model');\r\n\t\t$this->load->library('Password_encryption'); \r\n }", "function __construct()\n\t{\t\n\t\t$this ->user;\n\t\t$this ->needLogin = false;\n\t\t$this->categories = array();\n\t}", "public function __construct($_loginId = NULL,$_password = NULL,$_licenseKey = NULL,$_accountNumber = NULL)\n {\n parent::__construct(array('loginId'=>$_loginId,'password'=>$_password,'licenseKey'=>$_licenseKey,'accountNumber'=>$_accountNumber),false);\n }", "public function _login()\n\t{\n\t\tif ( ! is_object( $this->_login ) )\n\t\t{\n\t\t\t$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . 'sources/handlers/han_login.php', 'han_login' );\n\t\t\t$this->_login = new $classToLoad( $this->registry );\n\t \t$this->_login->init();\n\t\t}\n\t\t\n\t\treturn $this->_login;\n\t}", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->model('registration/M_siswa', 'siswa');\n\t\t$this->title = \"Login Dashboard | \"._namaSekolah();\n\t\tif ($this->session->userdata('is_login_in') == TRUE) {\n\t\t\tredirect('Member');\n\t\t}\n\t}", "public function connexionIntervenantLogin(){\n }", "public function __construct()\n {\n parent::__construct();\n $this->load->library('session');\n\t\t$this->load->helper('url');\n\t\t$this->load->Model('Login_Model');\n\n }", "public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->load->library('librari');\n\t\t$this->load->library('pagination');\n\t\t$this->load->library('form_validation');\n\n\t\tif (!$this->session->userdata('login')) {\n\t\t\tredirect('login');\n\t\t}\n\t}", "public function __construct()\n {\n parent::__construct();\n $this->load->model(\"login_model\");\n }", "public function getLogin();", "public function getLogin();", "public function getLogin();", "function __construct()\n {\n parent::__construct();\n if($this->value('action'))\n {\n /*\n This block of statement(s) are to handle all the actions supported by this Login class\n that is it could be the case that more then one action are handled by login\n for example at first the action is \"login\" then after submit say action is submit\n so if login is explicitly called we have the login action set (which is also our default action)\n else whatever action is it is set in $str.\n */\n $str = $this->value('action');\n }\n else\n {\n $str = \"patientdashboard\"; //default if no action is specified\n }\n\n $this->action = $str;\n\n if($this->get_checkLogin($this->action) == \"true\")\n {\n if(isset($_SESSION['username']) && isset($_SESSION['password']))\n {\n if(!$this->chk_login($_SESSION['username'], $_SESSION['password']))\n {\n header(\"location:index.php?action=patientlogin\");\n }\n }\n else\n {\n header(\"location:index.php\");\n }\n }\n\n if($this->userAccess($str))\n {\n // Code To Call Personalized GUI\n // $this->call_patient_gui();\n //$this->call_gui;\n $str = $str . \"()\";\n eval(\"\\$this->$str;\");\n }\n else\n {\n $this->output = $this->config['error_message'];\n }\n//$this->printR($this->userInfo());\n $this->display();\n /*\n $str = $str.\"()\";\n eval(\"\\$this->$str;\");\n $this->display();\n */\n }" ]
[ "0.8175606", "0.79748845", "0.7925571", "0.79131943", "0.783991", "0.78380173", "0.7837088", "0.7827169", "0.7826186", "0.77535915", "0.7724941", "0.7724941", "0.77187896", "0.7697178", "0.7697178", "0.7671428", "0.76630163", "0.7573856", "0.7518318", "0.7508757", "0.7459786", "0.74390894", "0.74295753", "0.7426233", "0.7411035", "0.7404563", "0.74023986", "0.74020255", "0.7391513", "0.736886", "0.7368521", "0.7354567", "0.7350138", "0.73498005", "0.73035663", "0.7293772", "0.7285994", "0.7268417", "0.72491634", "0.72445846", "0.72136676", "0.7207716", "0.7191355", "0.718329", "0.71680367", "0.7158281", "0.7156219", "0.71350425", "0.71292037", "0.7124456", "0.70949125", "0.7090064", "0.70885795", "0.7086884", "0.7085625", "0.70685834", "0.7064981", "0.7053787", "0.7052687", "0.70459807", "0.7039829", "0.7039238", "0.70132303", "0.70068717", "0.700629", "0.7002604", "0.69980675", "0.69977576", "0.69969296", "0.69938976", "0.6986684", "0.698599", "0.69783485", "0.6977355", "0.697587", "0.6974387", "0.6972081", "0.6966892", "0.6961205", "0.6957544", "0.69567597", "0.695553", "0.69523084", "0.6947943", "0.6943876", "0.6943751", "0.6943575", "0.6939824", "0.69336855", "0.69269335", "0.6920065", "0.69182783", "0.69169223", "0.69074947", "0.69023126", "0.6899327", "0.6899107", "0.6896549", "0.6896549", "0.6896549", "0.6894842" ]
0.0
-1
Template untuk memanggil view
private function _template($data, $view) { $this->load->view('view/' . $view, $data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function view(){\n\t\t$this->buildListing();\n\t}", "public function view() {\r\n\r\n\t}", "public function view()\n\t{\n\t\t// TODO Implement\t\n\t}", "function index()\n {\n //call some deafaults not to spoil template\n $data=$this->default_data();\n $this->template($data);\n\n }", "public function index()\n {\n \t$data=$this->data;\n \t$this->load->view('template',$data);\n \t\n }", "public function index()\r\n {\r\n $data = new stdClass();\r\n $data->materias = $this->Materia_model->get_all();\r\n $data->horario = $this->session->horario;\r\n\r\n $this->template('home/content', $data);\r\n }", "public function index(){\n $data['user'] = $this->Mahasiswa_model->getAll()->result(); //merupakan pengolahan data yang terdapat pada model\n $this->template->views('crud/home_mahasiswa', $data); //untuk menampilkan view home_mahasiswa \n }", "function index() {\n\n $this->view->render();\n\n }", "public function index()\n {\n\n\n $this->view->render();\n }", "public function index()\n\t{\n $this->view->render();\n\t}", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "public function view(){\n\n\t$this->registry->template->blog_heading = 'This is the blog heading';\n\t$this->registry->template->blog_content = 'This is the blog content';\n\t$this->registry->template->show('blog_view');\n}", "public function view(){\r\n\r\n\t$this->registry->template->blog_heading = 'This is the blog heading';\r\n\t$this->registry->template->blog_content = 'This is the blog content';\r\n\t$this->registry->template->show('blog_view');\r\n}", "public function index() {\n $this->view->title = 'Egyéb tartalom oldal';\n $this->view->description = 'Egyéb tartalom oldal description';\n\n\n $this->view->js_link[] = $this->make_link('js', ADMIN_JS, 'pages/content.js');\n\n $this->view->all_content = $this->content_model->all_content();\n\n $this->view->render('content/tpl_content');\n }", "public function index() {\r\n\t\t$data['materials']=$this->M_Materials->getAllMaterials();\r\n\t\t\r\n\t\t$data['_ADDRESS'] ='物料列表';\r\n\t\t$data['content'] ='baseinfo/material_home';\r\n\t\t$this->load->vars($data);\r\n\t\t$this->load->view('template');\t\t\r\n\t\t\r\n\t}", "public function index() {\n\n $template['main'] = $this->info->module_menu;\n $template['perm'] = $this->perm;\n $template['sub'] = $this->info->function_menu;\n $template['page'] = 'Banners/banners_view';\n $template['page_title'] = \"View Banners\";\n $template['page_data'] = $this->info;\n $template['data'] = $this->Banners_model->get_banners();\n $this->load->view('template',$template);\n }", "function index(){\n $alumnos=$this->model->get();\n $this->view->alumnos=$alumnos;\n $this->view->render('alumno/index');\n }", "public function listview() {\n\n $photo_list = Doctrine::getTable('Photo')->findAll();\n $data['photo_list'] = $photo_list;\n\n $data['view_name'] = \"photo_list_view\";\n $this->load->view(\"admin/common/template\", $data);\n }", "public function views()\n {\n }", "public function index()\n {\n $data['pageTitle'] = 'DATA MENIMBANG'; \n $data['menimbang'] = $this->Model_menimbang->get_menimbang()->result();\n $data['pageContent'] = $this->load->view('data_menimbang', $data, TRUE);\n\n $this->load->view('template/layout', $data);\n }", "public function views()\n {\n }", "public function views()\n {\n }", "public function pagelisteMembre(){\n \n $userModel = new User();\n $lisAllUser = $userModel->getAllUser(bdd::GetInstance());\n\n //Récupération du rôle du compte\n $role = UserController::roleNeed();\n $isConnected = 1;\n\n return $this->twig->render('Dashboard/listeMembre.html.twig',[\n 'allContact'=> $lisAllUser,\n 'role'=>$role,\n 'isConnected' => $isConnected\n ]);\n\n }", "public function view() {\n\t\treturn;\n\t}", "public function index(){\n\t\t$this->view->render($this,'index');\n\t}", "public function contuctUs()\n {\n return view('Front.page.contuctus');\n }", "protected function generateView() {\n \n $this->getViewData();\n $this->generatePageHeader(\"Kunde\");\n $this->generatePageBody();\n $this->generatePageFooter();\n }", "public function index() {\r\r\n $this->render('index', array('model' => $this->model));\r\r\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function content_template()\n {\n }", "public function indexAction() {\n \n $view = new ViewModel(); \n $view->setTemplate('templates/orion/generic.phtml');\n $view->setTerminal(true); \n\n return $view;\n \n \n }", "function index()\r\n\t{\r\n\t\t$this->view(); \r\n\t}", "public function view() {\n }", "public function index()\n {\n $this->title .= ' view';\n $this->vars = array_add($this->vars, 'menu', $this->rep->make());\n }", "public function indexAction() {\n// $model->setTemplate('layout/layout');\n// return $model;\n\n return new ViewModel(array(\n 'variable' => 'toto'\n ));\n }", "public function view()\n {\n //\n }", "function estudiantesMatriculados() {\n $this->view->estadoMatricula = $this->model->estadoMatricula();\n \n $this->view->render('header');\n $this->view->render('matricula/estudiantesMatriculados');\n $this->view->render('footer');\n }", "public function renderView()\n {\n //$_SESSION[\"info\"] zobrazuje vysledek operaci, paklize se nejake udaly\n if((isset($_SESSION[\"info\"])) && (!empty($_SESSION[\"info\"]))){\n $this->view_data[\"info\"] = $_SESSION[\"info\"];\n $_SESSION[\"info\"] = null;\n } \n\n //generuje csrf token pro formulare\n if (!isset($_SESSION[\"csrf_token\"])) {\n $_SESSION[\"csrf_token\"] = rand(1, 1e9);\n }\n \n if ($this->view)\n {\n $this->view_data[\"view\"] = $this->view;\n extract($this->view_data);\n $main_template = (dirname(__FILE__) .'/../view/@layout.phtml');\n \n if(file_exists($main_template))\n require_once($main_template); \n }\n }", "public function index()\n { \n \n $data['pageTitle'] = 'DATA PROVINSI'; \n $data['provinsi'] = $this->Model_provinsi->get_provinsi()->result();\n $data['pageContent'] = $this->load->view('data_provinsi', $data, TRUE);\n\n $this->load->view('template/layout', $data);\n\n }", "public function getViewTemplate();", "public function pagina(){\n\t\t\tinclude \"views/template.php\";\n\t\t}", "public function index() {\n // load mete data\n $metaData = array();\n $metaData['title'] = \"News\";\n $metaData['description'] = \"News\";\n $this->view->meta = $metaData;\n //$this->view->left_layout = \"left_view\";\n $this->view->newsList = $this->model->getNewsList();\n $this->view->Loadview('news', 'news');\n }", "public function singleView();", "function view() {\n\t\treturn '';\n\t}", "public function display(){\r\n\t\t$view = new View();\r\n\t\t$model = new Model();\r\n\t\t\r\n\t // Content-Template\r\n\t\tswitch($this->template){\r\n\t\t case 'eintrag' :\r\n\t\t\t\t//Formular mit allen Daten abgeschickt?\r\n\t\t\t if(isset($this->request['vorname']) &&\r\n\t\t\t\t isset($this->request['nachname']) &&\r\n\t\t\t\t isset($this->request['email']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$vorname = $this->request['vorname'];\r\n\t\t\t\t\t$nachname = $this->request['nachname'];\r\n\t\t\t\t\t$email = $this->request['email'];\r\n\t\r\n\t\t\t\t\t$vorname = htmlspecialchars($vorname);\r\n\t\t\t\t\t$nachname = htmlspecialchars($nachname);\r\n\t\t\t\t\t$email = htmlspecialchars($email);\r\n \t\r\n\t\t\t\t\t//Formular-Fehlerüberprüfung\r\n\t\t\t\t\t$form = new FormValidator(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\tnew FieldValidator(\"vorname\", $vorname),\r\n\t\t\t\t\t\t\tnew FieldValidator(\"nachname\", $nachname),\r\n\t\t\t\t\t\t\tnew FieldValidator(\"email\", $email, FieldType::Email)\r\n\t\t\t\t\t));\r\n\t\t\t\t // Kein Formulareingabe-Fehler\r\n\t\t\t\t\tif($form->isValid()) {\r\n\t\t\t\t\t\t//E-Mail-Adresse auf Übereinstimmung mit den vorhandenen Einträgen prüfen\r\n\t\t\t\t\t\t$emails = $model->getEmails();\r\n\t\t\t\t\t\t\t\t\t\t\t\tif (!in_array($email, $emails))\r\n\t\t\t\t\t\t{//falls E-Mail-Adresse noch nicht vorhanden --> Eintragung\r\n\t\t\t\t\t\t\t$erg = $model->insertEntry($vorname, $nachname, $email);\r\n\t\t\t\t\t\t\tif($erg == false)\r\n\t\t\t\t\t\t\t\t$this->error = $model->getError();\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\theader(\"Location:index.php\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//falls E-Mail-Adresse bereits vorhanden --> Fehlermeldung\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t $view->assign('fehler', \"Die E-Mail-Adresse ist bereits vorhanden! Die Eintragung war nicht erfolgreich.\");\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { // Formulareingabe-Fehler\r\n\t\t\t\t\t\t$view->assign('fehler', $form->getErrors());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$view->setTemplate('eintrag');\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 'email':\r\n\t\t\t\t//Formular abgeschickt?\r\n\t\t\t if(isset($this->request['betreff']) &&\r\n\t\t\t\t isset($this->request['nachricht']))\r\n\t\t\t\t{\r\n\t\t\t\t\t$betreff = $this->request['betreff'];\r\n\t\t\t\t\t$nachricht = $this->request['nachricht'];\r\n\t\r\n\t\t\t\t\t$betreff = htmlspecialchars($betreff);\r\n\t\t\t\t\t$betreff = utf8_encode($betreff);\r\n\t\t\t\t\t$nachricht = htmlspecialchars($nachricht);\r\n \t\r\n\t\t\t\t\t//Formular-Fehlerüberprüfung\r\n\t\t\t\t\t$form = new FormValidator(\r\n\t\t\t\t\t\tarray(\r\n\t\t\t\t\t\t\tnew FieldValidator(\"betreff\", $betreff),\r\n\t\t\t\t\t\t\tnew FieldValidator(\"nachricht\", $nachricht)\r\n\t\t\t\t\t));\r\n\t\t\t\t // Kein Formulareingabe-Fehler\r\n\t\t\t\t\tif($form->isValid()) {\r\n\t\t\t\t\t\t//E-Mail-Adressen aus der Datenbank auslesen\t\t\t\r\n\t\t\t\t\t\t$emails = $model->getEmails();\r\n\t\t\t\t\t\t//falls kein Ergebnis:\r\n\t\t\t\t\t\tif($emails == null)\r\n\t\t\t\t\t\t\t$this->error = $model->getError();\r\n\t\t\t\t\t\t//wenn E-Mail-Adressen vorliegen, Nachricht an alle Adressen senden\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tforeach($emails as $email)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t$header = 'MIME-Version: 1.0' . \"\\r\\n\";\r\n\t\t\t\t\t\t\t\t$header .= 'Content-type: text/plain; charset=utf8' . \"\\r\\n\";\r\n\t\t\t\t\t\t\t\tmail(\"$email\", \"$betreff\", \"$nachricht\", $header);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t//... und zurück zur Hauptansicht\r\n\t\t\t\t\t\t\theader(\"Location:index.php\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse { // Formulareingabe-Fehler\r\n\t\t\t\t\t\t$view->assign('fehler', $form->getErrors());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t$view->setTemplate('email');\r\n\t\t\t\tbreak;\r\n\t\t\t\t\r\n\t\t\tcase 'ansicht':\r\n\t\t\tdefault:\r\n\t\t\t\t$entries = $model->getEntries();\r\n\t\t\t\tif(!isset($entries)) // Fehler\r\n\t\t\t\t\t$this->error = $model->getError();\r\n\t\t\t\telse // Alles O.K.\r\n\t\t\t\t{\r\n\t\t\t\t\t$view->setTemplate('ansicht');\r\n\t\t\t\t\t$view->assign('entries', $entries);\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Rahmen-Template\r\n\t\t$this->view->setTemplate('frame'); //Rahmentemplate\r\n\t\t$this->view->assign('verteiler_title', 'Verteiler');\r\n\t\t$this->view->assign('verteiler_content', $view->loadTemplate());\r\n\t\t$this->view->assign('verteiler_footer', 'Ein Mail-Verteiler von und mit MVC');\r\n\t\treturn $this->view->loadTemplate();\r\n\t}", "private function viewCommon() {\n $m = $this->getViewModel();\n //$view->assets(['bootstrap','DateTime','SummerNote','links-edit']);\n\n $m->post = '/admin/link/post';\n $m->url = $this->url;\n $m->display = self::display();\n $m->urltypes = self::getUrlTypes();\n $id = $m->link->id ?? 'new';\n $m->title = 'Link#' . $id;\n return $this->render('links', 'edit');\n }", "public function tambah(){\n $this->template->views('crud/tambah_mahasiswa'); //untuk menampilkan view tambah_mahasiswa\n }", "function render(){\n $productos = $this->model->get();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }", "public function index()\n\t{\n\t\t$data = array();\n\t\t$data['title'] \t\t= $this->title;\n\t\t$data['activemenu'] \t= $this->activemenu;\n\t\t$data['consultant']\t= $this->consultants_model->db_select_conslt();\n\t\t$data['pagecontent'] \t= 'consultants/consultants';\n\t\t$this->load->view('common/holder', $data);\n\t}", "public function defaultView(){\n $this->view->render('index');\n }", "public function index(){\n\t $this->data['page_title'] = 'Danh sách thông tin đã đăng ký cho từng sự kiện';\n\t\t$user = $this->ion_auth->user()->row();\n $this->data['temp_register'] = $temp_register = $this->temp_register_model->get_by_user_id($user->id);\n\t\t$this->render('member/overview/list_overview_view');\n\t}", "public function index()\n {\n $data['row'] = $this->items_m->get();\n $this->template->load('template', 'product/item/item_data', $data);\n }", "protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }", "public function index()\n\t{\n\t\t$data['record'] = $this->m_operator->tampil_data();\n\t\t$this->template->load('template','operator/v_operator',$data);\n\t}", "function ParmsView() { \n $render = new AdminModel(); \n echo '<div class=\"container-fluid\">\n <div class=\"row\">\n <div class=\"col-md-1\"></div>\n <div class=\"col-md-4\">\n <h2>Administrators:\n <a href=\"'.DIR.'index.php?page=adminView&action=insertNewAdmin\"><i class=\"fa fa-plus-square\"></a></i>\n </h2><br>';\n \n $displayAdmins = $render->getAdmins();\n foreach ($displayAdmins as $admin) {\n echo '<div class=\"box\"><a href=\"'.DIR.'index.php/?page=adminView&action=adminDetails&id='.$admin['adminId'].'\">' .$admin['adminName'].'</a>, </br>'.\n '<img src=\"'.DIR.'upload/'.$admin['adminImage'].'\"/>'. $admin['adminPhone'] . '</br>'. $admin['adminRole'] . '</br>'. $admin['adminEmail'] .'</div></br>';\n };\n\n\t\techo '</div>\n <div class=\"col-md-5\">';\n }", "public function create()\n {\n $this->set_datas([]);\n $this->blade->view($this->get_view_page(), $this->get_datas());\n }", "function index()\n\t{\n\t\t$this->load->view('inc/header', $this->_data);\n\t\t$this->load->view('inc/column', $this->_data);\n\t\t$this->load->view($this->_template, $this->_data);\n\t\t$this->load->view('inc/footer', $this->_data);\n\t}", "function index()\n {\n $this->_view_edit('view');\n }", "public function index()\n {\n $data = [\n 'property' => [\n 'template' => 'extracurricular',\n 'title' => 'Ekstrakurikuler',\n 'menu' => $this->menu->read(),\n ],\n 'data' => $this->extracurricular->read(),\n ];\n\n $this->load->view('template', $data);\n }", "public function actionView()\n\t{\n\t\t$this->render('view');\n\t}", "public function index() {\n if ($this->session->has_userdata('user')) {\n $tipKorisnika = $this->session->userdata('user')['tip'];\n } else {\n $tipKorisnika = \"gost\";\n }\n //Iscitavanje obavestenja iz baze\n $data[\"middle_data\"] = [\"obavestenja\" => $this->ObavModel->dohvatiObavestenja($tipKorisnika)];\n $data[\"middle\"] = \"middle/obavestenje\";\n \n //Pozivanje viewTamplate sa obavestenjima kao podacima\n $this->load->view('viewTemplate', $data);\n }", "public function index()\n {\n //\n // get all the nerds\n $mun = Mun::where('type','international')->orderBy('id','desc')->get();\n\n // load the view and pass the nerds\n return View::make('admin.view_int_mun')\n ->with('mun', $mun);\n }", "public function actionView() {}", "public function actionView() {}", "public function index()\n {\n $post = $this->loadModel('post');\n $this->_view->posts = $post->getPosts();\n\n // de esta forma se pasan parámetros a la vista\n $this->_view->titulo = 'Hola - '.APP_NAME;\n\n // llamamos al metodo renderizar para mostrar la vista\n $this->_view->renderizar('hola','hola');\n }", "public function index()\n {\n return view('backend.matkul.index',[\n \"title\" => \"matkul\",\n \"matkul\" => MatkulModel::all(),\n \"user\" => User::all(),\n \"prodi\" => ProdiModel::all()\n ]);\n }", "function index() {\n \n $this->view->set('textData', $this->model->textData());\n\t\t$this->view->render('index/index');\n\t}", "function index(){\n\t\t$this->template->run();\n\t}", "function index() {\n $template = $this->loadView(\"home/index\");\n $template->set('name', 'Jonh Doe');\n $template->render();\n }", "public function index()\n\t{\n\t\t/* mengisi $data['getData'] berupa data yang \n\t\tterlah direturn pada fungsi getData() pada Penulis_m */\n\t\t$data['getData'] = $this->Member_m->getData();\n\t\t// memanggil view 'penulis/penulis.php' dan diberi variable $data\n\t\t$this->load->view('Member/member.php',$data);\n\t}", "public function indexAction()\n {\n $this->_model->rec = $this->_db->getRec();\n $content = $this->_model->render(STUD_DEFAULT_FILE);\n $this->_templete->content = $content;\n $output = $this->_templete->render(LAYOUT_FILE);\n $this->_fc->setBody($output);\n }", "public function index(){\n $this->set('title_for_layout', 'О компании');\n $About = ClassRegistry::init('About');\n $about = $About->getAbout();\n $this->set('data',$about);\n }", "public function view() {\n $this->view->data['view'] = 'hehe';\n /*** load the index template ***/\n $this->view->show('index/view');\n }", "public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }", "public function getView() {}", "public function getView() {}", "public function indexMembre()\n {\n $articles = Article::simplePaginate(5);\n return view('article', compact('articles'));\n }", "function index()\n {\n $data['pages']=array('contact');\n $data['title']=\"Contact\";\n $data['headerTitle']=\"Contact\";\n $data['headerSubtitle']=\"Send us a message\";\n\n //Dohvatanje pozadinske slike iz baze podataka\n $this->load->model('Menu');\n $this->Menu->label='contact';\n $data['picture']=$this->Menu->getBacground();\n\n //Prosledjivanje metodu u natklasi\n $this->load_views($data);\n }", "protected function viewAction()\n {\n }", "Public Function ChamaView(){\n $params = array();\n echo ($this->gen_redirect_and_form(BaseController::ReturnView(BaseController::getPath(), get_class($this)), $params));\n }", "Public Function ChamaView(){\n $params = array();\n echo ($this->gen_redirect_and_form(BaseController::ReturnView(BaseController::getPath(), get_class($this)), $params));\n }", "public function index(){ \n $this->view->types = $this->_massage_type->getAll();\n $this->view->render(\"service/index\");\n }", "public function index()\n {\n \t$mahasiswas = \\App\\Mahasiswa::all(); // mengambil semua data mahasiswa\n\n \treturn view('crud.mahasiswa.view', compact('mahasiswas')); // melempar data ke view\n }", "protected function getViewData() {\n\n }", "public function createView();", "public function generateView()\n {\n foreach ($this->cds as $cd)\n {\n $view = new View('CdItem');\n $view->setValue('TITLE', $cd->getTitle());\n $view->setValue('ARTIST', $cd->getArtist());\n $view->setValue('GENRE', $cd->getGenre());\n $view->setValue('CREATION_YEAR', $cd->getCreationYear());\n $view->display();\n }\n }", "abstract protected function renderView();", "public function index()\n {\n $data['pageTitle'] = 'Promo';\n $data['promo'] = $this->model_promo->get_where(array('mitra' => $this->session->userdata('id')))->result();\n $data['pageContent'] = $this->load->view('promo/promoList', $data, TRUE);\n\n // Jalankan view template/layout\n $this->load->view('template/layout', $data);\n }", "public function indexAction() {\n\t\t $this->view->form = $form;\n\t}", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }", "protected function content_template()\n {\n }" ]
[ "0.7077953", "0.6921887", "0.689397", "0.6887042", "0.6821142", "0.6781073", "0.6745812", "0.6717446", "0.6700678", "0.6674981", "0.6673555", "0.6673555", "0.6637804", "0.6594652", "0.658458", "0.6551606", "0.65441585", "0.6537521", "0.6536385", "0.65351367", "0.6534413", "0.6534413", "0.65275824", "0.65228087", "0.6521052", "0.6515476", "0.65140164", "0.65113866", "0.6497461", "0.6497461", "0.6497461", "0.6497461", "0.6497461", "0.6497461", "0.6497461", "0.6497461", "0.6497461", "0.6497461", "0.6490299", "0.6488535", "0.6481714", "0.64712405", "0.64685774", "0.6458674", "0.6457719", "0.6456726", "0.64563847", "0.6453365", "0.6439161", "0.643167", "0.6427123", "0.6424938", "0.6424151", "0.6423177", "0.64194566", "0.6402874", "0.6401186", "0.6398974", "0.63891166", "0.6376663", "0.6373045", "0.63727665", "0.6370353", "0.6365277", "0.6364468", "0.6361352", "0.6360872", "0.63607776", "0.6360324", "0.63602495", "0.63601434", "0.63601434", "0.63560754", "0.63525414", "0.6343695", "0.6337409", "0.63367087", "0.63355917", "0.6326332", "0.632619", "0.632437", "0.63220066", "0.6320351", "0.6320351", "0.63127023", "0.63125074", "0.63029665", "0.63020027", "0.63020027", "0.63017", "0.62982696", "0.629811", "0.629692", "0.6289251", "0.62877476", "0.628684", "0.6286481", "0.62795347", "0.62795347", "0.62795347", "0.62795347" ]
0.0
-1
Menampilkan halaman index photo
public function index() { if($this->tokenSession != $this->tokenServer){ _unlogin(); } else { $data['title'] = "Dashboard | FaceVoting Versi 1.0"; $data['dataPhoto']= $this->admin->get_data_photo()->result_array(); $view ='v_photo'; $this->_template($data,$view); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function do_index() {\n $this->vars['title'] = \"Fotos\";\n \n $sql = 'SELECT COUNT(*) FROM photos';\n $count = $this->photo->count($sql);\n \n $page = $this->paginate(PHOTO_PAGE_SIZE, $count, '/photo/index');\n \n $sql = 'SELECT p.created as p_created, p.id AS p_id, u.id AS u_id, t.title AS topic, t.*, u.*, p.* '\n . 'FROM photos p ' \n . 'LEFT JOIN users u ON p.von = u.id '\n . 'LEFT JOIN topics t ON p.topic_id = t.id '\n . 'ORDER BY p.created DESC LIMIT ' . (($page-1)*PHOTO_PAGE_SIZE) . ',' . PHOTO_PAGE_SIZE;\n\n $this->vars['photos'] = $this->photo->query($sql);\n $this->render();\n }", "public function photoIndex()\n {\n return redirect(PREFIX . '/multicms/pages/gallery');\n }", "public function index()\n {\n $this->render('photo');\n }", "public function index()\n {\n //\n $cat = DB::table('products')->select(\n 'products.*',\n 'products.id as id_p',\n 'products.created_at as create',\n 'sub_categories.*'\n )\n ->leftjoin('sub_categories', 'sub_categories.id', 'products.pro_category')\n ->get();\n\n\n $data['objs'] = $cat;\n $data['datahead'] = \"สินค้าทั้งหมด\";\n\n return view('admin.photo.index', $data);\n }", "public function index()\n {\n Template::set('photo_gallery', $this->photo_gallery_model->order_by('weight')->where(['status'=>0])->find_all());\n\n Template::render();\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $photos = $em->getRepository('BoAdminBundle:Photos')->findAll();\n\n return $this->render('photos/index.html.twig', array(\n 'photos' => $photos,\n ));\n }", "public function index()\n {\n $photo = Photo::with('category')->get();\n return view('backend.photo.index', get_defined_vars());\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $photos = $em->getRepository('AppBundle:Photo')->findAll();\n\n return $this->render('photo/index.html.twig', array(\n 'photos' => $photos,\n ));\n }", "public function index()\n {\n \n // $photos = $this->repository->about();\n\n // return view('photo.index', compact('photos'));\n }", "public function index() {\n $images = Gallery::all();\n // $images = Gallery::all();\n require_once('views/gallery/index.php');\n }", "public function index()\n {\n return response()->view('admin.photos.index');\n }", "public function index()\r\n\t{\t$dokumentasi =$this->Dokumentasi_model->home();\t\r\n\t\t$data= array(\t'title'\t\t\t =>'gallery'\r\n\t\t\t\t\t\t'gallery'\t\t => $gallery,\r\n\t\t\t\t\t\t'isi' =>'home/list/galery'\r\n\t\t );\r\n\t\t$this-> load->view('layout/wrapper',$data,FALSE);\r\n\t}", "public function index()\n {\n return Photo::get();\n }", "public function actionIndex()\n {\n $searchModel = new PhotoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function index(){\n\n\t\t$data['base'] = base_url();\n\t\t$data ['error'] = 'No se pudo realizar su petision';\n\t \t// Obtenerel segmento de la url\n\t\t$this->load->view('header', array ('pagina' => 'Albums'));\n\n\n\t \t\t// obtener todos los albums\n\t\t$data['Albums'] = $this->album_model->imgAlbum();\n\n\t\t$this->load->view('Album/index', $data);\n\t\t$this->load->view('footer.php');\n\t}", "public function index()\n {\n\n // $images=Image::orderBy('id','desc')->get();//no hago una instancia porqe con gracias a el ORM del modelo Image no es necesario orderBy echa por laravel get() para q me muestre los datos\n //$images=Image::all();//lo mismo pero no me lo ordenaria como yo quiero\n $images=Image::orderBy('id','desc')->paginate(5);//PGINACION MAGICA CON LARAVEL\n return view('home',[\n 'images'=>$images\n ]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('HamdiMediaBundle:GalleryImage')->findAll();\n\n return $this->render('HamdiMediaBundle:GalleryImage:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function index()\n {\n $photos = Photo::all();\n\n return view('backEnd.photos.index', compact('photos'));\n }", "public function index()\n {\n $items = PhotoGallary::all();\n $siteconf = SiteConfig::first();\n return view('admin.photoGallary.index',compact('items','siteconf'));\n }", "public function index()\n {\n //\n// return Redirect::route('image.indexAdmin');\n if (Auth::user()->hasAccess('image.deletePermanent') || Auth::user()->hasAccess('image.restore'))\n return $this->indexAdmin();\n\n $images = Image::all();\n\n\n return view('image.index', compact('images'));\n }", "public function index()\n {\n $images = Image::where('active','=','yes')->orderBy('id')->with('laptop')->get();\n return view('admin/image/index', compact('images'));\n }", "function index()\n {\n $data['gallery'] = $this->Gallery_model->get_all_gallery();\n \n $data['_view'] = 'gallery/index';\n $this->load->view('layouts/main',$data);\n }", "public function index()\n {\n $photos = Photo::latest()->paginate(10);\n return view('backend.photos.index', compact('photos'));\n }", "public function index()\n {\n $data=Image::all();\n return view('backend.images.index', compact('data'));\n }", "public function listview() {\n\n $photo_list = Doctrine::getTable('Photo')->findAll();\n $data['photo_list'] = $photo_list;\n\n $data['view_name'] = \"photo_list_view\";\n $this->load->view(\"admin/common/template\", $data);\n }", "public function index()\n {\n return view('admin.images.index', ['images' => Image::all()]);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $imagens = $em->getRepository('SitioBundle:Imagen')->findAll();\n\n return $this->render('imagen/index.html.twig', array(\n 'imagens' => $imagens,\n ));\n }", "public function view_photos($args)\n {\n $this->registry->template->Title = \"HiiFan News Portal :: Admin Home Page : View Photos\";\n $photoListArray = $this->registry->model->run(\"getAllPhotoList\", $args);\n $this->registry->template->PresentPage = $args['start_page'];\n $this->registry->template->PhotoListArray = $photoListArray;\n $this->registry->template->show(\"view_photos\");\n }", "public function actionImageListing()\n {\n \t ob_start();\n \t Yii::app()->theme='back';\n \t $model=new HomeImages;\n \n $rec= HomeImages::model()->findAll(); \n \t $this->render('imagelisting',array('model'=>$model,'list'=>$rec));\n }", "public function index()\n {\n $images = Image::with('album')->paginate(10);\n return view('image.index')->with(['images' => $images]);\n }", "public function show_column_photos(){\n $sql=\"SELECT * FROM photos WHERE img_navigacija_id=3\";\n $result=self::$connect->query($sql);\n $rows=array();\n while($row=$result->fetch(PDO::FETCH_ASSOC)){\n $rows[]=$row;\n $this->name=array_column($rows, 'name');\n $this->id=array_column($rows, 'id');\n }\n\n }", "function home(){\n\n $this->view(\"home_index\",[\"page\"=>\"list_image\",\n \"hinhanh\"=>$this->doituong->getAllImage(),\n \"listroom\"=>$this->home1->getListRoom()]);\n }", "public function index()\n {\n //\n $photos = Note::all();\n\t\t\n return View::make('photos.index')\n ->with('photos', $photos);\n }", "public function get_index()\n\t{\n\t\t$this->layout->nest('content', 'directus::media.index');\n\t}", "public function index($id)\n {\n $realestate_id=$id;\n $images=Gallery::where('realestate_id',$id)->get();\n return view('admin.realestate.photo',compact('realestate_id','images'));\n }", "public function indexAction(){\n\t\t\t$this->library->load('upload');\n\n\t\t\t//Goi den phuong thuc upload\n\t\t\t$this->library->upload->upload();\n\t\t}", "function logo ()\n {\n global $connection;\n $sql = \"SELECT * FROM slike_logo sl ORDER BY sl.putanja_logo DESC LIMIT 0,1\";\n $sum = $connection->query($sql)->fetchAll();\n foreach($sum as $item) :\n echo \"<a href='index.php?page=pocetna'><img src=$item->putanja_logo alt=$item->ime_slike title='NanoSoft DeLux' width='177' height='106'/></a>\";\n endforeach;\n }", "public function index()\n {\n return view('services.underwaterphoto', ['underwaterphoto' => underwaterphoto::all()]);\n\n }", "public function index()\n {\n //\n if(!\\Auth::user()->can('read_gallery'))\n {\n abort('403', 'Hak Akses Tidak Diijinkan');\n }\n $gallery = new Gallery();\n $categorigallery = New GalleryCategory();\n // abort_if(empty($request['position']), 404);\n\n $datagallery = $gallery->search()->paginate(config('app.setting.backend.no_of_records'));\n $rank = $datagallery->firstItem();\n\n $getcategory = $categorigallery->select('id','categoryname')->get();\n\n return view('admin::gallery.gallery.index', compact('datagallery','rank', 'getcategory'));\n }", "function company_photos()\n\t\t{\n\t\t\t$type = $this->uri->segment(5);\n\t\t\t$data = $this->photo->company_photos();\n\t\t\t$this->directPageDetails(\"gallery_company/list_photo_company\",\"\",$data);\n\t\t}", "public function index()\n {\n $images = image::orderBy('id','ASC')->paginate(8);\n $articles = article::get();\n return view('admin.images.index')->with('images',$images)->with('articles',$articles);\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Gallery::find(),\n ]);\n\n return $this->render('index', compact('dataProvider'));\n }", "public function index()\n\t{\n\t\tif(Auth::user()){\n\t\t\t\n\t\t\t$photos = Photo::all();\n\n\t\t\treturn View::make('photos.index')->with(array('photos' => $photos));\n\n\t\t}\n\t\n\t\t\n\t}", "public function indexAction() {\n $viewer = Engine_Api::_()->user()->getViewer();\n if (!$viewer || !$viewer->getIdentity()) {\n return $this->setNoRender();\n }\n\n // Must be able to create albums\n if (!Engine_Api::_()->authorization()->isAllowed('album', $viewer, 'create')) {\n return $this->setNoRender();\n }\n\n $this->view->upload_button = $this->_getParam('upload_button', 0);\n $this->view->upload_button_title = $this->_getParam('upload_button_title', 'Add New Photos');\n }", "public function index()\n {\n $this->data['pageHead'] = \"All Gallery Photos\";\n if ( $this->permission(4) ) {\n $this->data['asUsualData'] = $this->asUsualData();\n $this->data['dashboardData'] = $this->dashboardData();\n $this->data['classes'] = CourseClass::arrOfClassName();\n $this->data['permission'] = $this->permission(4);\n return view('admin.gallery.gallery', $this->data);\n }else{\n return view('admin.gallery.gallery', $this->data);\n }\n }", "public function index()\n {\n\t\t\n\t\t\n\t\t\n\t\t$data['allCat'] = $this->gallery_model->galleryCategory();\n\t\t$data['allItem'] = $this->gallery_model->galleryAllItems();\n\t\t\n $data['title'] = 'Gallery | Birjuflower Store';\n\t\t$data['layout'] = 'gallery';\n\t\t$this->load->view('layout',$data);\n \n \n }", "public function view_banner_photos($args)\n {\n $this->registry->template->Title = \"HiiFan News Portal :: Admin Home Page : View Banner Photos\";\n $bannerPhotoListArray = $this->registry->model->run(\"getAllBannerPhotoList\", $args);\n $this->registry->template->PresentPage = $args['start_page'];\n $this->registry->template->BannerPhotoListArray = $bannerPhotoListArray;\n $this->registry->template->show(\"view_banner_photos\");\n }", "public function index()\n {\n $images = Image::latest()->paginate(10);\n $tour = Tour::where(['is_active' => 1])->orderBy('id', 'desc')->get();\n $category = Category::where(['is_active' => 1])->orderBy('id', 'desc')->get();\n\n return view('admin.image.index', [\n 'data' => $images,\n 'tour' => $tour,\n 'category' => $category\n ]);\n }", "public function actionIndex()\n {\n try {\n $model = new Upload();\n $info = $model->upImage();\n\n\n $info && is_array($info) ?\n exit(Json::htmlEncode($info)) :\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => 'error'\n ]));\n\n\n } catch (\\Exception $e) {\n exit(Json::htmlEncode([\n 'code' => 1,\n 'msg' => $e->getMessage()\n ]));\n }\n }", "public function index()\n {\n $images = Image::with('product:id,name')->paginate(config('app.records_per_page')); \n\n return view('admin.images.index', compact('images'));\n }", "public function view_images()\n {\n $data['images'] = $this->Image_model->get_images();\n $this->load->view('student/index', $data);\n }", "public function index()\n {\n return view('admin.images.index', [\n 'menu' => $this->menu\n ]);\n }", "public function index()\n {\n $imagenList = Imagen::all();\n return view('imagen.index', ['imagenList'=>$imagenList]);\n }", "public function index()\n {\n $photos = photo::orderBy('created_at', 'desc')->paginate(12);\n\n return view('photos.index', compact('photos'));\n }", "public function indexAction()\n {\n $f = new phpFlickr(\"a8785d392cb67796e36a9e78030423d2\", \"06cb90bace15bda0\", true);\n\n // get total count of photo in album\n $totalPhoto = Emotion::getTotalCountPhoto($f);\n //get count page\n $totalPage = Emotion::getCountPage($totalPhoto);\n //loop for all page in album\n $i = 0;\n $photoList = array();\n while($i < $totalPage) {\n array_push($photoList, Emotion::getPhotoList($f));\n $i++;\n }\n //set array with list of photo\n $photoList = $photoList[0];\n // get url list of photo\n $urlListArray = Emotion::getUrlList();\n //loop for get list url\n $urlList = array();\n $i = 0;\n while ($i < count($urlListArray)) {\n $urlList[$i] = $urlListArray[$i]['img_url'];\n $i++;\n }\n // set url adn emotion to database and check availability\n $urls = Emotion::setUrlList($photoList, $urlList);\n // get list of url photo and emotion for view\n $emotionUrlList = Emotion::getEmotionUrlList();\n $vars = $emotionUrlList;\n $this->view->render('INT20H EMOTION | Main', $vars);\n return true;\n }", "function index() {\n $konten['tabel'] = DB_GALERI;\n $konten['kolom'] = array(\"Kode\", \"Judul Photo\", \"Photo\", \"Album\", \"Status\", \"Tanggal\", \"\");\n $konten['breadcum'] = 'Galeri/Album';\n $konten['smenu'] = 'media';\n $konten['sbmenu'] = 'galeri';\n $konten['css'] = 'galeri/css';\n $konten['js'] = 'galeri/js';\n $konten['header'] = 'included/header';\n $konten['footer'] = 'included/footer';\n $konten['target'] = 'galeri/index';\n /*\n * Memanggil role untuk menu aktif\n */\n $konten['menuinfo'] = $this->libglobal->getMenuID($this->uri->uri_string, $_SESSION['role_id'], 'ad_menu_admin');\n $this->load->view('default_admin', $konten);\n }", "public function actionIndex($alias = '')\n {\n\t\t$photo = Photo::find()\n\t\t\t\t->with('seo')\n\t\t\t\t->with('thumb')\n\t\t\t\t->with('files')\n\t\t\t\t->where(['status' => 1, 'alias' => $alias])\n\t\t\t\t->one();\n\t\t\n\t\tif ($photo) {\n\t\t\n $this->view->title = $photo->title;\n\t\t\t\n\t\t\t/******************** SEO ************************/\n\t\t\tif($photo->seo)\n\t\t\t{\n\t\t\t\tif (!empty($photo->seo->meta_title))\n\t\t\t\t{\n\t\t\t\t\t$this->view->title = $photo->seo->meta_title;\n\t\t\t\t}\n\n\t\t\t\tif (!empty($photo->seo->meta_desc))\n\t\t\t\t{\n\t\t\t\t\t$this->view->params['meta_description'] = $photo->seo->meta_desc;\n\t\t\t\t}\n\n\t\t\t\tif (!empty($photo->seo->meta_key))\n\t\t\t\t{\n\t\t\t\t\t$this->view->params['meta_keywords'] = $photo->seo->meta_key;\n\t\t\t\t}\n\t\t\t}\n\t\t\t/******************** /SEO ***********************/\n\t\t\t\n\t\t\treturn $this->render('/photo', ['photo' => $photo]);\n\t\t\t\n } else {\n throw new NotFoundHttpException('404 Страница не найдена.');\n }\n }", "public function index()\n {\n // $user_id = auth()->user()->id;\n // $permissions = $this->getPermissions($user_id);\n // $drivers = DriverInformationController::getListDrivers();\n // $type_images = Imagenes::enum_assoc_tipo_doc;\n // $company_id = auth()->user()->company_id;\n // $company = CompanyController::getCompanyByid($company_id);\n\n // return view('admin.images', [\n // 'list_drivers' => $drivers,\n // 'type_images' => $type_images,\n // 'company_name' => ucwords(strtolower($company->company)),\n // 'permissions' => $permissions,\n // ]);\n }", "public function index() \n {\n\t\t$this->papar->senaraiPegawai['biodata'] = $this->tanya->cariMedan('nama_pegawai', \n\t\t\t'namaPegawai,Nama_Penuh,email,nohp,unit', \n\t\t\tarray('medan'=>'unit', 'id'=>'ekonomi'));\n\t\n\t\t//\n\t\t$this->papar->ralat = null;\n\t\t\n\t\t$this->papar->pegawai = senarai_kakitangan();\n $this->papar->baca($this->_folder . '/index', 0);\n }", "public function index()\n {\n $image = Image::all();\n return $this->showAll($image);\n }", "public function index()\n {\n return view('dashboard.gallery.index')->with('galles',Gallery::get());\n }", "public function index()\n\t{\n\t\t$galeri = Gallery::orderBy('id','desc')->paginate(5);\n\t\treturn view('blog.admin.galeri')->with('gallery',$galeri);\n\t}", "public function index()\n {\n\n $galleries = Image::all();\n $data['images']=Image::all();\n return view(\"admin.gallery.gallery\",$data, compact('galleries'));\n// return view(\"gallery\");\n }", "public function picture() {\n $picture = $this->_model->getPicture(explode(\"/\", $this->_url)[1]);\n if ($picture === null) {\n $this->redirect(\"/index\");\n }\n $this->render(\"General.Picture\", compact('picture'));\n }", "public function getIndex() {\n\t\t// Title\n\t\t$title = Lang::get('admin/galleryimages/title.gallery_management');\n\n\t\t// Gallery category\n\t\t$galleries = Gallery::all();\n\n\t\t$options = array();\n\n\t\t$options[0] = Lang::get('admin/galleryimages/title.gallery_choose');\n\n\t\tforeach ($galleries as $gallery) {\n\t\t\t$options[$gallery -> id] = $gallery -> title;\n\t\t}\n\n\t\t// Show the page\n\t\treturn View::make('admin/galleryimages/index', compact('options', 'galleries', 'title'));\n\t}", "public function browseAction(){\n\n\t\t$modelStatic = new Application_Model_Static();\n\n\t\t$images = $modelStatic->getMedia();\n \n\t\t$this->view->images = $images;\n \t\t\n\t\t$this->_helper->layout->setLayout('media');\n\t\t//$this->_helper->layout->disableLayout(0);\n\t\t$this->_helper->viewRenderer->setNoRender(true);\n\t\t\n \t}", "public function index()\n {\n $photos = Slider::orderBy('id','DESC')->get();\n \n return view('admin.slider.index', compact('photos'));\n }", "public function index()\n\t{\n\t\t$images = Image::where('product', '=', 0)->get();\n\t\treturn view('galleries.index', compact('images'));\n\t}", "public function index()\n {\n $manga = DB::table('manga')\n ->select('manga.id', 'manga.name', 'manga.status', 'manga.visits', 'images.name as image_name')\n ->leftJoin('images', 'images.entity_id', '=', 'manga.id')\n ->paginate(15);\n\n return view('admin.manga.index', compact('manga'));\n }", "public function index()\n\t{\n\t\tdd('Day la trang danh sach');\n\t\t// return Images::all()->toJson();\n\t\t// var_dump($images);\n\t}", "public function index()\n {\n $id = Auth::id();\n $photo = photo::whereuser_id($id)->first();\n if(is_null($photo))\n {\n return view('home');\n }\n else\n {\n $photo_name = $photo->photo;\n $photo_id = $photo->id;\n //dd($photo_name);\n $photo_url = Storage::disk('dropbox')\n ->getDriver() // `\\League\\Flysystem\\Flysystem` instance\n ->getAdapter() // `\\Spatie\\FlysystemDropbox\\DropboxAdapter` instance\n ->getClient() // `\\Spatie\\Dropbox\\Client` instance\n ->getTemporaryLink('Apps/Demo1610/'.$photo_name);\n //dd($photo_url);\n return view('home',compact('photo_url','photo_id'));\n //return view('home');\n }\n\n }", "public function actionIndex(){\r\n $q = Yii::app()->request->getParam('q'); \r\n $path = Picture::getBasePath();//.DIRECTORY_SEPARATOR.'article';\r\n if ($q) $path .= DIRECTORY_SEPARATOR.$q;\r\n \r\n if (isset($_FILES) && isset($_FILES['newimage'])){\r\n move_uploaded_file($_FILES['newimage']['tmp_name'], $path.DIRECTORY_SEPARATOR.$_FILES['newimage']['name']);\r\n }\r\n \r\n $parent = '';\r\n if ($q != ''){\r\n $qsplit = explode('/', $q);\r\n unset($qsplit[count($qsplit)-1]);\r\n $parent = implode('/', $qsplit);\r\n }\r\n \r\n $dirs = $files = $images = array();\r\n \r\n $objects = scandir($path);\r\n //print_r($objects); exit;\r\n\r\n foreach ($objects as $obj){\r\n $type = filetype($path.'/'.$obj);\r\n if ($type == 'dir'){\r\n $dirs[] = $obj;\r\n } elseif ($type == 'file') {\r\n $ext = strtolower(pathinfo($path.'/'.$obj, PATHINFO_EXTENSION));\r\n if (in_array($ext, array('jpeg', 'png', 'gif', 'jpg', 'bmp'))){\r\n $images[] = $obj;\r\n } else {\r\n $files[] = $obj;\r\n }\r\n }\r\n }\r\n \r\n $this->renderPartial('_catalog', array(\r\n 'path' => $path,\r\n 'dirs' => $dirs,\r\n 'images' => $images,\r\n 'files' => $files,\r\n 'q' => $q,\r\n 'parent' => $parent,\r\n ));\r\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "public function index(){\n\t\tview('upload/index');\n\t}", "public function action_index()\n {\n $this->template->content = $content = View::factory('admin/media/index');\n\n $media = ORM::factory('Media');\n\n $content->media = $media->find_all()->as_array();\n }", "public function actionIndex()\n {\n if (Yii::$app->user->can('imageindex')) {\n $per_page = 19;\n if (Yii::$app->request->isAjax) {\n $model = new AlbumModel;\n $param = Yii::$app->request->getQueryParams();\n $key = isset($param[\"FormSearch\"]['keyword']) ? $param[\"FormSearch\"]['keyword'] : null;\n $page = $param['page'];\n $position = ($page * $per_page);\n if ((isset($param['albumid']) && $param['albumid'] != 0) && $key == null) {\n $data = $model->getImageByAlbumId($param['albumid'], $per_page, $position);\n echo Json::encode([\n 'data' => $data,\n 'page' => ($page + 1)\n ]);\n } else {\n $data = $model->getAllImages($per_page, $position, $key);\n echo Json::encode([\n 'data' => $data,\n 'page' => ($page + 1)\n ]);\n }\n } else {\n\n $model = new AlbumModel;\n $searchModel = new FormSearch;\n $param = Yii::$app->request->getQueryParams();\n $key = isset($param[\"FormSearch\"]['keyword']) ? $param[\"FormSearch\"]['keyword'] : null;\n\n if ((isset($param['albumid']) && $param['albumid'] != 0) && $key == null) {\n $data = $model->getImageByAlbumId($param['albumid'], $per_page, 0);\n $image = new ImageModel;\n return $this->render('index', [\n 'model' => $data,\n 'albumid' => $param['albumid'],\n 'album' => $model->getAllAlbums(),\n 'album_name' => $model->getAlbumNameById($param['albumid']),\n 'searchModel' => $searchModel,\n 'keyword' => $key,\n 'image' => $image\n ]);\n } else {\n $image = new ImageModel;\n $data = $model->getAllImages($per_page, 0, $key);\n return $this->render('index', [\n 'model' => $data,\n 'albumid' => 0,\n 'album' => $model->getAllAlbums(),\n 'searchModel' => $searchModel,\n 'keyword' => $key,\n 'image' => $image\n ]);\n }\n }\n } else {\n throw new HttpException(403, 'You are not allowed to access this page', 0);\n }\n }", "public function show(){\n\t\t$data['segmento'] = $this->uri->segment(3);\n\t\t\t$data['imgs'] = $this->album_model->fotosAlbum($data['segmento'])->result();\n \n\t\t\t$data['Albums'] = $this->album_model->obtenerAlbum($data['segmento']);\n\n\t\tif ($data['Albums']!= null) {\n\t\t\t$this->load->view('header', array ('pagina' => 'Album'));\n\t\t\t$this->load->view('Upload/upload_form', $data);\n\t\t\t$this->load->view('Album/mostrar',$data);\n\t\t\t$this->load->view('footer.php');\n\n\t\t}else{\n\t\t\t$this->load->view('404');\t \t\n\t\t}\n\t}", "public function index(){\n //获取语言\n $lang = LANG;\n $data = M('Website_index_images')->where(\"lang='$lang' and used=1\")->order('num asc,id asc')->select();\n foreach($data as $v){\n $description=json_decode($v['description']);\n $v['description'] = array('p1'=>stripslashes($description->p1),'p2'=>stripslashes($description->p2),\n 'p3'=>stripslashes($description->p3),'p4'=>stripslashes($description->p4),\n 'p5'=>stripslashes($description->p5));\n $res[] = $v;\n }\n $device = device();\n $this->assign('device',$device);\n $this->assign('list',$res);\n $this->display();\n\t}", "public function index()\n {\n $galleries = $this->galleryRepository->getAll();\n $this->render('admin.galleries.index', compact('galleries'));\n }", "public function index()\n {\n $photos = Photo::where('is_private',1)->paginate(9);\n return view('home',compact('photos'));\n \n }", "public function index()\n {\n // load a models\n $this->loadModel(\"Nouveaute\");\n $nouveautes = Nouveaute::find_all();\n $nouveaute_id = Nouveaute::find_by_id(1);\n\n // echo $nouveaute_id->image;\n\n // foreach ($nouveautes as $nouveaute) :\n // echo $nouveaute->image;\n // echo $nouveaute->filename;\n // echo $nouveaute->description;\n // endforeach; \n\n // load views\n require APP . 'view/_templates/head.php';\n require APP . 'view/_templates/header.php';\n require APP . 'view/invite/index.php';\n require APP . 'view/_templates/footer.php';\n }", "public function index()\n {\n $rootParent = $this->photoGallery->rootParentList();\n $dash = \"\";\n $recurArray = [ ];\n $galleryList = collect([ ]);\n $recurList = $this->recur($rootParent, $dash, $recurArray);\n\n //generate full list of rows from recursive list of array of rootParentList\n foreach ($recurList as $key => $value) {\n $gallery = $this->photoGallery->getDataById($key);\n $gallery[\"title\"] = $value;\n $galleryList->push($gallery);\n }\n\n $data['thisPageId'] = $this->thisPageId;\n $data['thisModuleId'] = $this->thisModuleId;\n $data['galleryData'] = $galleryList;\n $data['toggleUrl'] = URL::to(PREFIX.'/multicms/pages/gallery/toggleStatus');\n\n return view('cms.modules.multicms.photoGallery_listall', $data);\n }", "public function index()\n\t{\n $images = $this->repository->all();\n\n return view('images.index', compact('images'));\n\t}", "function tampilPhoto($nrk=''){\n $rs=$this->mdl->get_data($nrk)->row();\n $result = $rs->X_PHOTO->load();\n// If any text (or whitespace!) is printed before this header is sent,\n// the text won't be displayed and the image won't display properly.\n// Comment out this line to see the text and debug such a problem.\n header(\"Content-type: image/JPEG\");\n echo $result;\n }", "public function action_index() {\r\n $count = ORM::factory('documentos')->where('original', '=', 1)->and_where('id_user', '=', $this->user->id)->count_all();\r\n $pagination = Pagination::factory(array(\r\n 'total_items' => $count,\r\n 'current_page' => array('source' => 'query_string', 'key' => 'page'),\r\n 'items_per_page' => 50,\r\n 'view' => 'pagination/floating',\r\n ));\r\n $oNur = New Model_Hojasruta();\r\n $result = $oNur->hojasruta($this->user->id, $pagination->offset, $pagination->items_per_page);\r\n $page_links = $pagination->render();\r\n $oDoc = New Model_Tipos();\r\n $documentos = $oDoc->misTipos($this->user->id);\r\n $options = array();\r\n foreach ($documentos as $d) {\r\n $options[$d->id] = $d->tipo;\r\n }\r\n $this->template->title .= ' | Lista de HR creadas';\r\n $this->template->styles = array('media/css/tablas.css' => 'all', 'media/css/modal.css' => 'screen');\r\n $this->template->scripts = array('media/js/jquery.tablesorter.min.js');\r\n $this->template->content = View::factory('hojaruta/index')\r\n ->bind('result', $result)\r\n ->bind('page_links', $page_links)\r\n ->bind('count', $count)\r\n ->bind('options', $options);\r\n }", "public function index(){\n\n // Load class name 'user' and 'image' exists in folder models\n $User = $this->load_model('User');\n $image_class = $this->load_model('Image');\n\n //check login success or not, user has rank admin or not\n $user_data = $User->check_login();\n\n //if success get information login\n if(is_object($user_data)){\n $data['user_data'] = $user_data;\n }\n\n $DB = Database::newInstance();\n\n //Check if user type in search bar\n $search = false;\n if(isset($_GET['find'])){\n $find = addslashes($_GET['find']);\n $search = true;\n }\n\n //$ROWS: all products exists in DB\n if($search){\n $arr['description'] = \"%\" . $find . \"%\";\n $ROWS = $DB->read_db(\"SELECT * FROM tbl_products WHERE description LIKE :description \", $arr);\n\n }else{\n $ROWS = $DB->read_db(\"SELECT * FROM tbl_products\");\n }\n\n //Variable show_search will show search bar in webpage\n $data['show_search'] = true;\n\n $data['page_title'] = \"Bài Viết\";\n\n if($ROWS){\n foreach ($ROWS as $key => $row){\n // generate thumbnail product\n $ROWS[$key]->image = $image_class->get_thumb_post($ROWS[$key]->image);\n }\n }\n $data['ROWS'] = $ROWS;\n\n //Get all categories\n $category= $this->load_model('Category');\n $data['categories'] = $category->get_all();\n\n //Get all slider content\n $Slider = $this->load_model('Slider');\n $data['slider'] = $Slider->get_all();\n if($data['slider']){\n foreach ($data['slider'] as $key => $row){\n // generate thumbnail product\n $data['slider'][$key]->image = $image_class->get_thumb_post($data['slider'][$key]->image, 300, 300);\n }\n }\n\n //show index.php with data\n $this->view(\"blog\", $data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $mainGalleries = $em->getRepository('AppBundle:MainGallery')->findAll();\n\n return $this->render('@AppBundle/Resources/views/admin/maingallery/index.html.twig', array(\n 'mainGalleries' => $mainGalleries,\n ));\n }", "public function photoShow($id)\n {\n //\n }", "public function index()\n {\n $dados = array();\n\n $albuns = new Albuns();\n $dados['albuns'] = $albuns->getListaAlbuns();\n\n $this->loadTemplate('galeria', $dados);\n }", "public function index()\r\n {\r\n $avatar = $this->db->select(\"*\")->where('status',1)->get('avatar')->result_array();\r\n\r\n $lists = [];\r\n $this->_vd['personal_work'] = $lists;\r\n $this->_vd['avatarList'] = $avatar;\r\n $this->_view('personal/index');\r\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $galleries = Gallery::all();\n return view('admin.gallery.index' , compact('galleries'));\n }", "public function index()\n {\n $albums = $this->album->paginate($this->perPage);\n\n $this->setTitle(trans('themes::gallery.meta.title'))\n ->setDescription(trans('themes::gallery.meta.desc'));\n\n $this->setUrl(route('gallery.album.index'))\n ->addMeta('robots', 'index, follow');\n\n return view('gallery::index', compact('albums'));\n }", "public function index()\n\t{\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'home' ;\n\n\n //Getting data\n $index_banners = $this->home_m->get_data('index_banners')->result_array();\n\n foreach ($index_banners as $key => $i_banner) \n {\n $content = $this->db->where('index_banner_id',$i_banner['id'])->get('index_banners_content')->num_rows();\n\n $index_banners[$key]['flag'] = ($content) ? 1 : 0 ;\n }\n\n $this->data['gallery_albums'] = array_reverse($this->home_m->get_data('gallery_albums')->result_array());\n $this->data['stories'] = array_reverse($this->home_m->get_data('stories')->result_array());\n $this->data['index_banners'] = $index_banners;\n \n\n $body = 'index' ;\n\n $this->load_pages($body,$this->data);\n\n\t}", "public function getIndex()\n {\n //\n try {\n $active = 'photos';\n $photos = User::where(['role'=>2])->paginate(10);\n return view('admin.photos.index', compact('photos','active'));\n } catch (Exception $e) {\n $result = [\n 'exception_message' => $e->getMessage(),\n 'active' => 'photos'\n ];\n return view('errors.error', $result);\n }\n }", "public function index()\n {\n //\n $imageNews = ImageNew::orderBy('order','asc')->paginate(8);\n return view('admin.imageNew.imageNew',compact('imageNews'));\n }", "public function index() {\n $albums = Album::get();\n return view('admin.add-photos')->with(['page_name' => 'add-photos', 'albums' => $albums]);\n }", "public function carregar_imagem()\n\t{\n\t\t$id = $this->input->get(\"id_aluno\");\n\t\t$dados[\"aluno\"] = $this->Aluno_Model->retorna_aluno($id);\t\n\t\t//\tCARREGA A VIZUALIZACAO DA VIEW LISTA\n\t\t$this->load->view('layout/cabecalho_secretaria');\n\t\t$this->load->view('layout/menu_lateral_secretaria');\n\t\t$this->load->view('conteudo/_secretaria/_aluno/fotografia', $dados);\n\t\t$this->load->view('layout/rodape');\n\t\t$this->load->view('layout/script');\n\t}", "public function index()\n {\n $today = date('Y-m-d');\n $this->data['photos'] = DB::table('gallery')->where('show_from', '<=', $today)->where('show_until', '>', $today)->get();\n return view('gallery.index', $this->data);\n }", "public function actionIndex()\n {\n $query = DictHouses::find()->innerJoin(HomeImage::tableName(), 'home_id=dict_houses.id')\n ->where(['moderation'=> DictHouses::ADD_MODERATION, 'status'=> HomeImage::STATUS_PUBLISHED])\n ->distinct()->orderBy(['dict_houses.id'=>SORT_DESC]);\n $data = new ActiveDataProvider(['query' => $query, 'sort' => false]);\n return $this->render('index', [\n 'data' => $data\n ]);\n }" ]
[ "0.71024686", "0.70821553", "0.6991138", "0.6759952", "0.6751405", "0.67511326", "0.6738191", "0.6694762", "0.6671351", "0.66514313", "0.65401185", "0.65365094", "0.6515426", "0.6474187", "0.6447109", "0.63769865", "0.63694143", "0.6368314", "0.6359997", "0.63290954", "0.6316463", "0.63154763", "0.63007694", "0.6299404", "0.62822825", "0.6275785", "0.6269304", "0.6262176", "0.6259577", "0.6246238", "0.6201007", "0.6185573", "0.6174444", "0.6174307", "0.61722183", "0.61665994", "0.6166254", "0.615931", "0.614796", "0.6142517", "0.6141082", "0.6129577", "0.61185575", "0.61165595", "0.6115024", "0.61119944", "0.6109725", "0.6107748", "0.61048955", "0.61001676", "0.60993606", "0.6086959", "0.6086053", "0.60852337", "0.6081907", "0.60810655", "0.60783535", "0.60709226", "0.60677725", "0.60562515", "0.60543287", "0.60538936", "0.60522264", "0.60390717", "0.6033892", "0.6030426", "0.6026209", "0.6021971", "0.60199016", "0.60151285", "0.60107046", "0.60081077", "0.60077214", "0.6003692", "0.5991041", "0.59715945", "0.59705126", "0.5967685", "0.5965414", "0.59640235", "0.5956798", "0.59541714", "0.5947391", "0.5937454", "0.5935551", "0.59328055", "0.5929361", "0.5928367", "0.59272486", "0.592581", "0.5918624", "0.5914095", "0.5908761", "0.59066045", "0.5901602", "0.5888424", "0.58881706", "0.5885008", "0.588474", "0.588306" ]
0.63785094
15
Menampilkan detail Album yang diperoleh dari Lambda
public function rebuild() { $id=3; $dataAlbum = $this->admin->data_album($id); $namaAlbum = $dataAlbum->row()->nama_album; $albumKey = $dataAlbum->row()->kode_album; $data['title'] = "Dashboard | FaceVoting Versi 1.0"; $data['getRebuild']= $this->_prosesRebuild($namaAlbum,$albumKey); $view ='v_rebuildalbum'; $this->_template($data,$view); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Album $album)\n {\n //\n }", "function getViewAlbumDetail($album_uid) {\n\t\t// Get Smarty Instance\n \t$smartyInstance = tx_cwtcommunity_lib_common::getSmartyInstance();\n $conf = tx_cwtcommunity_lib_common::getConfArray();\n $tplPath = tx_cwtcommunity_lib_common::getTemplatePath($conf['template_album_detail']);\n \n $album = self::getAlbum($album_uid);\n $photos = self::getPhotos($album_uid);\n \n\t\tforeach ($photos as &$photo) {\n \t$photo['pic'] = self::getPhotoURI($photo['uid'], $conf); \n \t$photo['comment_count'] = self::getCommentCount($photo['uid']);\n }\n // Provide smarty with the information for the template\n $smartyInstance->assign('album', $album);\n $smartyInstance->assign('photos', $photos);\n \n $content .= $smartyInstance->display($tplPath);\n return $content;\n\t}", "function setup_album()\n {\n $this->ipsclass->DB->simple_construct( array( \"select\" => 'id, name, member_id, public_album', 'from' => 'gallery_albums', 'where' => \"id={$this->ipsclass->input['album']}\" ) );\n $this->ipsclass->DB->simple_exec(); \n $info = $this->ipsclass->DB->fetch_row();\n\n // Are we allowed to view this album?\n if( $info['member_id'] == $this->ipsclass->member['id'] )\n {\n $own = true;\n }\n\n if( ! $info['public_album'] && ! $own )\n {\n $this->ipsclass->Error( array( 'LEVEL' => 1, 'MSG' => 'no_permission' ) );\n }\n\n return $info;\n }", "public function getArtistWithAlbum()\n {\n return $this\n ->selectRaw('artists.id, artists.name, avatar, artists.slug, title, cover, count(*) as album_total')\n ->leftJoin('albums', 'artists.id', '=', 'albums.artist')\n ->groupBy('artists.id')\n ->orderBy('artists.name', 'asc')\n ->paginate(15);\n }", "public function show(){\n\t\t$data['segmento'] = $this->uri->segment(3);\n\t\t\t$data['imgs'] = $this->album_model->fotosAlbum($data['segmento'])->result();\n \n\t\t\t$data['Albums'] = $this->album_model->obtenerAlbum($data['segmento']);\n\n\t\tif ($data['Albums']!= null) {\n\t\t\t$this->load->view('header', array ('pagina' => 'Album'));\n\t\t\t$this->load->view('Upload/upload_form', $data);\n\t\t\t$this->load->view('Album/mostrar',$data);\n\t\t\t$this->load->view('footer.php');\n\n\t\t}else{\n\t\t\t$this->load->view('404');\t \t\n\t\t}\n\t}", "public function photoShow($id)\n {\n //\n }", "public function show($album_id, $id)\n {\n $album = Album::find($album_id);\n\n if (!$album)\n {\n return Redirect::home()->with('error_message', 'الرجاء التأكّد من طلب معرّف ألبوم صحيح.');\n }\n\n $album->views_count++;\n $album->save();\n\n // Get the chosen or the latest photo.\n if ($id == null)\n {\n $photo = Photo::where('album_id', '=', $album->id)->orderBy('position', 'DESC')->first();\n }\n else\n {\n $photo = Photo::where('album_id', '=', $album->id)->where('id', '=', $id)->orderBy('position', 'DESC')->first();\n }\n\n if ($photo == null)\n {\n return Redirect::home()->with('error_message', 'لم يتم إضافة صور حتّى الآن أو أن معرّف الصورة غير صحيح.');\n }\n\n // Update the views count.\n $photo->views_count++;\n $photo->save();\n\n // Get the previous photos.\n $previous_photos = Photo::where('album_id', '=', $album->id)->where('position', '<', $photo->position)->orderBy('position', 'DESC')->limit(Photo::PHOTOS_PER_PAGE/2)->get();\n\n // Get the next photos.\n $next_photos = Photo::where('album_id', '=', $album->id)->where('position', '>', $photo->position)->orderBy('position', 'ASC')->limit(Photo::PHOTOS_PER_PAGE/2)->get();\n\n // Set the related photos.\n $related_photos = $previous_photos->merge($next_photos);\n\n return View::make(\"photos.show\")\n ->with('album', $album)\n ->with('photo', $photo)\n ->with('previous_photos', $previous_photos)\n ->with('next_photos', $next_photos)\n ->with('related_photos', $related_photos);\n }", "public function index()\n {\n try{\n\n $albums = Input::get('q') ? Album::with('artist', 'categories', 'language')->where('title', 'like', '%'.Input::get('q').'%')->orderBy('created_at', 'desc')->paginate(20) : Album::with('artist', 'categories', 'language')->orderBy('created_at', 'desc')->paginate(20);\n\n //print_r($albums);\n //dd(DB::getQueryLog());\n //die;\n return View::make('admin.album.index', array('albums' => $albums));\n }catch (Exception $ex){\n echo $ex->getMessage();\n }\n /*$files = PATH::asset('assets/mp3/01 - Aanewala Pal-(MyMp3Singer.net).mp3');\n\n echo $files;\n $getID3 = new \\getID3;\n $info = $getID3->analyze($files);\n print_r($info);\n die;*/\n\n\n\n\n //return View::make('admin.album.index', array('albums' => $albums));\n }", "public function show(Album $album)\n {\n $album->load('photos');\n // dd($album);\n \n // $photos = Album::with('photos')->where('slug',$id)->first();\n \n\n return view('albums.show')->with('album', $album);\n }", "public function gallery_albums()\n {\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'gallery' ;\n $this->data['gallery_albums'] = $this->home_m->get_data('gallery_albums')->result_array();\n\n $body = 'gallery_albums' ;\n\n $this->load_pages($body,$this->data);\n }", "public function show($id)\n {\n return albumdetail::findOrFail($id);\n }", "public function getAlbum(): Album;", "public function album()\n {\n return $this->belongsTo(Album::class, 'album_id', 'id');\n }", "function showAllAlbum() {\n $sql = \"SELECT * FROM `itf_album`\";\n return $this->dbcon->FetchAllResults($sql);\n }", "function album_list_thumbnail($albumList)\n{\n\tforeach ($albumList as $album) {\n\t\t$id = $album->album_id;\n\t\t$title = $album->album_title;\n\t\t$year = $album->album_year;\n\t\techo \"<div class='col-md-6' data-toggle='tooltip' data-placement='top' title='$title'> \";\n\t\t\techo a_open(\"thumbnail\", base_url().\"album/$id\");\n\t\t\t\techo img(\"data/music/albums/$id/cover.png\");\n\t\t\techo a_close();\n\t\techo div_close();\n\t}\n}", "public function show($slug)\n {\n $album = Album::whereSlug($slug)->firstOrFail();\n $images = $album->image()->where('status', '!=', 'draft')->get();\n $subs = $album->child()->with('user')->get();\n\n $image_urls = [];\n $sub_urls = [];\n foreach ($images as $url) {\n array_push(\n $image_urls,\n\n [\n 'url' => $url->getFirstMediaUrl('images', 'fullscreen'),\n 'name' => $url->name,\n 'biliner' => $url->biliner,\n\n ]\n\n );\n }\n foreach ($subs as $subItem) {\n array_push(\n $sub_urls,\n [\n 'album_imgUrl' => $subItem->getFirstMediaUrl('covers', 'thumb'),\n 'name' => $subItem->name,\n 'slug' => $subItem->slug,\n ]\n );\n }\n\n\n $album_Object =\n [\n 'name' => $album->name,\n 'biliner' => $album->biliner,\n 'slug' => $album->slug,\n 'album_id' => $album->album_id,\n 'status' => $album->status,\n 'album_imgUrl' => $album->getFirstMediaUrl('covers', 'cover'),\n 'image_info' => $image_urls,\n 'subs_info' => $sub_urls,\n\n ];\n\n return $album_Object;\n }", "public function show($id)\n {\n $album = Albums::find($id);\n\n $date = new Date('now', 'Europe/Brussels');\n\n $date->month = $album->mois+1;\n\n $album->mois = $date->format('F');\n\n $proprietaire = User::find($album->ID_proprietaire);\n\n $album->proprietaire_nom = $proprietaire->first_name. ' ' .$proprietaire->last_name. ' (Propriétaire)';\n\n\n $picturesData = $album->pictures;\n\n $pictures = array();\n $i=0;\n foreach($picturesData as $picture){\n\n $pictures[$i]['big'] = $picture->directory.'/'.$picture->name;\n $pictures[$i]['thumb'] = $picture->directory.'/thumb2_'.$picture->name;\n $i++;\n }\n return view('albums.show',compact('album','pictures'));\n }", "public function getAlbumInfoAction()\n {\n \t$params = $this->getRequest()->getParams();\n\n \t$result = \\Extended\\socialise_album::getSocialiseAlbumInfo( $params['album_id'] );\n \n \tif( $result ):\n \techo Zend_Json::encode( $result );\n \telse:\n \t//Wallpost doesnot exist anymore.\n \techo Zend_Json::encode( 2 );\n \tendif;\n \tdie;\n }", "function listAlbums($parameter)\n\t\t{\n\t\t\t//$parameter = substr($parameter, 0,strpos($parameter, 'count'));\n\t\t\t//$parameter = substr($parameter, strrpos($parameter, 'genres 0 '));\n\t\t\t$tabParameter = split(\" id:\", $parameter);\n\t\t\t//print_r($tabParameter);\n\t\t\t$i = 2;\n\t\t\t$len = count($tabParameter);\n\t\t\t//print_r($tabParameter);\n\n\t\t\tforeach ($tabParameter as $key => $value) \n\t\t\t{\n\t\t\t\tif ($key > 0 && $i < $len ) \n\t\t\t\t{\n\t\t\t\t\t//$id = get_string_between($value,\"id:\",\" artwork_track_id\");\n\t\t\t\t\t$id = substr($value, 0,strpos($value, \" \"));\n\t\t\t\t\t$artwork = get_string_between($value,\"artwork_track_id:\",\" title:\");\n\t\t\t\t\t$title = substr($value,strpos($value, \"title:\"));\n\t\t\t\t\t//echo \"contenu de title: $title\";\n\t\t\t\t\t//$title = substr_replace($title, '', strpos($title, ' count:'));\n\t\t\t\t\t//echo \"titre après replace: $title\";\n\t\t\t\t\t//$title = substr_replace($value, '', strpos($value, \"count\"));\n\t\t\t\t\t\n\n\n\t\t\t\t//list($id,$genre)=explode(\" genre:\", $tabParameter[$key]);\n\t\t\t\t\techo \"<li id=\\\"$title$id\\\">$title</li>\";\n\t\t\t\t\techo \"<img id=\\\"$artwork\\\" src=\\\"http://\".$_SESSION['LMS']['server'].\":9000/music/$artwork/cover_96x96_p.png\\\"/>\";\n\t\t\t\t\t$i++;\n\t\t\t\t\t//echo \"i et len : $i $len\";\n\t\t\t\t}\n\n\t\t\t\telseif ($i == $len)\n\t\t\t\t {\n\t\t\t\t\t//$id = get_string_between($value,\"id:\",\" artwork_track_id\");\n\t\t\t\t\t$id = substr($value, 0,strpos($value, \" \"));\n\t\t\t\t\t$artwork = get_string_between($value,\"artwork_track_id:\",\" title:\");\n\t\t\t\t\t$title = substr($value,strpos($value, \"title:\"));\n\t\t\t\t\t\n\t\t\t\t\t//echo \"contenu de title: $title\";\n\n\n\t\t\t\t//list($id,$genre)=explode(\" genre:\", $tabParameter[$key]);\n\t\t\t\t\techo \"<li class=\\\"album\\\" id=\\\"$title|$id\\\">$title</li>\";\n\t\t\t\t\techo \"<img class=\\\"album\\\" id=\\\"$artwork\\\" src=\\\"http://\".$_SESSION['LMS']['server'].\":9000/music/$artwork/cover_96x96_p.png\\\"/>\";\n\t\t\t\t\t$i++;\n\t\t\t\t }\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t}", "public function albums(){\n $albums = Album::all();\n return view('admin.albums')->with('albums', $albums);\n }", "function albums_admin_show_albums() {\n\tglobal $lang;\n\t$albums = albums_get_albums();\n\n\tif ($albums == FALSE)\n\t\techo '<span class=\"kop4\">'.$lang['general']['nothing_yet'].'</span>';\n\n\telse {\n\t\tforeach ($albums as $album) {\n\t\t\t?>\n\t\t\t\t<div class=\"menudiv\">\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<img src=\"<?php echo MODULE_DIR; ?>/images/albums.png\" alt=\"\" />\n\t\t\t\t\t</span>\n\t\t\t\t\t<span class=\"title-page\"><?php echo $album['title']; ?></span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=editalbum&amp;var1=<?php echo $album['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/edit.png\" title=\"<?php echo $lang['albums']['edit_album']; ?>\" alt=\"<?php echo $lang['albums']['edit_album']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t\t<span>\n\t\t\t\t\t\t<a href=\"?module=albums&amp;page=deletealbum&amp;var1=<?php echo $album['seoname']; ?>\">\n\t\t\t\t\t\t\t<img src=\"data/image/delete_from_trash.png\" title=\"<?php echo $lang['albums']['delete_album']; ?>\" alt=\"<?php echo $lang['albums']['delete_album']; ?>\" />\n\t\t\t\t\t\t</a>\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t}\n\t\tunset($albums);\n\t}\n}", "function display_album($img_in_album, $title, $width, $height) {\n echo '<img id=\"imgFromAlbum\" src=\"uploads/' . $img_in_album . '\" title=\"' . $title . '\" height=\"' . $height .'\" width=\"' . $width .'\" />';\n\t}", "public function showmetadata($string){\n\n $artistalike = DB::table('artistas')->where('nomeartista','LIKE', '%' . $string . '%')->first();\n\n if(!$artistalike){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n $data = $artistalike->id;\n \n $metadata = DB::table('artistas')\n ->select(\n 'nomeartista',\n 'desc_artista',\n 'filepath'\n )->where('nomeartista', 'LIKE', '%' . $string . '%')\n ->get();\n\n $metaalbum = DB::table('artistas')\n ->join('album', 'album.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'album.titulo_album',\n 'album.desc_album',\n 'album.filepath_avatar'\n )\n ->get();\n \n $metamusica = DB::table('artistas')\n ->join('musica', 'musica.artistaID', '=', 'artistas.id')->where('artistas.id', '=', $data)\n ->select(\n 'musica.id',\n 'musica.nomemusica',\n 'musica.filepath',\n 'musica.created_at'\n )\n ->get();\n \n if(!$metadata){\n return response()->json([\n 'message' => 'Nenhum resultado para: ' . $string\n ], 404);\n }\n\n return [\n 'find' => [\n 'artist' => [\n 'artista' => $metadata,\n 'data' => [\n 'album'=>$metaalbum,\n 'musicas'=>$metamusica\n ]\n\n ]\n ]\n ];\n }", "public function getPublicAlbumImage($slug) {\n $pubObj = Pub::where('public.p_slug', '=', $slug);\n\n if ($pubObj->exists()) {\n if ($pubObj->first()->type == 'album') {\n $user_id = $pubObj->first()->user_id;\n\n $pubObj = $pubObj\n ->join('albums', 'public.type_id', '=', 'albums.album_id')\n ->first();\n $pubObj->user = User::find($user_id);\n $pubObj->images = Images::where('album_id', '=', $pubObj->album_id)->get();\n $pubObj->comments = Comment::where('type', '=', 'album')->where('type_id', '=', $pubObj->album_id)->orderBy('created_at')->get();\n } else {\n $pubObj = $pubObj->join('images', 'public.type_id', '=', 'images.image_id')->first();\n }\n\n $this->data['album'] = $pubObj;\n $this->data['title'] = 'Gallery - Public';\n\n //$this->modules = self::getModules('');\n\n return View::make('public', $this->data);\n } else {\n return App::abort(404);\n }\n }", "function showArtista($row){\n\t\techo '<div class=\"album\" id=\"album'.$row['id'].'\" onClick=\"eliminar('.$row['id'].')\">\n\t\t\t\t<div class=\"cover\">';\n\t\t//cover\n\t\tif ($row['cover'] == 'default'){\n\t\t\techo '<img class=\"imageCover\" src=\"images/album.png\" title=\"'.$row['artista'].'\">';\n\t\t}else{\n\t\t\techo '<img class=\"imageCover\" src=\"images/cover/'.$row['cover'].'\" title=\"'.$row['artista'].'\">';\n\t\t}\n\n\t\techo '</div>\n\t\t\t\t<div class=\"info\">\n\t\t\t\t\t<div class=\"contador\" id=\"contador'.$row['id'].'\">\n\t\t\t\t\t\t<span></span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"infosong\">\n\t\t\t\t\t\t<img src=\"images/disco.png\">';\n\t\t//artista\n\t\techo '<h2>'.$row['cancion'].'</h2>';\n\t\t//album\n\t\techo '<h3>'.$row['artista'].'</h3>';\n\n\t\techo '</div>\n\t\t\t\t\t<div class=\"infovotos\">\n\t\t\t\t\t\t<img src=\"images/like.png\">';\n\t\t//id para el jquery\n\t\techo '<img src=\"images/masDesactivo.png\" class=\"mas\" id=\"boton'.$row['id'].'\">';\n\t\t//votos\n\t\techo '<p id=\"votos'.$row['id'].'\">'.votos($row['id']).' votos</p>\n\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>';\n}", "function getDetailsList($detailsID){\n// . \"`Album01`,`Album02`, `Album03`,`Album04`,`Album05`,`Album06`,`Album07`,`Album08`,`Album09`,`Album10`\"\n// .\",Remarks,AlbumFormat,VocalArtist,Lyricist,MusicComposer,MusicDirector,MusicArranger,SoundRecordist,RecordingStudio,Producer,RecordLabel\"\n// . \" from `ferozatable` where Album01 = '\" . $detailsID.\"'\";\n $sql = \"SELECT Category,SongTitle,ReleaseYearSong,ReleaseYearAlbum,AlbumTitle,LiveLink,Notebook01,\"\n . \"`Album01`,`Album02`, `Album03`,`Album04`,`Album05`,`Album06`,`Album07`,`Album08`,`Album09`,`Album10`\"\n .\",Remarks,AlbumFormat,VocalArtist,Lyricist,MusicComposer,MusicDirector,MusicArranger,SoundRecordist,RecordingStudio,Producer,RecordLabel\"\n . \" from `ferozatable` where Album01 = '\" . $detailsID.\"'\";\n \n $query = $this->db->query($sql);\n return $query->result();\n }", "public function album(){\r\n $config = array();\r\n $config[\"base_url\"] = base_url() . \"gallery/album\";\r\n $total_row = $this->Mdl_gallery->record_count();\r\n $config[\"total_rows\"] = $total_row;\r\n $config[\"per_page\"] = 3;\r\n $config['use_page_numbers'] = TRUE;\r\n $config['num_links'] = $total_row;\r\n $config['cur_tag_open'] = '&nbsp;<a class=\"current\">';\r\n $config['cur_tag_close'] = '</a>';\r\n $config['next_link'] = 'Next';\r\n $config['prev_link'] = 'Previous';\r\n\r\n $this->pagination->initialize($config);\r\n\r\n if($this->uri->segment(3)){\r\n $page = ($this->uri->segment(3)) ;\r\n }\r\n else{\r\n $page = 0;\r\n }\r\n /* $page = ($this->uri->segment(3)) ? $this->uri->segment(3) : 3;*/\r\n\r\n $data[\"results\"] = $this->Mdl_gallery->fetch_data($config[\"per_page\"], $page);\r\n $str_links = $this->pagination->create_links();\r\n $data[\"links\"] = explode('&nbsp;',$str_links );\r\n\r\n// View data according to array.\r\n\r\n /* $this->load->view(\"pagination_view\", $data);*/\r\n $this->load->view('header_album');\r\n $this->load->view('album',$data);\r\n $this->load->view('footer_album');\r\n }", "public function show(PhotoGalary $photoGalary)\n {\n //\n }", "public function showAlbumByConfigAction()\n {\n $mediaAlbum = $this->mediaAlbumRepository->findByUid((int)$this->settings['mediaAlbum'], false);\n if ($mediaAlbum) {\n // get all request arguments (e.g. pagination widget)\n $arguments = $this->request->getArguments();\n // set album id from settings\n $arguments['mediaAlbum'] = $this->settings['mediaAlbum'];\n\n $this->forward('showAlbum', null, null, $arguments);\n }\n }", "function getAllAlbums($typ) {\r\r\n\t$PView = new PView;\r\r\n\tglobal $tp;\r\r\n\t\r\r\n\t$details = $PView->getPView_config(\"gal_details\");\r\r\n\t$showDetails = explode(\"|\",$details);\r\r\n\t\r\r\n\tif ($typ == \"root\"){\r\r\n\t\t$AllAlbumData = $PView -> getRootAlbumData();\r\r\n\t} else {\r\r\n\t\tif (!$PView -> getSubAlbumsCount()) { return \"\"; }// exit if no subalbums\r\r\n\t\t$AllAlbumData = $PView -> getSubAlbumData();\t\r\r\n\t}\r\r\n\r\r\n\t$out_AllAlbums = \"<tr><td colspan='2' style='padding-top:5px;'><table style='width:100%'>\";\r\r\n\tforeach ($AllAlbumData as $dataset) {\r\r\n\t\t//PERMISSION!!!\r\r\n\t\tif ($PView -> getPermission(\"album\",$dataset['albumId'],\"View\")) {\r\r\n\t\t\t$out_AllAlbums .= \"<tr><td><div style='background-image:url(\".e_PLUGIN.\"pviewgallery/templates/\".$PView -> getPView_config(\"template\").\"/images/ringbuch_650.jpg); background-repeat:no-repeat; width:660px; height:400px;'>\";\r\r\n\t\t\t$out_AllAlbums .= \"<table style='width:550px;'><tr style='height:300px;'><td style='text-align:left;padding-top:30px; width:40%;'>\";\r\r\n\t\t\tif (array_search(\"name\",$showDetails) !== FALSE) {\r\r\n\t\t\t\t$out_AllAlbums .= \"<a href='pviewgallery.php?album=\".$dataset['albumId'].\"'>\". $tp -> toHTML($dataset['name']).\"</a>\";\r\r\n\t\t\t}\r\r\n\t\t\tif (array_search(\"descr\",$showDetails) !== FALSE) {\r\r\n\t\t\t\t$out_AllAlbums .= \"<br><br>\". $tp -> toHTML($dataset['description']);\r\r\n\t\t\t}\r\r\n\t\t\t$out_AllAlbums .= \"</td><td style='text-align:right;padding-top:30px;width:60%;'><a href='pviewgallery.php?album=\".$dataset['albumId'].\"'><img src='\".$PView -> getAlbumImage($dataset['albumId']).\"' border='0px'></a></td></tr>\";\r\r\n\t\t\t$out_AllAlbums .= \"<tr><td style='text-align:left;'>\";\r\r\n\t\t\tif (array_search(\"edit\",$showDetails) !== FALSE && $PView -> getPermission(\"album\",$dataset['albumId'],\"Edit\")) {\r\r\n\t\t\t\t$out_AllAlbums .= \"<a href='pview_actions.php?album=\".$dataset['albumId'].\"&action=edit'>\".LAN_ALBUM_7.\"</a>\";\r\r\n\t\t\t}\r\r\n\t\t\t$out_AllAlbums .= \"</td><td style='text-align:right;'>\";\r\r\n\t\t\tif (array_search(\"info\",$showDetails) !== FALSE) {\r\r\n\t\t\t\t$out_AllAlbums .= LAN_ALBUM_1.\": \".$PView -> getAlbumImageCount($dataset['albumId']).\" / \".LAN_ALBUM_2.\": \".$PView -> getSubAlbumsCount($dataset['albumId']);\r\r\n\t\t\t}\r\r\n\t\t\t$out_AllAlbums .\"</td></tr>\";\r\r\n\t\t\t$out_AllAlbums .= \"</table> \";\r\r\n\t\t\t$out_AllAlbums .= \"</div></td></tr>\";\r\r\n\t\t}\r\r\n\t}\r\r\n\t\r\r\n\t$out_AllAlbums .= \"</table></td></tr>\";\r\r\n\tif (!strip_tags($out_AllAlbums)) {\r\r\n\t$out_AllAlbums = \"<tr><td colspan='2' style='padding:10px;'>\".LAN_GALLERY_4.\"</td></tr>\";\r\r\n\t}\r\r\nreturn $out_AllAlbums;\r\r\n}", "public function album($id)\r\n\t{\r\n\t\t//check for admin\r\n\t\tif($this->session->userdata('logged_in'))\r\n\t\t{\r\n\t\t\t$session_data = $this->session->userdata('logged_in');\r\n\t\t\t$data['username'] = $session_data['username'];\r\n\t\t\t$data['admin'] = $session_data['admin'];\r\n\t\t}\r\n\t\telse\r\n\t\t\t$data['username'] = '';\r\n\t\t\t\r\n\t\t// set active tab\r\n\t\t$data['welcome_active'] = \"\";\r\n\t\t$data['host_active'] = \"\";\r\n\t\t$data['event_active'] = \"active\";\r\n\t\t\r\n\t\t// get list of photos\r\n\t\t$data['photos'] = $this->caifmodel->get_photos_by_album($id);\r\n\t\t$data['albums'] = $this->caifmodel->get_albums();\r\n\t\t$data['album_id'] = $id;\r\n\t\t\r\n\t\t// load views\r\n\t\t$this->load->view('include/header',$data);\r\n\t\t$this->load->view('include/tabs',$data);\r\n\t\t$this->load->view('album',$data);\r\n\t\t$this->load->view('include/footer');\r\n\t}", "public function show($id)\n {\n $sql = 'select * FROM albums WHERE id=:id';\n return DB::select($sql, ['id' => $id]);\n }", "public function gallery($album_id=\"\")\n {\n $lang = $this->data['lang'];\n $user_id = $this->user_id;\n\n $this->data['page'] = 'gallery' ;\n\n $where['album_id'] = $album_id;\n $this->data['gallery'] = $this->home_m->get_data('gallery',$where)->result_array();\n\n $body = 'gallery' ;\n\n $this->load_pages($body,$this->data);\n }", "function album_song_list($songList)\n{\n foreach ($songList as $song) {\n \n $title = $song->track_title;\n $trackId = $song->track_id;\n $price = $song->track_price;\n\n echo a_open(\"list-group-item\", base_url() . \"cart/add/track/$trackId\");\n echo \"<span class='badge'>$$price.00</span>\";\n echo $title;\n echo a_close();\n }\n}", "public function index($id)\n {\n $gal=Galeria::where(['albums_id'=>$id])->get();\n //dd($gal);\n // $data=array('gal'=>$gal,'id'=>$id);\n return view('album.galeria.index')->with(['gal'=>$gal,'id'=>$id]);\n }", "public function getAlbumsForArtist($artist_id,$artist_role){\r\n\t\tif($artist_id){\r\n\t\t\t$container = new container_db_dto();\r\n\t\t\t\r\n\t\t\t$limit = (int)$this->messenger[\"query\"][\"limit\"];\r\n\t\t\t$start = (int)$this->messenger[\"query\"][\"start\"];\r\n\t\t\t$orderBy = \"\";\r\n\t\t\tif(\t$this->messenger['query']['sf'] != '' ){\r\n\t\t\t\t$orderBy = \" ORDER BY am.\".$this->messenger['query']['sf'].\" \".$this->messenger['query']['so'];\r\n\t\t\t}\r\n\t\t\t$where = ' where am.status = 1 and aa.artist_id = '.$artist_id;\r\n\t\t\tif($artist_role!=null && key_exists($artist_role,$this->aConfig['artist_type'])){\r\n\t\t\t\t$artist_role_id = $this->aConfig['artist_type'][$artist_role];\r\n\t\t\t\tif($artist_role_id)\r\n\t\t\t\t\t$where = $where.\" and aa.artist_role & \".$artist_role_id.\"=\".$artist_role_id;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t$this->apply_where_criteria($where);\r\n\t\t\t$this->sSql = \"select count(aa.album_id) as cnt\r\n\t\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\tif($res!=-1 and sizeof($res)>0){\r\n\t\t\t\t$container->settotal_count($res[0]->cnt);\r\n\t\t\t\t$this->sSql = \"SELECT am.broadcast_year,am.content_type,am.film_rating,am.grade,lm.language_id,\r\n\t\t\t\t\t\tam.music_release_date,am.album_id,am.album_name,lm.language_name,am.music_release_date,am.title_release_date,am.album_image,\r\n\t\t\t\t\tam.album_type,lb.label_name @@@album_desc@@@ @@@album_excerpt@@@\r\n\t\t\t\t\tfrom artist_album aa left join album_mstr am on am.album_id=aa.album_id\r\n\t\t\t\t\t\tleft join language_mstr lm on lm.language_id=am.language_id \r\n\t\t\t\t\t\tLEFT JOIN label_mstr lb ON lb.label_id=am.label_id \r\n\t\t\t\t\t\t\".$where.\" \".$orderBy .\" LIMIT $start, $limit\";\r\n\t\t\t\t$this->apply_includes();\r\n\t\t\t\t$res = $this->oMysqli->query($this->sSql);\r\n\t\t\t\t$data = array();\r\n\t\t\t\t$album_ids_arr = array();\r\n\t\t\t\tif(sizeof($res)>0 && $res!=-1){\r\n\t\t\t\t\tforeach ($res as $resValue){\r\n\t\t\t\t\t\t$album = new album_db_dto();\r\n\t\t\t\t\t\t$album->setalbum_id($resValue->album_id);\r\n\t\t\t\t\t\t$album_ids_arr[] = $resValue->album_id;\r\n\t\t\t\t\t\t$album->setalbum_name($resValue->album_name);\r\n\t\t\t\t\t\t$album->setalbum_language($resValue->language_name);\r\n\t\t\t\t\t\t$album->setalbum_language_id($resValue->language_id);\r\n\t\t\t\t\t\t$album->setalbum_music_rel_dt($resValue->music_release_date);\r\n\t\t\t\t\t\t$album->setalbum_label($resValue->label_name);\r\n\t\t\t\t\t\t$album->setalbum_type($this->oCommon->getalbumtype($resValue->album_type));\r\n\t\t\t\t\t\t$album->setalbum_title_rel_dt($resValue->title_release_date);\r\n\t\t\t\t\t\t$album->setalbum_df_image($resValue->album_image);\r\n\t\t\t\t\t\t$album->setalbum_broadcast_year($resValue->broadcast_year);\r\n\t\t\t\t\t\t$album->setalbum_content_type($this->oCommon->getalbumcontenttype($resValue->content_type));\r\n\t\t\t\t\t\t$album->setalbum_film_rating($resValue->film_rating);\r\n\t\t\t\t\t\t$album->setalbum_grade($resValue->grade);\r\n\t\t\t\t\t\tif(in_array(\"album_description\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_description($resValue->album_desc);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(in_array(\"album_excerpt\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t\t$album->setalbum_excerpt($resValue->album_excerpt);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$data[]=$album;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$artist_album_map=array();\r\n\t\t\t\t\t$artist_album_map = $this->oCommon->getArtistForAlbum($album_ids_arr);\r\n\t\t\t\t\t$album_tag_map = array();\r\n\t\t\t\t\tif(in_array(\"album_tags\",$this->req_includes_arr)){\r\n\t\t\t\t\t\t$album_tag_map = $this->oCommon->getAlbumTags($album_ids_arr);\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\tforeach($data as $album){\r\n\t\t\t\t\t\t$id = $album->getalbum_id();\r\n\t\t\t\t\t\tif(key_exists($id,$artist_album_map))\r\n\t\t\t\t\t\t\t$album->setalbum_artist($artist_album_map[$id]);\r\n\t\t\t\t\t\tif(key_exists($id,$album_tag_map))\r\n\t\t\t\t\t\t\t$album->setalbum_tags($album_tag_map[$id]);\r\n\t\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$container->setdata($data);\r\n\t\t\t\t\r\n\t\t\t\treturn $container->to_array();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public function show($id)\n {\n $album = Album::find($id);\n $user = User::where('id', $album->user_id)->first();\n $albumName = explode(' ', trim($album->name));\n foreach ($album->songs as $song) {\n $file = new mp3Controller(\"storage/albums/\".$albumName[0].\"/\".$song->url);\n $duration = $file->getDuration();\n $length = mp3Controller::formatTime($duration);\n $song['length'] = $length;\n }\n return view('album.show', compact(['album', 'user']));\n }", "public function index(){\n $artists = DB::table('artists')->get();\n $albums = Album::with('artists')->get();\n return view('albums', compact('albums','artists'));\n }", "function albums_site_show_images($album) {\n\tglobal $lang;\n\n\tif (!file_exists(ALBUMS_DIR.'/'.$album))\n\t\techo '<p>'.$lang['albums']['doesnt_exist'].'</p>';\n\n\telse {\n\t\t$images = albums_get_images($album);\n\t\tif ($images != FALSE) {\n\t\t\tforeach ($images as $image) {\n\t\t\t\t?>\n\t\t\t\t<div class=\"album\">\n\t\t\t\t\t<table>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<a href=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/<?php echo $image['filename_image']; ?>\" rel=\"lytebox[album]\" title=\"<?php echo $image['title']; ?>\">\n\t\t\t\t\t\t\t\t\t<img src=\"<?php echo SITE_URL; ?>/data/modules/albums/albums_getimage.php?image=<?php echo $album; ?>/thumb/<?php echo $image['filename_image']; ?>\" alt=\"<?php echo $image['title']; ?>\" title=\"<?php echo $image['title']; ?>\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span class=\"albuminfo\"><?php echo $image['title']; ?></span>\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\t<i><?php echo $image['info']; ?></i>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t<?php\n\t\t\t}\n\t\t\tunset($image);\n\t\t}\n\t}\n}", "function gallery_detail($uri_gallery){\n\t\t// $uri_gallery = $this->db->escape($uri_gallery);\n\t\t$filter['GALL_URI'] = $uri_gallery;\n\t\t$gall_info = $this->dashboard_m->get_gallery_info($filter);\n\t\t$data['gall_info_result'] = $gall_info;\n\t\t$data[\"title\"] = $gall_info->GALL_NAME;\n\t\t$data[\"description\"] = $gall_info->GALL_DESC;\n\t\t$data['breadcrumb_parent_uri'] = \"gallery\";\n\t\t$data['breadcrumb_parent'] = \"Galeri\";\n\t\t$data['breadcrumb_active'] = $gall_info->GALL_NAME;\n\t\t// Get Data Gallery Foto / Video \n\t\t$filter2['GALL_ID'] = $gall_info->GALL_ID;\n\t\t$gall_pic_list = $this->dashboard_m->get_pics_of_gallery($filter2);\n\t\t$data['result'] = $gall_pic_list;\n\t\t// Get Data Sidebar\n\t\t$filter3['GALL_ID'] = $gall_info->GALL_ID;\n\t\t$gall_list = $this->dashboard_m->get_galleries($filter3);\n\t\tshuffle($gall_list);\n\t\t$data['sidebar_result'] = $gall_list;\n\t\t$data['include_script'] = inc_script(\n\t\t\tarray(\n\t\t\t\t\"cms/plugin/dashboard/js/gallery_modal.js\",\n\t\t\t)\n\t\t);\n\n\t\t$this->masterpage->addContentPage('breadcrumb', 'breadcrumb', $data);\n\t\t$this->masterpage->addContentPage(\"gallery_detail\", 'contentmain', $data);\n\t\t$this->masterpage->show();\n\t}", "public function album()\n {\n return $this->belongsTo('App\\Models\\Album');\n }", "public function show($id) \n {\n $album = Album::findOrFail($id);\n\n if($album->user_id == Auth::id()){\n \n $images = Images::where('album_id', $id)->with('user')->paginate(9);\n \n return view('album.show', compact('album', 'images'));\n }else{\n abort(403, 'Unauthorized action!');\n }\n\n }", "public function album()\n {\n \treturn $this->belongsTo('Album');\n }", "public function afficher_musique($id)\n{\n\n $db = $this->_db;\n $requete = $db->prepare(\"SELECT * FROM musiques WHERE id=$id\");\n $requete->execute();\n $resultat = $requete->fetchall();\n\n foreach($resultat as $musique)\n {\n $titre = $musique['titre'];\n $artiste = $musique['artiste'];\n $album = $musique['album'];\n $image = $musique['image'];\n\n echo\n \"<div class='card' style='width: 18rem;'>\n <img class='card-img-top' src='images-auto/$image' alt='Album $album'>\n <div class='card-body'>\n <h5 class='card-title'>Artiste :</h5><p class = 'anim'>$artiste</p>\n <h5 class='card-title'>Album : </h5><p class = 'anim'>$album</p>\n <h5 class='card-title'>Titre :</h5><p class = 'anim'> $titre</p> \n </div>\n </div>\";\n \n}\n}", "function album($album_id, $json = false){\n\t\tif(!empty($album_id) && $album_id>0){\n\t\t\t$albuminfo = $this->db->get_where(DB_MEDIA,array('id'=>$album_id))->row()->id;\n\t\t\tif(empty($albuminfo)){\n\t\t\t\tredirect('user/albums');\n\t\t\t}\n\t\t $timeline_id =\t$this->db->get_where(DB_MEDIA,array('id'=>$album_id))->row()->timeline_id;\n\t\t\t$query_one = \"SELECT id,name,descr,timeline_id,album_privacy,user_album_type FROM \" . DB_MEDIA . \" WHERE id=\" . $album_id . \" AND `type`='album' AND temp=0 AND active=1\";\n\t\t\t$sql_query_one = $this->db->query($query_one);\n\t\t\tif ($sql_query_one->num_rows == 1){\n\t\t\t\t$sk = array();\n\t\t\t\t$uid = $this->session->userdata('user_id');\n\t\t\t\t// Login verification and user stats update\n\t\t\t\t$sk['logged'] = false;\n\t\t\t\t$user = null;\n\t\t\t\t$config['site_url'] = base_url();\n\t\t\t\t$config['theme_url'] = '';\n\t\t\t\t$config['script_path'] = str_replace('index.php', '', $_SERVER['PHP_SELF']);\n\t\t\t\t$config['ajax_path'] = base_url() . 'ajax/socialAjax';\n\t\t\t\t$sk['config'] = $config;\n\t\t\t\tif ($this->socialkit->SK_isLogged()) {\n\t\t\t\t\t$user = $this->socialkit->SK_getUser($uid, true);\n\t\t\t\t\tif (!empty($user['id']) && $user['type'] == \"user\") {\n\t\t\t\t\t\t$sk['user'] = $user;\n\t\t\t\t\t\t$sk['timeline'] = $user;\n\t\t\t\t\t\t$sk['timeline']['wall_user_id'] = false;\n\t\t\t\t\t\t$sk['logged'] = true;\n\t\t\t\t\t}\n\t\t\t\t\t$album = $sql_query_one->result();\n\t\t\t\t\t$sk['album'] = (array) $album[0];\n\t\t\t\t\t$sk['privacyArray'] = $this->model_user->getPrivacyOptions();\n\t\t\t\t\tif($timeline_id ==$uid){\n\t\t\t\t\t//$sk['photos'] = $this->socialkit->SK_getAlbumPhotos($album_id);\n\t\t\t\t\t$all_photos=$this->db->query(\"SELECT a.id as post_id,a.post_privacy, a.post_id as postid,b.id FROM posts AS a\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN \". constant('DB_MEDIA') .\" AS b on a.media_id=b.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE b.album_id='\".$album_id.\"' AND b.type='photo' AND a.active ='1'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tORDER BY a.id DESC \")->result_array();\n\t\t\t\t\t\tforeach($all_photos as $key=>&$photo){\n\t\t\t\t\t\t $photo['complete_url'] = $this->module->getImageNow($photo['id'], 320, 's');\n\t\t\t\t\t\t $sk['photos'][] = $photo;\n\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t redirect('user/albums'); \n\t\t\t\t\t}\n\t\t\t\t\t$data['sk'] = $sk;\n\t\t\t\t\tif($json == true) {\n\t\t\t\t\t\theader('Content-type: text/json');\n\t\t\t\t\t\theader('Content-type: application/json');\n\t\t\t\t\t\tforeach($sk['photos'] as $key=>$photos){\n\t\t\t\t\t\t\t$sk['photos'][$key]['complete_url']=$this->module->getImageNow($photos['id'],150,'s'); \n\t\t\t\t\t\t}\n\t\t\t\t\t\techo json_encode($sk);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->load->view('user/album', $data); \n\t\t\t\t\t}\n\t\t\t\t} else{\n\t\t\t\t\tredirect(base_url('login').'?url='.base64_encode(uri_string()));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif($json == true) {\n\t\t\t\t\t$error = array(\n\t\t\t\t\t\t\t'status'=>417,\n\t\t\t\t\t\t\t'message'=>'Album id not exist'\n\t\t\t\t\t);\n\t\t\t\t\theader('Content-type: text/json');\n\t\t\t\t\theader('Content-type: application/json');\n\t\t\t\t\techo json_encode($error);\n\t\t\t\t} else {\n\t\t\t\t\tredirect('user/albums'); \n\t\t\t\t} \n\t\t\t}\n\t\t} else {\n\t\t\tif($json == true) {\n\t\t\t\t$error = array(\n\t\t\t\t\t\t'status'=>417,\n\t\t\t\t\t\t'message'=>'Album is mandatory'\n\t\t\t\t);\n\t\t\t\theader('Content-type: text/json');\n\t\t\t\theader('Content-type: application/json');\n\t\t\t\techo json_encode($error);\n\t\t\t} else {\n\t\t\t\tredirect('user/albums'); \n\t\t\t} \n\t\t}\n }", "public function photosAddView($id){\n $album = Albums::find($id);\n\n\n return view('albums.photos',compact('album'));\n }", "public function index()\n {\n $albums = Albums::where('ID_proprietaire', '=', Auth::user()->id)->get();\n\n\n return view('albums.index', compact('albums'));\n }", "public function album() {\n return $this->belongsTo('App\\Album');\n }", "public function show($item_id, $tag_id, $album_id) {\n // As of Gallery 3.0.3, it is no longer needed, now it just\n // redirects to the photo's primary URL to avoid breaking older links.\n item::set_display_context_callback(\"tag_albums_Controller::get_display_context\", $tag_id, $album_id);\n $item = ORM::factory(\"item\", $item_id);\n url::redirect(url::abs_site(\"{$item->type}s/{$item->id}\"));\n }", "function getViewPhotoNew($album_uid){\n \t// Get Smarty Instance\n \t$smartyInstance = tx_cwtcommunity_lib_common::getSmartyInstance();\n $conf = tx_cwtcommunity_lib_common::getConfArray();\n $tplPath = tx_cwtcommunity_lib_common::getTemplatePath($conf['template_photo_admin']);\n \n $albumData = self::getAlbum($album_uid);\n\t $form_action = tx_cwtcommunity_lib_common::getPageLink($conf['pid_gallery'],'', array(tx_cwtcommunity_lib_constants::CONST_ACTION => tx_cwtcommunity_lib_constants::ACTION_GALLERY_SHOW_PHOTO_NEW, tx_cwtcommunity_lib_constants::CONST_ALBUM_UID => $album_uid));\n\t \n $smartyInstance->assign('form_action', $form_action);\n $smartyInstance->assign('albumData', $albumData);\n \n $content .= $smartyInstance->display($tplPath);\n return $content;\n }", "public function show($id)\n {\n $album = Ablum::with('photos')->find($id);\n return view('albums.show')->with('album', $album);\n }", "public function index()\n {\n $albums = Ablum::with('photos')->get();\n return view('albums.index')->with('albums', $albums);\n }", "public function index($id)\n{\n\t$result= Album::find($id);\n\t$data=Photo::get()->where('id_albumu',$id);\n $data_1=Photo::get()->where('id',$result->id_zdjecia)->first();\n $commets=Comment::get()->where('id_albumu',$id);\n\treturn view('commentAlbum',['album'=>$result,'photo'=>$data_1,'komentarze'=>$commets]);\n}", "public function index(){\n $albums = Album::with('Photos')->get();\n return view('albums.index')->with('albums', $albums);\n }", "public function album()\n {\n return $this->belongsTo('App\\Album');\n }", "public function album()\n {\n return $this->belongsTo('App\\Album');\n }", "public function show(Album $album)\n {\n $this->authorize('show', $album);\n $albumes = User::find(Auth::id())->albums;\n return view('albums.show', [\n 'album' => $album,\n 'albumes' => $albumes,\n ]);\n //return $albumes;\n }", "function gallery($id = null){\r\n\t\t$this->Album->id = $id;\r\n\t\t$album = $this->Album->read();\r\n\t\t$this->set('album',$album);\r\n\t\t$this->set('path',$this->Admin->siteVar('imagepath'));\r\n\t\t$this->set('baseurl',$this->Admin->siteVar('absoluteimgurl'));\r\n\t\t\r\n\t\t$this->render('gallery','ajax');\r\n\t}", "public function details($aData)\n {\n /**\n * @var int\n */\n $iAlbumId = isset($aData['iAlbumId']) ? (int) $aData['iAlbumId'] : 0;\n \n if (!Phpfox::getUserParam('music.can_access_music'))\n {\n return array('result' => 0, 'error_code' => 1, 'message' => 'You don\\'t have permission to access music module!');\n }\n\t\t\n\t\tif (Phpfox::isUser() && Phpfox::isModule('notification'))\n\t\t{\n\t\t\tPhpfox::getService('notification.process')->delete('comment_music_album', $iAlbumId, Phpfox::getUserId());\n\t\t\tPhpfox::getService('notification.process')->delete('music_song_album', $iAlbumId, Phpfox::getUserId());\n\t\t\tPhpfox::getService('notification.process')->delete('music_album_like', $iAlbumId, Phpfox::getUserId());\n\t\t}\t\t\t\n\t\t/**\n * @var array\n */\n\t\t$aAlbum = Phpfox::getService('music.album')->getAlbum($iAlbumId);\n\t\t\n\t\tif (!isset($aAlbum['album_id']))\n\t\t{\n return array('result' => 0, 'error_code' => 1, 'message' => Phpfox::getPhrase('music.unable_to_find_the_album_you_are_looking_for'));\n\t\t}\n \n if (Phpfox::isModule('privacy') && !Phpfox::getService('privacy')->check('music_album', $aAlbum['album_id'], $aAlbum['user_id'], $aAlbum['privacy'], $aAlbum['is_friend'], true))\n {\n return array('result' => 0, 'error_code' => 1, 'message' => Phpfox::getPhrase('privacy.the_item_or_section_you_are_trying_to_view_has_specific_privacy_settings_enabled_and_cannot_be_viewed_at_this_time'));\n }\n \n return array(\n 'bIsLiked' => $aAlbum['is_liked'],\n 'bIsFriend' => $aAlbum['is_friend'],\n 'iAlbumId' => $aAlbum['album_id'],\n 'iViewId' => $aAlbum['view_id'],\n 'iPrivacy' => $aAlbum['privacy'],\n 'iPrivacyComment' => $aAlbum['privacy_comment'],\n 'bIsFeatured' => (bool) $aAlbum['is_featured'],\n 'bIsSponsor' => (bool) $aAlbum['is_sponsor'],\n 'iUserId' => $aAlbum['user_id'],\n 'sAlbumName' => $aAlbum['name'],\n 'iYear' => $aAlbum['year'],\n 'sImagePath' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['server_id'],\n 'path' => 'music.url_image',\n 'file' => $aAlbum['image_path'],\n 'suffix' => '_200',\n 'return_url' => true\n )\n ),\n 'iTotalTrack' => $aAlbum['total_track'],\n 'iTotalPlay' => $aAlbum['total_play'],\n 'iTotalComment' => $aAlbum['total_comment'],\n 'iTotalLike' => $aAlbum['total_like'],\n 'iTotalDislike' => $aAlbum['total_dislike'],\n 'fTotalScore' => $aAlbum['total_score'],\n 'iTotalRating' => $aAlbum['total_rating'],\n 'iTimeStamp' => $aAlbum['time_stamp'],\n 'sTimeStamp' => date('l, F j', $aAlbum['time_stamp']),\n 'sFullTimeStamp' => date('l, F j', $aAlbum['time_stamp']) . ' at ' . date('g:i a', $aAlbum['time_stamp']),\n 'sModuleId' => $aAlbum['module_id'],\n 'iItemId' => $aAlbum['item_id'],\n 'sDescription' => $aAlbum['text'],\n 'sUserName' => $aAlbum['user_name'],\n 'bHasRated' => $aAlbum['has_rated'],\n 'iProfilePageId' => $aAlbum['profile_page_id'],\n 'sUserImage' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['user_server_id'],\n 'path' => 'core.url_user',\n 'file' => $aAlbum['user_image'],\n 'suffix' => '_20_square',\n 'return_url' => true\n )\n ),\n 'sFullname' => $aAlbum['full_name'],\n 'iGender' => $aAlbum['gender'],\n 'bIsInvisible' => $aAlbum['is_invisible'],\n 'iUserGroupId' => $aAlbum['user_group_id'],\n 'iLanguageId' => $aAlbum['language_id'],\n 'bCanPostComment' => Phpfox::getService('mfox.comment')->checkCanPostCommentOnItem($aAlbum),\n 'sTitle' => ''\n );\n }", "function generateAlbumView($userId,$showEditImages,$rel,$albumName){\n\t$images_profile\t=$GLOBALS['cn']->query('\n\t\tSELECT i.id,i.image_path\n\t\tFROM images i\n\t\tJOIN album a ON a.id_user=i.id_user\n\t\tWHERE\n\t\t\ti.id_user='.$userId.' AND\n\t\t\ti.id_images_type=2 AND\n\t\t\ta.name=\"'.$albumName.'\" AND\n\t\t\ta.id_image_cover!=i.id\n\t\tORDER BY i.id DESC\n\t');\n\techo '<div style=\"display:none;\">';\n\twhile($image=mysql_fetch_assoc($images_profile)){\n\t\t$img_full_src=FILESERVER.'img/users/'.$image['image_path'];\n\t\t$showEditImages=($showEditImages?'&showMenu':'');\n\t\techo\n\t\t\t'<a id=\"'.md5($img_full_src).'\" class=\"grouped_PP\" rel=\"'.$rel.'\"'.\n\t\t\t\t'href=\"views/photos/picture.view.php?src='.$img_full_src.'&id_photo='.md5($image['id']).'&id_user='.$userId.$showEditImages.'\">'.\n\t\t\t\t'<img src=\"'.$img_full_src.'\" alt=\"\"/>'.\n\t\t\t'</a>';\n\t}\n\techo '</div>';\n}", "public function album()\n {\n return $this->hasOne('App\\Albumes', 'id', 'albumid');\n }", "function generateAlbumView($userId,$showEditImages,$rel,$albumName){\n\t$images_profile\t=$GLOBALS['cn']->query('\n\t\tSELECT i.id,i.image_path\n\t\tFROM images i\n\t\tJOIN album a ON a.id_user=i.id_user\n\t\tWHERE\n\t\t\ti.id_user='.$userId.' AND\n\t\t\ti.id_images_type=2 AND\n\t\t\ta.name=\"'.$albumName.'\" AND\n\t\t\ta.id_image_cover!=i.id\n\t\tORDER BY i.id DESC\n\t');\n\techo '<div style=\"display:none;\">';\n\twhile($image=mysql_fetch_assoc($images_profile)){\n\t\t$img_full_src=FILESERVER.'img/users/'.$image['image_path'];\n\t\t$showEditImages=($showEditImages?'&showMenu':'');\n\t\techo\n\t\t\t'<a id=\"'.md5($img_full_src).'\" class=\"grouped_PP\" rel=\"'.$rel.'\"'.\n\t\t\t\t'href=\"'.$GLOBALS['config']->main_server.'views/photos/picture.view.php?src='.$img_full_src.'&id_photo='.md5($image['id']).'&id_user='.$userId.$showEditImages.'\">'.\n\t\t\t\t'<img src=\"'.$img_full_src.'\" alt=\"\"/>'.\n\t\t\t'</a>';\n\t}\n\techo '</div>';\n}", "function getViewAlbumList($owner_uid) {\n\t\t// Get Smarty Instance\n \t$smartyInstance = tx_cwtcommunity_lib_common::getSmartyInstance();\n $conf = tx_cwtcommunity_lib_common::getConfArray();\n $tplPath = tx_cwtcommunity_lib_common::getTemplatePath($conf['template_album']);\n \n $albumData = self::getAlbumsForRole($owner_uid);\n \n foreach ($albumData as &$album) {\n \t$album['preview_pic'] = self::getPreviewPhotoURI($album['uid'], $conf);\n \t$album['photo_count'] = self::getPhotoCount($album['uid'], $conf); \n }\n \n // Provide smarty with the information for the template\n $smartyInstance->assign('albumData', $albumData);\n $smartyInstance->assign('owner_uid', $owner_uid);\n \n $content .= $smartyInstance->display($tplPath);\n return $content;\n\t}", "public function show($id){\n $lookback = 6; //jumlah bulan utk data dashboard\n\n if($id == 'plain_playlist'){ //return $id;\n $result = Playlist::where('status', '1')->orderBy('nama_playlist', 'asc')->get();\n }else if($id == 'totalMusicList'){\n $result = Music::where('status', 1)->count();\n }else if(strpos($id, 'totalPlaylist') !== false){\n $index = strpos($id, '_');\n $playlist = substr($id, ($index+1));\n $result = collect(self::flatten(Playlist::where(['status' => 1, 'id' => $playlist])\n ->with('music')->with('allChildrenContent')->get(), ''))->count();\n }else if($id == 'getMusicListByUploadDate'){\n $result = Music::latest()->where('status', '=', '1')->paginate(10);\n }else if($id == 'getMusicListByTitle'){\n $result = Music::orderBy('judul', 'ASC')->where('status', '=', '1')->paginate(10);\n }else if(strpos($id, 'playlist') !== false){\n //get playlist index\n $index = strpos($id, '-');\n $playlist = substr($id, ($index+1));\n\n //get sorting param\n preg_match('~_(.*?)@~', $id, $param); //get result in $param[1]\n preg_match('~@(.*?)-~', $id, $ascdesc); //return $ascdesc;\n \n $result = self::flatten(Playlist::where('id', $playlist)->with('music')->with('allChildrenContent')->get(), '');\n $result = collect($result)->paginate(10);\n }else if(strpos($id, 'searchMusic') !== false){ return $id;\n $params = str_replace('searchMusic?', '', $id);\n return $params;\n }else if($id == 'getUploadedMusicPerMonth'){\n $result = [];\n \n for($i=0; $i<$lookback; $i++){\n $date = Carbon::today()->subMonthsNoOverflow($i);\n $month_string = $date->format('M Y');\n $m = $date->format('m'); //return $m;\n $y = $date->format('Y'); //return $y;\n $year_month = $y.'-'.$m; //return $year_month;\n $data = MusicPlaylist::where('created_at', 'LIKE', \"{$year_month}%\")->count();\n\n $temp_array = array(\n 'label' => $month_string,\n 'data' => $data,\n );\n \n array_push($result, $temp_array);\n }\n }else if($id == 'getStorageUsagePerMonth'){\n $result = [];\n\n for($i=0; $i<$lookback; $i++){\n $date = Carbon::today()->subMonthsNoOverflow($i);\n $month_string = $date->format('M Y');\n $m = $date->format('m'); //return $m;\n $y = $date->format('Y'); //return $y;\n $year_month = $y.'-'.$m; //return $year_month;\n $data = round(Music::where('created_at', 'LIKE', \"{$year_month}%\")->sum('filesize')/pow(1024, 3), 2);\n\n $temp_array = array(\n 'label' => $month_string,\n 'data' => $data,\n );\n \n array_push($result, $temp_array);\n }\n }\n\n return $result;\n }", "public function ViewPhoto(){\n\n $photos = Gallery::with('category')->get();\n \n // $categoris = Category::orderBy('category_name', 'asc')->get();\n\n return view('backend.gallery.view_gallery', [\n 'photos' => $photos,\n // 'categoris' => $categoris,\n ]);\n }", "public function getAlbumsAction()\n {\n $em = $this->getDoctrine()->getManager();\n $albums = $em->getRepository(Album::class)->findAll();\n\n return $this->handleView($this->view($albums));\n }", "public function index()\n {\n $albums = Album::where('status', 'published')->where('album_id', NULL)->get();\n $tempArr = [];\n\n foreach ($albums as $item) {\n\n array_push(\n $tempArr,\n [\n 'name' => $item->name,\n\n 'biliner' => $item->biliner,\n 'slug' => $item->slug,\n 'album_id' => $item->album_id,\n 'status' => $item->status,\n 'album_imgUrl' => $item->getFirstMediaUrl('covers', 'cover'),\n\n ]\n );\n }\n\n return $tempArr;\n }", "public function afficherAlbum() {\n\t\tsession_start();\n\t\t$idAl = $this->route[\"params\"][\"id\"];\n\t\tif(isset($_POST['commentaire'])) {\n\t\t\t$comment = $_POST['commentaire'];\n\t\t\t$idU = $_SESSION['id'];\n\t\t\tCommentaire::ajouterCommentaire($idAl,$idU,$comment);\n\t\t}\n\t\tif(isset($_POST['note'])){\n\t\t\t$note = $_POST['note'];\n\t\t\t$idU = $_SESSION['id'];\n\t\t\tNote::ajouterNote($idAl,$idU,$note);\n\t\t}\n\t\t//$this->view->note = Note::CalculMoyFromId($idAl);\n\t\t$this->view->album = Album::getFromId($idAl);\n\t\t$this->view->com = Commentaire::getListeFromAlbum($idAl);\n\t\t$this->view->display();\n\t}", "public function album($id) {\n // tagged with one or more tags.\n\n // Load the specified ID to make sure it exists.\n $album_tags = ORM::factory(\"tags_album_id\")\n ->where(\"id\", \"=\", $id)\n ->find_all();\n\n // If it doesn't exist, redirect to the modules root page.\n if (count($album_tags) == 0) {\n url::redirect(\"tag_albums/\");\n }\n\n // If it does exist, and is set to *, load a list of all tags.\n if ($album_tags[0]->tags == \"*\") {\n $this->index($id, \"\");\n } else {\n // Otherwise, populate this page with the specified items.\n\n // Inherit permissions, title and description from the album that linked to this page.\n $album = ORM::factory(\"item\", $album_tags[0]->album_id);\n access::required(\"view\", $album);\n $page_title = $album->title;\n $page_description = $album->description;\n\n // URL to this page\n $str_page_url = \"tag_albums/album/\" . $id . \"/\" . urlencode($album->name);\n\n // Determine page sort order.\n $sort_page_field = $album->sort_column;\n $sort_page_direction = $album->sort_order;\n\n // Determine search type (AND/OR) and generate an array of the tag ids.\n $tag_ids = Array();\n foreach (explode(\",\", $album_tags[0]->tags) as $tag_name) {\n $tag = ORM::factory(\"tag\")->where(\"name\", \"=\", trim($tag_name))->find();\n if ($tag->loaded()) {\n $tag_ids[] = $tag->id;\n }\n }\n $album_tags_search_type = $album_tags[0]->search_type;\n\n // Figure out how many items to display on each page.\n $page_size = module::get_var(\"gallery\", \"page_size\", 9);\n\n // If this page was reached from a breadcrumb, figure out what page to load from the show id.\n $show = Input::instance()->get(\"show\");\n if ($show) {\n $child = ORM::factory(\"item\", $show);\n $index = $this->_get_position($child->$sort_page_field, $child->id, $tag_ids, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, true);\n if ($index) {\n $page = ceil($index / $page_size);\n if ($page == 1) {\n url::redirect($str_page_url);\n } else {\n url::redirect($str_page_url . \"?page=$page\");\n }\n }\n }\n\n // Figure out how many items are in this \"virtual album\"\n $count = $this->_count_records($tag_ids, $album_tags_search_type, true);\n\n // Figure out which page # the visitor is on and\n // don't allow the visitor to go below page 1.\n $page = Input::instance()->get(\"page\", 1);\n if ($page < 1) {\n url::redirect($str_page_url);\n }\n\n // First item to display.\n $offset = ($page - 1) * $page_size;\n\n // Figure out what the highest page number is.\n $max_pages = ceil($count / $page_size);\n\n // Don't let the visitor go past the last page.\n if ($max_pages && $page > $max_pages) {\n url::redirect($str_page_url . \"/?page=$max_pages\");\n }\n\n // Figure out which items to display on this page and store their details in $children.\n $tag_children = $this->_get_records($tag_ids, $page_size, $offset, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, true); \n\n // Set up the previous and next page buttons.\n if ($page > 1) {\n $previous_page = $page - 1;\n $view->previous_page_link = url::site($str_page_url . \"/?page={$previous_page}\");\n }\n if ($page < $max_pages) {\n $next_page = $page + 1;\n $view->next_page_link = url::site($str_page_url . \"/?page={$next_page}\");\n }\n\n // Set up breadcrumbs.\n $tag_album_breadcrumbs = array();\n $counter = 0;\n $tag_album_breadcrumbs[] = Breadcrumb::instance($album->title, $album->url())->set_last();\n $parent_item = ORM::factory(\"item\", $album->parent_id);\n while ($parent_item->id != 1) {\n $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url());\n $parent_item = ORM::factory(\"item\", $parent_item->parent_id);\n }\n $tag_album_breadcrumbs[] = Breadcrumb::instance($parent_item->title, $parent_item->url())->set_first();\n $tag_album_breadcrumbs[1]->url .= \"?show=\" . $album->id;\n\t \n $tag_album_breadcrumbs = array_reverse($tag_album_breadcrumbs, true);\n\n // Set up and display the actual page.\n $template = new Theme_View(\"page.html\", \"collection\", \"Tag Albums\");\n $template->set_global(\n array(\"page\" => $page,\n \"max_pages\" => $max_pages,\n \"page_size\" => $page_size,\n \"children\" => $tag_children,\n \"breadcrumbs\" => $tag_album_breadcrumbs,\n \"children_count\" => $count));\n $template->page_title = $page_title;\n $template->content = new View(\"dynamic.html\");\n $template->content->title = $page_title;\n $template->content->description = $page_description;\n\n $template->set_global(\"all_siblings\", $this->_get_records($tag_ids, $count, 0, \"items.\" . $sort_page_field, $sort_page_direction, $album_tags_search_type, false));\n print $template;\n\n // Set breadcrumbs on the photo pages to point back to the calendar day view.\n item::set_display_context_callback(\"tag_albums_Controller::get_display_context\", 0, $id);\n }\n }", "public function displayAlbumList()\n\t{\n\t\tglobal $smartyObj;\n\t\t$displayalbumList_arr = array();\n\t\t$displayalbumList_arr['row'] = array();\n\t\t$inc = 1;\n\t\twhile($row = $this->fetchResultRecord())\n\t\t{\n\t\t\tif(!isset($row['user_name']))\n\t\t\t{\n\t\t\t\t$displayalbumList_arr['row'][$inc]['name'] = $this->getUserDetail('user_id', $row['user_id'], 'user_name');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$name = $this->CFG['format']['name'];\n\t\t\t\t$name = str_replace('$first_name', $row['first_name'],$name);\n\t\t\t\t$name = str_replace('$last_name', $row['last_name'],$name);\n\t\t\t\t$name = str_replace('$user_name', $row['user_name'],$name);\n\t\t\t\t$displayalbumList_arr['row'][$inc]['name'] = $name;\n\t\t\t}\n\t\t\t$row['music_featured'] = $row['album_featured']?$row['album_featured']:'No';\n\t\t\t$row['total_music'] = $this->getmusicCount($row['music_album_id']);\n\t\t\t$displayalbumList_arr['row'][$inc]['record'] = $row;\n\t\t\t$inc++;\n\t\t}\n\t\t$smartyObj->assign('displayalbumList_arr', $displayalbumList_arr);\n\t}", "public function show(Photo $photo)\n {\n //\n }", "public function show(Photo $photo)\n {\n //\n }", "public function show(Photo $photo)\n {\n //\n }", "public function getAlbum()\n {\n return $this->album;\n }", "public function getAlbum()\n {\n return $this->album;\n }", "public function index()\n {\n // $albums = Album::get();\n // $albums = Album::where('created_by_id',auth()->id())->get();\n // $albums = auth()->user()->load('albums');\n // dd($albums);\n\n $albums = auth()->user()->albums()->withCount('photos')->get();\n // dd($albums);\n return view('albums.create')->with('albums', $albums);\n }", "public function index()\n {\n $songs = DB::table('songs')->get();\n $albums = DB::table('albums')->inRandomOrder()->limit(3)->get();\n foreach ($albums as $album){\n $url = Storage::url($album->imgPath);\n $album->imgPath = $url;\n }\n return view('song.index', compact('songs', 'albums'));\n }", "public function EditPhoto($id){\n\n $photos = Gallery::findOrfail($id);\n\n $categoris = Category::orderBy('category_name', 'asc')->get();\n\n return view('backend.gallery.edit_gallery', compact('photos', 'categoris'));\n}", "public function show($slug)\n {\n $pesanan = Pesanan::where('slug', $slug)->first();\n $title = \"Photo $pesanan->nama1 dan $pesanan->nama2\";\n $photo = Photo::where('id_pesanan', $pesanan->id)->paginate(4);\n return view('photo.show', ['title' => $title, 'photo' => $photo, 'pesanan' => $pesanan]);\n }", "public function show($id)\n {\n //$photes = Phote::paginate(10);\n //搜尋\n $photealbum = Photealbum::find($id);\n $photes = Phote::where('belong', '=', $photealbum->title)->paginate(10);\n return view('photes.index', compact('photes','photealbum'));\n }", "public function index()\n {\n $albums = Album::get();\n return view('gallery.albums.index')->with('albums', $albums);\n }", "function index($id = null){\r\n\t\t$this->checkSession();\r\n\t\tif($id == null){\r\n\t\t\t$datas = $this->Album->findAll();\r\n\t\t\t$this->set('viewtype', \"multiview\");\r\n\t\t}else{\r\n\t\t\t# string $conditions\r\n\t\t\t# array $fields\r\n\t\t\t# string $order\r\n\t\t\t# int $limit\r\n\t\t\t# int $page\r\n\t\t\t# int $recursive\r\n\r\n\t\t\t$this->Album->id = $id;\r\n\t\t\t$datas = $this->Album->read();\r\n\t\t\t$this->set('viewtype',\"singleview\");\r\n\t\t}\r\n\t\tvendor('JSON');\r\n\t\t$allist = $this->Album->findAll();\r\n\t\t$js = new Services_JSON();\r\n\t\t$this->set('alist',$js->encode($allist));\r\n\t\t$this->set('datas', $datas);\r\n\t\t$this->render('editview','ajax');\t\t\r\n\t}", "function getalbumimagedetails($albumid, $imageid) {\n\n try {\n $query = \"select * from Tbl_C_AlbumImage where albumId = :albumid AND autoId = :imgid\";\n $stmt = $this->DB->prepare($query);\n $stmt->bindParam(':albumid', $albumid, PDO::PARAM_STR);\n $stmt->bindParam(':imgid', $imageid, PDO::PARAM_STR);\n $stmt->execute();\n } catch (PDOException $e) {\n echo $e;\n }\n\n $rows = $stmt->fetchAll();\n $response[\"success\"] = 1;\n $response[\"message\"] = \"Displaying Album Image details\";\n $response[\"posts\"] = array();\n\n if ($rows) {\n for ($i = 0; $i < count($rows); $i++) {\n $post[\"post_title\"] = $rows[$i][\"title\"];\n $post[\"post_img\"] = $rows[$i][\"imgName\"];\n array_push($response[\"posts\"], $post);\n }\n return json_encode($response);\n }\n }", "public function show($id)\n\t{\n\t\tif (Request::ajax()) {\n\t\t\t$album = Album::with('images')->find($id);\n\t\t\treturn $album;\n\t\t}\n\t}", "public function indexAction() {\n $paginator = $this->getAlbumTable()->fetchAll(true);\n // set the current page to what has been passed in query string, or to 1 if none set\n $paginator->setCurrentPageNumber((int) $this->params()->fromQuery('page', 1));\n // set the number of items per page to 10\n $paginator->setItemCountPerPage(10);\n\n return new ViewModel(array(\n 'paginator' => $paginator\n ));\n }", "public function index(Request $request)\n {\n //DB::table('albums')\n $queryBilder = Album::orderBy('id', 'DESC')->limit(5)->withCount('photos');\n \n if ($request->has('id')) {\n $queryBilder->where('id','=',$request->input('id'));\n }\n\n if ($request->has('album_name')) {\n $queryBilder->where('album_name','like',$request->input('album_name').'%'); \n }\n \n\n $albums = $queryBilder->paginate(env('PAGE_PER_PAGE'));\n //dd($albums);\n return view('albums', ['albums' => $albums]);\n }", "public function showAction(Musicien $musicien)\n {\n\n //Pour les $oeuvres\n $em = $this->getDoctrine()->getManager();\n\n\n $qbd = $em->createQueryBuilder('a');\n $qbd->select('a')\n ->from('MonBundle:Album', 'a')\n ->innerJoin('MonBundle:Disque', 'd', 'WITH', 'd.codeAlbum = a.codeAlbum')\n ->innerJoin('MonBundle:CompositionDisque', 'cd', 'WITH', 'cd.codeDisque = d.codeDisque')\n ->innerJoin('MonBundle:Enregistrement', 'e', 'WITH', 'e.codeMorceau = cd.codeMorceau')\n ->innerJoin('MonBundle:CompositionOeuvre', 'co', 'WITH', 'co.codeComposition = e.codeComposition')\n ->innerJoin('MonBundle:Composer', 'c', 'WITH', 'c.codeOeuvre = co.codeOeuvre')\n ->where('c.codeMusicien = :codeM' )\n ->setParameter('codeM',$musicien->getCodeMusicien())\n ->add('orderBy', 'a.titreAlbum ASC');\n $albums = $qbd->getQuery()->getResult();\n\n\n\n return $this->render('MonBundle:musicien:show.html.twig', array(\n 'musicien' => $musicien,\n 'oeuvres' => $albums,\n ));\n }", "function song_list_thumbnail($songList)\n{\n\tforeach ($songList as $song) {\n\t\t$id = $song->song_id;\n\t\t$title = $song->song_title;\n\t\t$year = $song->song_year;\n\t\techo \"<div class='col-md-6' data-toggle='tooltip' data-placement='top' title='$title'> \";\n\t\t\techo a_open(\"thumbnail\", base_url().\"song/$id\");\n\t\t\t\techo img(\"data/music/songs/$id/cover.png\");\n\t\t\techo a_close();\n\t\techo div_close();\n\t}\n}", "function album($id) {\n\n // Get nickname\n if (isset($_SESSION['nickname'])) $nn = $_SESSION['nickname'];\n else $nn = 'nobody';\n\n $this->pager->limit = $this->per_page;\n\n // Start pager\n $this->pager->setStart();\n\n // \"Cache Groups\" using a vertical bar |\n $cache_id = \"$nn|album|{$id}|\" . $this->pager->start;\n $this->tpl->caching = 1;\n\n if (!$this->tpl->isCached('album.tpl', $cache_id)) {\n\n $this->pager->setPages($this->photo->countPhotos($id));\n $this->r->text['pager'] = $this->pager->pageList(suxFunct::makeUrl(\"/photos/album/{$id}\"));\n $this->r->arr['photos'] = $this->photo->getPhotos($this->pager->limit, $this->pager->start, $id);\n $this->r->arr['album'] = $this->photo->getAlbumByID($id);\n\n if ($this->r->arr['album'] && $this->r->arr['photos'] && (is_countable($this->r->arr['photos']) ? count($this->r->arr['photos']) : 0))\n {\n $tmp = $this->user->getByID($this->r->arr['album']['users_id']);\n $this->r->arr['album']['nickname'] = $tmp['nickname'];\n $this->r->title .= \" | {$this->r->gtext['photos']} | {$this->r->arr['album']['title']}\";\n }\n\n else {\n $this->tpl->caching = 0; // Nothing to cache, avoid writing to disk\n }\n\n }\n\n $this->tpl->display('album.tpl', $cache_id);\n\n }", "private function fetchDetails(Album $album)\n {\n $spotifyAlbum = $this->getSpotifyApi()->getAlbum($album->getAlbumId());\n\n $tracks = $spotifyAlbum['tracks'];\n\n foreach ($tracks['items'] as $track) {\n\n $albumTrack = new AlbumTrack();\n\n $albumTrack->setAlbum($album);\n $albumTrack->setTrackId($track['id']);\n $albumTrack->setDiscNumber($track['disc_number']);\n $albumTrack->setName($track['name']);\n $albumTrack->setPreviewUrl($track['preview_url']);\n $albumTrack->setTrackNumber($track['track_number']);\n $albumTrack->setType($track['type']);\n $albumTrack->setUri($track['uri']);\n\n if ($track['explicit'] == true) {\n $albumTrack->setExplicit(true);\n } else {\n $albumTrack->setExplicit(false);\n }\n\n $hydrator = new ObjectProperty();\n $data = $hydrator->extract($albumTrack);\n $this->getAlbumTrackGateway()->insert($data);\n }\n\n $this->getAlbumGateway()->update(['fetched_detail' => true],\n ['album_id' => $album->getAlbumId()]);\n }", "public function getArtist() {}", "public function actionView($id)\r\n {\r\n unset($_GET['id']);\r\n $_GET['album'] = $id;\r\n $this->forward('photo/member');\r\n /*\r\n $this->render('view', array(\r\n 'model' => $this->loadModel($id),\r\n ));\r\n */\r\n }", "public function index($albumId)\n\t{\n\t\t$navActive = 'gallery';\n\t\t$album = Album::find($albumId);\n\t\t$photos = $album->photos()->paginate(8);\n\t\treturn View::make('photos.index')->with(['navActive' => $navActive, 'album' => $album, 'photos' => $photos,]);\n\t}", "public function albums()\n {\n return $this\n ->hasMany('App\\Album', 'artist')\n ->selectRaw('*, albums.title as album_title, albums.slug as album_slug, count(songs.id) as song_total')\n ->leftJoin('songs', 'albums.id', '=', 'songs.album')\n ->orderBy('released', 'asc')\n ->groupBy('albums.id');\n }", "private function getAlbums($aData)\n {\n /**\n * @var string\n */\n $sAction = (isset($aData['sAction']) && $aData['sAction'] == 'new') ? 'new' : 'more';\n /**\n * @var int\n */\n $iLastTimeStamp = isset($aData['iLastTimeStamp']) ? (int) $aData['iLastTimeStamp'] : 0;\n /**\n * @var string\n */\n $sView = isset($aData['sView']) ? $aData['sView'] : '';\n /**\n * @var int\n */\n $iAmountOfAlbum = isset($aData['iAmountOfAlbum']) ? (int) $aData['iAmountOfAlbum'] : 10;\n /**\n * @var string\n */\n $sSearch = isset($aData['sSearch']) ? $aData['sSearch'] : '';\n /**\n * @var array\n */\n $aCond = array();\n\n if (!empty($sSearch))\n {\n $aCond[] = 'm.name LIKE \"' . Phpfox::getLib('parse.input')->clean('%' . $sSearch . '%') . '\"';\n }\n switch ($sView) {\n case 'my':\n $aCond[] = 'm.user_id = ' . Phpfox::getUserId();\n break;\n\n case 'all':\n default:\n $aCond[] = 'm.view_id = 0';\n $aCond[] = 'm.privacy IN(0)';\n break;\n }\n if ($iLastTimeStamp > 0)\n {\n if ($sAction == 'more')\n {\n $aCond[] = 'm.time_stamp < ' . $iLastTimeStamp;\n }\n else\n {\n $aCond[] = 'm.time_stamp > ' . $iLastTimeStamp;\n }\n }\n $this->database()\n ->select('COUNT(*)')\n ->from(Phpfox::getT('music_album'), 'm');\n /**\n * @var int\n */\n $iCount = $this->database()\n ->where(implode(' AND ', $aCond))\n ->limit(1)\n ->execute('getField');\n if ($iCount == 0)\n {\n return array();\n }\n /**\n * @var array\n */\n $aAlbums = $this->database()\n ->select('lik.like_id AS is_liked, m.*, u.user_id, u.profile_page_id, u.server_id AS user_server_id, u.user_name, u.full_name, u.gender, u.user_image, u.is_invisible, u.user_group_id, u.language_id')\n ->from(Phpfox::getT('music_album'), 'm')\n ->leftJoin(Phpfox::getT('like'), 'lik', 'lik.type_id = \\'music_album\\' AND lik.item_id = m.album_id AND lik.user_id = ' . Phpfox::getUserId())\n ->join(Phpfox::getT('user'), 'u', 'u.user_id = m.user_id')\n ->where(implode(' AND ', $aCond))\n ->order('m.time_stamp DESC')\n ->limit(0, $iAmountOfAlbum, $iCount)\n ->execute('getRows');\n /**\n * @var array\n */\n $aResult = array();\n foreach ($aAlbums as $aAlbum)\n {\n $aResult[] = array(\n 'bIsLiked' => isset($aAlbum['is_liked']) ? (bool) $aAlbum['is_liked'] : false,\n 'iAlbumId' => $aAlbum['album_id'],\n 'iViewId' => $aAlbum['view_id'],\n 'iPrivacy' => $aAlbum['privacy'],\n 'iPrivacyComment' => $aAlbum['privacy_comment'],\n 'bIsFeatured' => (bool) $aAlbum['is_featured'],\n 'bIsSponsor' => (bool) $aAlbum['is_sponsor'],\n 'iUserId' => $aAlbum['user_id'],\n 'sName' => $aAlbum['name'],\n 'iYear' => $aAlbum['year'],\n 'sImagePath' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['server_id'],\n 'path' => 'music.url_image',\n 'file' => $aAlbum['image_path'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'iTotalTrack' => $aAlbum['total_track'],\n 'iTotalPlay' => $aAlbum['total_play'],\n 'iTotalComment' => $aAlbum['total_comment'],\n 'iTotalLike' => $aAlbum['total_like'],\n 'iTotalDislike' => $aAlbum['total_dislike'],\n 'iTotalScore' => $aAlbum['total_score'],\n 'iTotalRating' => $aAlbum['total_rating'],\n 'iTimeStamp' => $aAlbum['time_stamp'],\n 'sTimeStamp' => date('l, F j', $aAlbum['time_stamp']),\n 'sFullTimeStamp' => date('l, F j', $aAlbum['time_stamp']) . ' at ' . date('g:i a', $aAlbum['time_stamp']),\n 'sModuleId' => isset($aAlbum['module_id']) ? $aAlbum['module_id'] : 0,\n 'iItemId' => $aAlbum['item_id'],\n 'iProfilePageId' => $aAlbum['profile_page_id'],\n 'iUserServerId' => $aAlbum['user_server_id'],\n 'sUsername' => $aAlbum['user_name'],\n 'sFullname' => $aAlbum['full_name'],\n 'iGender' => $aAlbum['gender'],\n 'sUserImage' => Phpfox::getLib('image.helper')->display(array(\n 'server_id' => $aAlbum['user_server_id'],\n 'path' => 'core.url_user',\n 'file' => $aAlbum['user_image'],\n 'suffix' => '_50_square',\n 'return_url' => true\n )\n ),\n 'bIsInvisible' => $aAlbum['is_invisible'],\n 'iUserGroupId' => $aAlbum['user_group_id'],\n 'iLanguageId' => isset($aAlbum['language_id']) ? $aAlbum['language_id'] : 0\n );\n }\n return $aResult;\n }", "public function show($id)\n {\n $album = Album::with('photos')->find($id);\n return view('gallery.albums.show')->with('album', $album);\n }", "public function show_column_photos(){\n $sql=\"SELECT * FROM photos WHERE img_navigacija_id=3\";\n $result=self::$connect->query($sql);\n $rows=array();\n while($row=$result->fetch(PDO::FETCH_ASSOC)){\n $rows[]=$row;\n $this->name=array_column($rows, 'name');\n $this->id=array_column($rows, 'id');\n }\n\n }", "function get_arsip_foto($limit,$offset, $id_album){\n\t\t$where=\"WHERE id_album='\".$id_album.\"'\";\n\t\t$page=$offset;\n\t\tif(!$page):\n\t\t$offset = 0;\n\t\telse:\n\t\t$offset = $page;\n\t\tendif;\n\t\n\t\t$tot_hal = $this->db->query(\"select * from foto where id_album='$id_album'\");\n\t\t$config['base_url'] = site_url('web/album/index/');\n\t\t$config['total_rows'] = $tot_hal->num_rows();\n\t\t$config['per_page'] = $limit;\n\t\t$config['uri_segment'] = 4;\n\t\t$config['first_link'] = ' << ';\n\t\t$config['last_link'] = ' >> ';\n\t\t$config['next_link'] = ' > ';\n\t\t$config['prev_link'] = ' < ';\n\t\t$config['full_tag_open'] = \"<ul class='pagination'>\";\n\t\t$config['full_tag_close'] =\"</ul>\";\n\t\t$config['num_tag_open'] = '<li>';\n\t\t$config['num_tag_close'] = '</li>';\n\t\t$config['cur_tag_open'] = \"<li class='disabled'><li class='active'><a href='#'>\";\n\t\t$config['cur_tag_close'] = \"<span class='sr-only'></span></a></li>\";\n\t\t$config['next_tag_open'] = \"<li>\";\n\t\t$config['next_tagl_close'] = \"</li>\";\n\t\t$config['prev_tag_open'] = \"<li>\";\n\t\t$config['prev_tagl_close'] = \"</li>\";\n\t\t$config['first_tag_open'] = \"<li>\";\n\t\t$config['first_tagl_close'] = \"</li>\";\n\t\t$config['last_tag_open'] = \"<li>\";\n\t\t$config['last_tagl_close'] = \"</li>\";\n\t\t$this->pagination->initialize($config);\n\n\t\treturn $w = $this->db->query(\"select * from foto \".$where.\" order by id_foto DESC limit \".$offset.\", \".$limit.\"\");\n\t}", "public function index($id)\n {\n $data['photos'] = Photo::where('album_id', $id)->get();\n return view('admin.photos', $data);\n }", "public function show(Fotos $fotos)\n {\n //\n }", "public function show($id)\n {\n $photos = PhotoManager::getPhotos($id, 24);\n\n if ($photos) return view('photos.album', ['photos' => $photos]);\n\n abort(404, 'Album not found.');\n }" ]
[ "0.6476811", "0.6228056", "0.62186646", "0.6129683", "0.6128875", "0.6073477", "0.60687965", "0.60586727", "0.6049826", "0.6034131", "0.59840953", "0.59683067", "0.5873357", "0.58716583", "0.58709997", "0.5848816", "0.5836596", "0.5801215", "0.57915664", "0.57728875", "0.57611555", "0.57441205", "0.57272655", "0.57270795", "0.57243687", "0.5723477", "0.571581", "0.56860125", "0.5684367", "0.5675092", "0.5665559", "0.56652766", "0.5655883", "0.5652822", "0.56365675", "0.56113684", "0.55924094", "0.5591876", "0.5586054", "0.5575186", "0.556849", "0.5561518", "0.5551731", "0.55476457", "0.5542717", "0.55411077", "0.5525607", "0.551968", "0.55146927", "0.55130273", "0.55046296", "0.55015683", "0.5501147", "0.5496197", "0.5476529", "0.5476529", "0.5475673", "0.54732555", "0.54725933", "0.5471937", "0.5463062", "0.5462116", "0.54609674", "0.5451955", "0.5450332", "0.54405457", "0.5439298", "0.5438274", "0.5434673", "0.5429527", "0.54239434", "0.54239434", "0.54239434", "0.54160726", "0.54160726", "0.5414382", "0.5408125", "0.540367", "0.5381523", "0.5378411", "0.5376088", "0.5361895", "0.53598714", "0.5354609", "0.5338916", "0.5331608", "0.53271", "0.5313772", "0.53080064", "0.5304305", "0.5300938", "0.5297552", "0.52925324", "0.5282341", "0.52711076", "0.5261126", "0.5254256", "0.52518314", "0.5249607", "0.52480024", "0.5247493" ]
0.0
-1
Load configuration from file alone.
public function testConfigFromSingleFile() { $cfg = new Configuration(); $cfg->setBaseDirectories($this->dirs); $config = $cfg->load("view"); $this->assertInternalType("array", $config); $this->assertArrayHasKey("file", $config); $this->assertArrayHasKey("config", $config); $this->assertArrayNotHasKey("items", $config); $this->assertContains("a view", $config["config"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract function loadConfig($fileName);", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "abstract protected function loadConfig();", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "public function load_config($file = '')\n {\n return $this->{$this->_driver}->load_config($file);\n }", "public function loadConfig($file)\n {\n $options = [];\n try {\n $loader = new PhpConfig();\n $options = $loader->read($file);\n } catch (\\Exception $e) {\n Log::warning($e->getMessage());\n }\n\t\t$this->config('options', $options);\n\t}", "public function loadConfig($file) {\n $config = array();\n if (file_exists(PATH_CONFIGS . $file))\n include(PATH_CONFIGS . $file);\n if (!empty($config)) {\n foreach ($config as $name => $array) {\n $this->configs[$name] = $array;\n }\n }\n }", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "static public function load($filename) {\n\t\t$filename .= '.php';\n\n\t\tif (!file_exists($filename)) {\n\t\t\tthrow new \\Exception('Configuration file not found: ' . $filename);\n\t\t}\n\n\t\tinclude $filename;\n\n\t\tif (!isset($config)) {\n\t\t\tthrow new \\Exception('No variable $config found in ' . $filename);\n\t\t}\n\n\t\tself::$values = $config;\n\t}", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::APP_CONFIG);\n $this->config = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal\n }\n\n $this->is_loaded = TRUE;\n }", "public function loadYamlConfig($filepath);", "function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "public static function read_config_file($file)\n\t{\n\t\tif (!file_exists($file) || !is_readable($file))\n\t\t{\n\t\t\tdie('<p>The Salve configuration file could not be found or is inaccessible. Check your configuration.</p>');\n\t\t}\n\n\t\trequire($file);\n\t}", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "private function _loadConfig($options) {\n\n $conf_file = NULL;\n if (isset($options ['config'])) {\n $conf_file = $options ['config'];\n } else if (isset($options ['c'])) {\n $conf_file = $options ['c'];\n }\n\n if ($conf_file !== NULL && !file_exists($conf_file)) {\n $this->log(\"file does not exists\", self::ERROR);\n exit;\n }\n\n if ($conf_file !== NULL && file_exists($conf_file)) {\n $this->_config = parse_ini_file($conf_file, true);\n return $this;\n }\n }", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "function loadConfigFile ($fileName) {\n\t\tif (file_exists ($fileName)) {\n\t\t\tif (is_readable ($fileName)) {\n\t\t\t\t$configItems = array ();\n\t\t\t\tinclude ($fileName);\n\t\t\t\t$this->loadConfigArray ($configItems);\n\t\t\t} else {\n\t\t\t\treturn new Error ('CONFIG_FILE_NOT_READABLE', $fileName);\n\t\t\t}\n\t\t} else {\n\t\t\treturn new Error ('CONFIG_FILE_NOT_FOUND', $fileName);\n\t\t}\n\t}", "public static function loadConfig($configFile) {\n\t}", "private function apiConfigFromFile(string $file = null)\r\n {\r\n $file = is_null($file) ? getenv(\"HOME\") . \"config.json\" : $file;\r\n if (empty($this->api_key) === false || empty($this->api_secret) === false) {\r\n return;\r\n }\r\n if (file_exists($file) === false) {\r\n echo \"Unable to load config from: \" . $file . PHP_EOL;\r\n echo \"API KEY or SECRET not found\" . PHP_EOL;\r\n return;\r\n }\r\n $contents = json_decode(file_get_contents($file), true);\r\n $this->api_key = isset($contents['api-key']) ? $contents['api-key'] : \"\";\r\n $this->api_secret = isset($contents['api-secret']) ? $contents['api-secret'] : \"\";\r\n }", "public function loadConfig($filename)\n {\n return $this->getConfig()->loadConfig($filename);\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "protected function loadConfig($file)\n {\n if (!(file_exists($file) && is_readable($file))) {\n throw new Exception(sprintf(\"File %s not exist or not readable!\", self::CONFIG_FILE_NAME));\n }\n\n $config = json_decode(file_get_contents($file), true);\n\n if (!is_array($config)\n || !array_key_exists(static::GENERAL_CONFIG_KEY, $config)\n || (!array_key_exists(static::PHP_CONTAINERS_CONFIG_KEY, $config)\n || !is_array($config[static::PHP_CONTAINERS_CONFIG_KEY]))\n ) {\n throw new Exception(sprintf(\"Invalid configuration in %s!\", $file));\n }\n\n $this->config = $config;\n\n return $this;\n }", "function load_config($path) {\n \n // Check path\n if(file_exists($path) == false) {\n throw new Exception(\"Unable to load configuration -- file not found: $path\");\n }\n \n // Check file\n if(is_file($path) == false) {\n throw new Exception(\"Unable to load configuration -- not a file: $path\");\n }\n \n // Check permissions\n if(is_readable($path) == false) {\n throw new Exception(\"Unable to load configuration -- access denied: $path\");\n }\n \n // Check size \n if(filesize($path) == 0) {\n throw new Exception(\"Unable to load configuration -- file is empty: $path\");\n }\n \n // Load parser\n require_once(YAML_PARSER);\n \n // Load config\n $config = Spyc::YAMLLoad($path);\n \n // Check result - if empty, throw an exception\n if(sizeof($config) == 0) {\n throw new Exception(\"Unable to load configuration -- parse error: $path\");\n }\n \n // General application options\n if(isset($config['info']['name'])) { $this->set_name($config['info']['name']); }\n if(isset($config['info']['admin email'])) { $this->set_admin_email($config['info']['admin email']); }\n if(isset($config['info']['admin name'])) { $this->set_admin_name($config['info']['admin name']); }\n if(isset($config['info']['base url'])) { $this->set_base_url($config['info']['base url']); }\n if(isset($config['info']['base directory'])) { $this->set_base_dir($config['info']['base directory']); }\n \n // Database\n if(isset($config['database']['name'])) { \n \n // Initialize db object\n $this->db = new StanfordDatabase();\n \n // Credentials\n if(isset($config['database']['name'])) { $this->db->set_database($config['database']['name']); }\n if(isset($config['database']['username'])) { $this->db->set_username($config['database']['username']); }\n if(isset($config['database']['password'])) { $this->db->set_password($config['database']['password']); }\n \n // Encryption\n if(isset($config['database']['use encryption'])) { $this->db->use_encryption($config['database']['use encryption']); }\n else { $this->db->use_encryption(false); }\n\n }\n \n // Use mysql sessions set to true\n if(isset($config['database']['use mysql sessions']) && $config['database']['use mysql sessions'] == true ) {\n \n // Check DB\n if($this->db instanceof StanfordDatabase) {\n \n // Enable MySQL sessions\n $this->db->setup_mysql_sessions();\n \n }\n else {\n \n // DB not configured\n throw new Exception(\"Cannot enable MySQL-based sessions -- database credentials not provided\"); \n \n }\n }\n \n // Logging\n if(isset($config['settings']['logging mode'])) {\n $this->util->set_error_reporting($config['settings']['logging mode']);\n }\n \n // Undo magic quotes\n if(isset($config['settings']['undo magic quotes']) && $config['settings']['undo magic quotes'] == true) {\n $this->util->undo_magic_quotes();\n }\n }", "function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)\n {\n $file = ($file == '') ? 'config' : str_replace(EXT, '', $file);\n\n if (in_array($file, $this->is_loaded, TRUE))\n {\n return TRUE;\n }\n\n // {{{ Matchbox\n\n $ci = &get_instance();\n $module = $ci->matchbox->argument(3);\n\n if (!$filepath = $ci->matchbox->find('config/' . $file . EXT, $module)) {\n if ($fail_gracefully === true) {\n return false;\n }\n\n show_error('The configuration file ' . $file . EXT . ' does not exist.');\n }\n\n include($filepath);\n\n // }}}\n\n if ( ! isset($config) OR ! is_array($config))\n {\n if ($fail_gracefully === TRUE)\n {\n return FALSE;\n }\n show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.');\n }\n\n if ($use_sections === TRUE)\n {\n if (isset($this->config[$file]))\n {\n $this->config[$file] = array_merge($this->config[$file], $config);\n }\n else\n {\n $this->config[$file] = $config;\n }\n }\n else\n {\n $this->config = array_merge($this->config, $config);\n }\n\n $this->is_loaded[] = $file;\n unset($config);\n\n log_message('debug', 'Config file loaded: config/'.$file.EXT);\n return TRUE;\n }", "public function __construct(string $fileName = \"config.cfg\")\n {\n if (empty($fileName)) {\n $this->fileName = defined(\"CONFIG\") ? CONFIG : $fileName;\n } else {\n if (file_exists($fileName)) {\n $this->fileName = $fileName;\n }\n }\n if (file_exists($this->fileName)) {\n $this->vars = parse_ini_file($this->fileName, true);\n }\n }", "abstract protected function loadConfiguration($name);", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "private function load_config() {\n $this->config = new Config();\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "private function loadConfiguration()\n {\n if (!Configuration::configurationIsLoaded()) {\n Configuration::loadConfiguration();\n }\n }", "private function load()\n {\n if ($this->sites) {\n return;\n }\n $data = Yaml::parse(file_get_contents($this->file));\n $this->sites = $data['sites'];\n }", "public function testConfigurationFromFile()\n {\n $path = __DIR__ . '/files/file1.config.php';\n\n $configuration = Factory::fromFile($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n $this->assertEquals(include $path, $configuration->getInternalContainer());\n }", "public static function load(array $arguments, string $file = self::DEFAULT_FILE_PATH)\n {\n // Generate default config instance.\n self::$config = new Config();\n self::setOption('php_version', phpversion());\n\n // If received file name is valid file, parses this file.\n if (is_file($file)) {\n Logger::getInstance()->info('Load: '.$file);\n $config_yaml = Yaml::parse(file_get_contents($file));\n if (is_iterable($config_yaml)) {\n foreach ($config_yaml as $key => $value) {\n // `format` can not be specified from the configuration file.\n if ($key === 'format') {\n throw new InvalidConfigOptionException('`format` is an invalid option in config file.');\n }\n self::setOption($key, $value);\n }\n // If object is not iterable, It judges that this configuration file is invalid.\n } else {\n throw new InvalidConfigFilePathException('`'.$file.'` is not a valid YAML.');\n }\n // If the configuration file name does not exist and is not the default, throw an exception.\n } elseif ($file !== self::DEFAULT_FILE_PATH) {\n throw new InvalidConfigFilePathException('`'.$file.'` is not found.');\n // If the configuration file name does not exist and is the default, does not throw an exception.\n } else {\n Logger::getInstance()->info(self::DEFAULT_FILE_PATH.' is not found.');\n }\n\n // If the arguments are given, set it.\n if ($arguments['php-version']) {\n self::setOption('php_version', $arguments['php-version']);\n }\n if ($arguments['ignore-tools']) {\n self::setOption('ignore_tools', $arguments['ignore-tools']);\n }\n if ($arguments['only-tools']) {\n self::setOption('only_tools', $arguments['only-tools']);\n }\n if ($arguments['ignore-paths']) {\n self::setOption('ignore_paths', $arguments['ignore-paths']);\n }\n if ($arguments['extensions']) {\n self::setOption('extensions', $arguments['extensions']);\n }\n if ($arguments['vendor']) {\n self::setOption('vendor', $arguments['vendor']);\n }\n if ($arguments['format']) {\n self::setOption('format', $arguments['format']);\n }\n\n // Append ignore tools based on only tools\n if (!empty(self::$config->only_tools)) {\n $ignore_tools = array_filter(ToolBox::VALID_TOOLS, function ($tool) {\n return !in_array($tool, self::$config->only_tools, true);\n });\n self::$config->ignore_tools = array_unique(array_merge(self::$config->ignore_tools, $ignore_tools));\n }\n\n // If disabled vendor flag, add `vendor` directory to ignore paths.\n if (!self::$config->vendor) {\n self::$config->ignore_paths[] = 'vendor';\n }\n\n // Resolve ignore_paths to file name and reset.\n self::$config->ignore_paths = array_map(function ($path) {\n return realpath($path);\n }, Loader::dig(self::$config->ignore_paths, self::$config));\n\n Logger::getInstance()->info('PHP version: '.self::$config->php_version);\n Logger::getInstance()->info('Ignore tools: '.var_export(self::$config->ignore_tools, true));\n Logger::getInstance()->info('Ignore paths: '.var_export(self::$config->ignore_paths, true));\n Logger::getInstance()->info('Extensions: '.var_export(self::$config->extensions, true));\n Logger::getInstance()->info('Vendor: '.var_export(self::$config->vendor, true));\n Logger::getInstance()->info('Format: '.self::$config->format);\n }", "static function Load($directory, $configuration_file)\n {\n self::$settings = array();\n\n self::$directory = $directory;\n\n self::$file = self::$directory . \"/$configuration_file\";\n\n if(file_exists(self::$file))\n {\n self::$settings = parse_ini_file(self::$file, true);\n }\n }", "public static function load()\n {\n $files = glob(BASEDIR . '/config/*.php');\n foreach ($files as $file){\n $key = str_replace('.php', '', basename($file));\n static::$values[$key] = include $file;\n }\n }", "private function loadConfig()\n {\n $files = scandir($this->configPath());\n $configs = [];\n\n foreach ($files as $file) {\n $filePath = $this->configPath() . DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n $config = [basename($file, '.php') => include $filePath];\n if (is_array($config)) {\n $configs = array_merge($configs, $config);\n }\n }\n }\n\n $this->config = $configs;\n }", "public static function load()\n {\n if(!self::$loaded)\n {\n $GLOBALS['_EZMVC_SYS_CONFIG'] = require __DIR__ . '/system.config.php'; //Load config file\n $GLOBALS['_EZMVC_SYS_CONFIG'] = is_array($GLOBALS['_EZMVC_SYS_CONFIG']) ? $GLOBALS['_EZMVC_SYS_CONFIG'] : []; //Make sure its an array\n\n $GLOBALS['_EZMVC_APP_CONFIG'] = require dirname(__DIR__) . '/app/config/app.config.php';\n $GLOBALS['_EZMVC_APP_CONFIG'] = is_array($GLOBALS['_EZMVC_APP_CONFIG']) ? $GLOBALS['_EZMVC_APP_CONFIG'] : [];\n }\n }", "private function loadIni(){\n if(file_exists($this->fullPath.$this->iniFile)) {\n $arCfg = parse_ini_file($this->fullPath.$this->iniFile);\n $this->loadConfigs($arCfg);\n }\n }", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "private static function loadConfig(string $file)\n {\n $ds = DIRECTORY_SEPARATOR;\n $basepath = __DIR__ . \"{$ds}configs\";\n $filePath = \"{$basepath}{$ds}{$file}.php\";\n\n if (!file_exists($filePath)) {\n throw new Exception(\"File {$file}.php not found\", 500);\n }\n\n return include $filePath;\n }", "public function loadConfiguration()\n {\n \\Env::init();\n\n if (file_exists(SRC_ROOT . '/.env')) {\n $dotenv = new Dotenv(SRC_ROOT);\n $dotenv->load();\n $dotenv->required([\n 'DB_NAME',\n 'DB_USER',\n 'DB_PASSWORD',\n 'DB_HOST'\n ]);\n }\n\n define('APP_ENV', env('APP_ENV') ?: self::ENV_LIVE);\n\n if (!in_array(APP_ENV, $this->getAllowedEnvironments(), true)) {\n die('Invalid environment');\n }\n\n $configFileName = SRC_ROOT . '/config/env/' . APP_ENV . '.php';\n\n if (file_exists($configFileName)) {\n require $configFileName;\n }\n }", "function read_config($file = false)\n{\n global $config, $databases;\n $ret = false;\n if (!$file) {\n $file = $config['config_file'];\n }\n // protect from including external files\n $search = array(':', 'http', 'ftp', ' ');\n $replace = array('', '', '', '');\n $file = str_replace($search, $replace, $file);\n\n if (is_readable($config['paths']['config'] . $file . '.php')) {\n // to prevent modern server from caching the new configuration we need to evaluate it this way\n clearstatcache();\n $f = implode('', file($config['paths']['config'] . $file . '.php'));\n $f = str_replace('<?php', '', $f);\n $f = str_replace('?>', '', $f);\n eval($f);\n $config['config_file'] = $file;\n $_SESSION['config_file'] = $config['config_file'];\n $ret = true;\n }\n\n return $ret;\n}", "public function read($filename)\n {\n if (!file_exists($filename)) {\n throw new Config_Lite_RuntimeException('file not found: ' . $filename);\n }\n $this->filename = $filename;\n $this->sections = parse_ini_file($filename, true);\n if (false === $this->sections) {\n throw new Config_Lite_RuntimeException(\n 'failure, can not parse the file: ' . $filename);\n }\n }", "abstract public function loadConfig(array $config);", "public function loadConfig($data);", "function loadConfig( $file, $options = array( 'mode' => 'w' ) )\n\t{\n\t\t//\tolder version accpeted only a string as mode parameter\n\t\tif( !is_array( $options ) )\n\t\t\t$options\t=\tarray(\n\t\t\t\t\t\t\t\t'mode'\t=>\t$mode\n\t\t\t\t\t\t\t);\n\n\t\t//\tdo not append => clear old config\n\t\tif( $options['mode'] == 'w' )\n\t\t\t$this->conf\t\t\t=\tarray();\n\n\t\t//\tno filetype given, extract from filename\n\t\tif( isset( $options['filetype'] ) && !empty( $options['filetype'] ) )\n\t\t\t$filetype\t=\t$options['filetype'];\n\t\telse\n\t\t\t$filetype\t=\t$this->_getFiletype( $file );\n\n\t\t$path\t\t\t=\t$this->getFullPath( $file );\n\n\t\tif( patErrorManager::isError( $path ) )\n\t\t\treturn\t$path;\n\n\t\t$reader\t\t=\t&$this->_getDriver( $filetype, 'Reader' );\n\n\t\tif( patErrorManager::isError( $reader ) )\n\t\t\treturn\t$reader;\n\n\t\t$result\t\t=\t$reader->loadConfigFile( $path, $options );\n\n\t\tif( !is_array( $result ) )\n\t\t\treturn\t$result;\n\n\t\tif( empty( $this->conf ) )\n\t\t\t$this->conf\t=\t$result['config'];\n\t\telse\n\t\t\t$this->conf\t=\tarray_merge( $this->conf, $result['config'] );\n\n\t\treturn\ttrue;\n\t}", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "private function loadConfig() {\n $config = array();\n\n $this->config = $config;\n if (file_exists(__DIR__ . '/../config.php')) {\n require_once(__DIR__. '/../config.php');\n $this->config = array_merge($this->config, $config);\n //TODO check for required config entries\n } else {\n //TODO handle this nicer\n $this->fatalErr('NO_CFG', 'Unable to load config file');\n }\n\n if (array_key_exists('THEME', $this->config)) {\n $this->pageLoader->setTheme($this->config['THEME']);\n }\n }", "abstract protected function loadConfig(array $config);", "public function load($file);", "public function load($file);", "public function load($file);", "protected function loadFile(string $filename)\n\t{\n\t\tif (!isset($this->configFileLoaded[$filename])) {\n\t\t\t/* config folder Stored locally already resolved. Done in __construct */\n\t\t\t$file = $this->configFolder . $filename . '.php';\n\n\t\t\tif (file_exists($file)) {\n\t\t\t\t$this->config[strtolower($filename)] = require $file;\n\t\t\t}\n\n\t\t\t$this->configFileLoaded[$filename] = true;\n\t\t}\n\t}", "public static function load_settings_file($filename)\n {\n // Turn on output buffering to prevent accidental output.\n ob_start();\n include($filename);\n ob_get_clean();\n \n // We should now have an array $s with which to merge\n // the current settings.\n if (!empty($s)) {\n static::load_settings($s);\n }\n }", "private function loadConfiguration()\n {\n /** @var ConfigurationManager $configurationManager */\n $configurationManager = ConfigurationManager::getInstance();\n $this->configuration = $configurationManager->getMainConfiguration();\n }", "public function load()\n {\n $parser = new ezcConfigurationIniParser( ezcConfigurationIniParser::PARSE, $this->path );\n $settings = array();\n $comments = array();\n\n foreach ( new NoRewindIterator( $parser ) as $element )\n {\n if ( $element instanceof ezcConfigurationIniItem )\n {\n switch ( $element->type )\n {\n case ezcConfigurationIniItem::GROUP_HEADER:\n $settings[$element->group] = array();\n if ( !is_null( $element->comments ) )\n {\n $comments[$element->group]['#'] = $element->comments;\n }\n break;\n\n case ezcConfigurationIniItem::SETTING:\n eval( '$settings[$element->group][$element->setting]'. $element->dimensions. ' = $element->value;' );\n if ( !is_null( $element->comments ) )\n {\n eval( '$comments[$element->group][$element->setting]'. $element->dimensions. ' = $element->comments;' );\n }\n break;\n }\n }\n if ( $element instanceof ezcConfigurationValidationItem )\n {\n throw new ezcConfigurationParseErrorException( $element->file, $element->line, $element->description );\n }\n }\n\n $this->config = new ezcConfiguration( $settings, $comments );\n return $this->config;\n }", "function Load()\n\t{\n\t\tif (!is_readable($this->ConfigFile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->LoadSettings();\n\n\t\treturn true;\n\t}", "public function readConfig() {\n \t// Read the current configuration file\n \t$this->setConfig(parse_ini_file($this->getConfigFile(), true));\n \t// Return instance \n \treturn $this;\n }", "abstract protected function loadSettings();", "private function parseFile($filename) {\n if (is_null($filename) || !file_exists($filename)) {\n throw new MultidomainException('Missing config.yml file.');\n }\n $this->configFile = $filename;\n\n // get configuration values\n $this->config = json_decode(json_encode(\n Yaml::parseFile($filename)\n ));\n }", "public static function fromFile($filename)\n {\n $pathinfo = pathinfo($filename);\n\n if (!isset($pathinfo['extension'])) {\n throw new \\Dang\\Exception\\RuntimeException(sprintf(\n 'Filename \"%s\" is missing an extension and cannot be auto-detected',\n $filename\n ));\n }\n \n $extension = strtolower($pathinfo['extension']);\n if ($extension !== 'php') {\n throw new \\Dang\\Exception\\RuntimeException(sprintf(\n 'Unsupported config file extension: .%s',\n $pathinfo['extension']\n ));\n } \n \n if (!is_file($filename) || !is_readable($filename)) {\n throw new \\Dang\\Exception\\RuntimeException(sprintf(\n \"File '%s' doesn't exist or not readable\",\n $filename\n ));\n }\n \n $config = include $filename;\n\n return new Config($config);\n }", "public function loadConfig()\n {\n $fileName = \"setup.json\";\n\n if (! file_exists(WPADW_DIR . $fileName)) {\n $this->configParams = [];\n return $this;\n }\n\n $data = file_get_contents(WPADW_DIR . $fileName);\n\n $paramsArray = json_decode($data, true);\n\n $this->configParams = $paramsArray;\n\n return $this;\n }", "public static function load()\n {\n $configFile = self::getConfigFilePath();\n\n if (!is_file($configFile)) {\n self::save([]);\n }\n\n $config = require($configFile);\n\n if (!is_array($config))\n return array();\n\n return $config;\n }", "public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }", "protected function parse($file) {\n self::loadSpycLibrary();\n $config = Spyc::YAMLLoad($file);\n \n if (!$config) {\n throw new Exception(\"Configuration is either empty or contains fatal errors\");\n }\n \n return $config;\n }", "private function load_config_file($file) {\n\n\t\t$file = PATH_THIRD.'dm_eeck/config/'.$file;\n\n\t\tif(file_exists($file)) {\n\t\t\trequire($file);\n\t\t\tif(isset($editor_config)) {\n\t\t\t\treturn $editor_config;\n\t\t\t}\n\t\t}\n\n\t\treturn '';\n\t}", "private function load_config_file($file) {\n\n\t\t$file = PATH_THIRD.'dm_eeck/config/'.$file;\n\n\t\tif(file_exists($file)) {\n\t\t\trequire($file);\n\t\t\tif(isset($editor_config)) {\n\t\t\t\treturn $editor_config;\n\t\t\t}\n\t\t}\n\n\t\treturn '';\n\t}", "function getConfig($file) {\n $config = parse_ini_file($file, true);\n if (! $config) {\n echo \"Fatal: Configuration file missing or incorrect.\\n\";\n exit(1);\n }\n return $config;\n }", "function getConfig($file) {\n\t\t$config\t= parse_ini_file($file, true);\n\t\tif (! $config) {\n\t\t\t fatal(\"Configuration file missing or incorrect.\"); \n\t\t}\n\t return $config;\n\t}", "private function _loadConfig($filename)\n\t{\t\n\t\tif (!isset($config[$filename]))\n\t\t{\n\t\t\t$path = $this->pathToConfig . $filename . '.php';\n\t\t\tif (file_exists($path))\n\t\t\t{\n\t\t\t\trequire($this->pathToConfig . $filename . '.php');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Config file {$path} does not exist!\");\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * $config is the array found in ALL config files stored in $this->pathToConfig/\n\t\t */\n\t\treturn $config;\n\t}", "function getConfig($file) {\n echo $config;\n $config = parse_ini_file($file, true);\n if (! $config) {\n fatal(\"Configuration file missing or incorrect.\"); \n }\n return $config;\n }", "protected function initConfiguration()\n {\n if (!file_exists(self::$config_file)) {\n // get the configuration directly from CMS\n $this->getConfigurationFromCMS();\n }\n elseif ((false === (self::$config_array = json_decode(@file_get_contents(self::$config_file), true))) || !is_array(self::$config_array)) {\n throw new ConfigurationException(\"Can't read the Doctrine configuration file!\");\n }\n }", "public function load($path = null)\n {\n // initialize / test basebath\n $this->initialize();\n\n // absolute path\n if( file_exists($path) )\n {\n $config = is_file($path)\n ? $path\n : realpath($path . '/paths.php');\n }\n\n // relative path\n else\n {\n // test if an actual config file was passed\n $path = preg_match('/paths\\.php$/', $path)\n ? $path\n : $this->basepath . '/' . $path . '/paths.php';\n\n // resolve real file\n $config = realpath($path);\n if( ! $config )\n {\n throw new \\InvalidArgumentException('Config path \"' .$path. '\" doesn\\'t resolve to a configuration file');\n }\n }\n\n // load config\n $paths = require $config;\n\n // detect directory separator if convertslashes is auto\n if($this->convertslashes === 'auto')\n {\n // set separator\n preg_match('%[\\/]%', implode('', $paths), $matches);\n $this->separator = count($matches) ? $matches[0] : DIRECTORY_SEPARATOR;\n }\n\n // convert base\n if($this->convertslashes)\n {\n $this->basepath = $this->fix($this->basepath);\n }\n\n // set paths\n foreach($paths as $key => $value)\n {\n $this->set($key, $value);\n }\n\n // return this\n return $this;\n }", "function config(string $file, string $path = '')\n {\n if($path == ''){\n if(defined('LARAPRESS_PATH')){\n $path = LARAPRESS_PATH . '/config/';\n }\n }\n\n if(!is_string($path))\n return;\n\n $configFile = $path . $file . '.php';\n if(file_exists($configFile)){\n $array = include($configFile);\n\n if(!is_array($array))\n return;\n\n return $array;\n }\n }", "public function parseConfig()\n {\n $fileContents = file_get_contents($this->filename);\n if (!$fileContents) {\n $this->error = 'Failed to read file contents';\n\n return false;\n }\n\n $config = json_decode($fileContents, true);\n if (json_last_error()) {\n $this->error = json_last_error_msg();\n\n return false;\n }\n\n $this->config = new Data(array_replace_recursive($config, $this->overrides));\n\n return true;\n }", "private function _readFile()\n {\n $content = file_get_contents($this->file);\n $this->config = json_decode(utf8_encode($content), true);\n\n if ($this->config == null && json_last_error() != JSON_ERROR_NONE)\n {\n throw new \\LogicException(sprintf(\"Failed to parse config file '%s'. Error: '%s'\", basename($this->file) , json_last_error_msg()));\n }\n }", "function __loadConfig($plugin,$file) {\n // still support config values of v2.3 elements\n if (count(explode('.', $file)) > 0) {\n $file = str_replace('.', '_', $file);\n }\n \n // load config from app config folder\n if (Configure::load($file) === false) {\n // load config from plugin config folder\n if( $plugin ){\n\t if (Configure::load($plugin.'.'.$file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\n\t }else\n\t {\n\t if (Configure::load($file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\t \n\t }\n }\n }", "function load_configs($file, $is_global = true)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid config file found in configs folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__CONFIG__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "public function __construct($filename)\n {\n if (!file_exists($filename)) {\n throw new Exception(\"The given configuration file cannot be read\", 100);\n }\n\n //get the json encoded application settings\n $configContent = file_get_contents($filename);\n\n //parse the settings file\n $incompleteConfig = SerializableCollection::deserialize($configContent)->all();\n\n //complete the request\n $this->configuration = $this->getValueFromEnvironment($incompleteConfig);\n }", "protected function getConfigFromFile()\n {\n if (! file_exists(CONFIG_FILE)) {\n throw new RuntimeException('File ' . CONFIG_FILE . ' does not exist');\n }\n\n return include CONFIG_FILE;\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "protected static function loadConfiguration()\n {\n if (null === self::$configuration) {\n self::$configuration = Register::getRegister();\n }\n }", "public function __construct($config_file)\n {\n try \n {\n self::$config_array = Yaml::parse(file_get_contents($config_file))[\"system\"];\n }\n catch (ParseException $e) \n {\n printf(\"Unable to parse the YAML String: %s\", $e->getMessage());\n }\n }", "protected function loadSettings() {}", "protected function loadSettings() {}", "protected function loadSettings() {}", "public function load($file = '', $useSections = false){\n\t\t$file = SpanArt::$CONF_PATH.\"{$file}.php\";\n\t\tif((!$this->isLoad($file)) && file_exists($file)){\n\t\t\trequire($file);\n\t\t\t//$this->file = $file;\n\t\t\tarray_push($this->file, $file);\n\t\t\tif($useSections){\n\t\t\t\t$this->config[$file] = array_merge($this->config[$file], $config);\n\t\t\t}else{\n\t\t\t\t$this->config = array_merge($this->config, $config);\n\t\t\t}\n\t\t}else{\n\t\t\t//ver de disparar un error o tirar u log..\n\t\t}\n\t}", "public function loadFromFile($file)\n {\n \n }", "private function userCurlConfigFromFile(string $file = null)\r\n {\r\n $file = is_null($file) ? getenv(\"HOME\") . \"config.json\" : $file;\r\n if (count($this->curlUserDef) > 0) {\r\n return;\r\n }\r\n if (file_exists($file) === false) {\r\n echo \"Unable to load config from: \" . $file . PHP_EOL;\r\n echo \"No found user curl options\" . PHP_EOL;\r\n return;\r\n }\r\n $contents = json_decode(file_get_contents($file), true);\r\n $this->curlUserDef = isset($contents['curlUserDef']) && is_array($contents['curlUserDef']) ? $contents['curlUserDef'] : [];\r\n }", "public static function load_db_conf(){\n $db_config = include(CONFIGPATH.'db.conf.php');\n return $db_config;\n }", "function SM_config($file, $tryCache=true) {\n\n // configure\n $this->_smoConfigure();\n\n // load the config file\n $this->loadSite($file, $tryCache);\n \n }" ]
[ "0.7967239", "0.7258674", "0.72584146", "0.724199", "0.71637255", "0.7133132", "0.71095824", "0.71044827", "0.7064568", "0.70368165", "0.6991416", "0.6988359", "0.69405836", "0.69369537", "0.6916084", "0.68552476", "0.68195087", "0.67923695", "0.6750407", "0.67273474", "0.67218584", "0.66786444", "0.6654705", "0.6647733", "0.6640722", "0.66387063", "0.6618264", "0.6600919", "0.65873724", "0.65866816", "0.6582797", "0.6582663", "0.6537247", "0.6536502", "0.6530992", "0.65119326", "0.6489801", "0.6489025", "0.6471556", "0.6452682", "0.6447716", "0.6393304", "0.63902795", "0.6382123", "0.63801354", "0.636842", "0.6362883", "0.63611573", "0.63241047", "0.6317517", "0.6317368", "0.6293379", "0.62888956", "0.62838894", "0.6256792", "0.6256083", "0.62556696", "0.62400657", "0.6229171", "0.6229171", "0.6229171", "0.6212189", "0.62095046", "0.61946005", "0.619287", "0.6183263", "0.6171252", "0.61670303", "0.61668336", "0.61641437", "0.61592764", "0.61565673", "0.61479145", "0.6136581", "0.6132796", "0.6132796", "0.612871", "0.61155814", "0.60984886", "0.6089554", "0.608635", "0.6073005", "0.6072454", "0.6065009", "0.6044389", "0.60436624", "0.602303", "0.6021298", "0.60211957", "0.6019588", "0.6012982", "0.5992637", "0.59881854", "0.59881854", "0.5986944", "0.59806794", "0.59609675", "0.5957574", "0.59512824", "0.59493196" ]
0.64748627
38
Load configuration from directory alone.
public function testConfigFromDirectory() { $cfg = new Configuration(); $cfg->setBaseDirectories($this->dirs); $config = $cfg->load("response"); $this->assertInternalType("array", $config); $this->assertArrayNotHasKey("file", $config); $this->assertArrayNotHasKey("config", $config); $this->assertArrayHasKey("items", $config); $this->assertContains("part1", $config["items"][0]["config"]); $this->assertContains("part2", $config["items"][1]["config"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadConfig()\n {\n $files = scandir($this->configPath());\n $configs = [];\n\n foreach ($files as $file) {\n $filePath = $this->configPath() . DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n $config = [basename($file, '.php') => include $filePath];\n if (is_array($config)) {\n $configs = array_merge($configs, $config);\n }\n }\n }\n\n $this->config = $configs;\n }", "private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }", "public function setDirectory(string $path) : ConfigLoader;", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "abstract protected function loadConfig();", "public function loadDir($directory);", "public abstract function loadConfig($fileName);", "public function loadConfigs($confdir = null) {\n if (!is_object($this->shared)) {\n $this->shared = \\Ease\\Shared::instanced();\n }\n\n foreach (glob($confdir . '/*.json') as $configFile) {\n $this->shared->loadConfig($configFile, true);\n }\n\n $this->debug = \\Ease\\Functions::cfg('debug');\n $this->apiurl = \\Ease\\Functions::cfg('FLEXIBEE_URL');\n }", "public static function load()\n {\n $files = glob(BASEDIR . '/config/*.php');\n foreach ($files as $file){\n $key = str_replace('.php', '', basename($file));\n static::$values[$key] = include $file;\n }\n }", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "private function loadConfig() {\n $config = array();\n\n $this->config = $config;\n if (file_exists(__DIR__ . '/../config.php')) {\n require_once(__DIR__. '/../config.php');\n $this->config = array_merge($this->config, $config);\n //TODO check for required config entries\n } else {\n //TODO handle this nicer\n $this->fatalErr('NO_CFG', 'Unable to load config file');\n }\n\n if (array_key_exists('THEME', $this->config)) {\n $this->pageLoader->setTheme($this->config['THEME']);\n }\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "private function initialiseConfig()\n {\n $this->mergeConfigFrom(__DIR__ . '/..' . Settings::LARAVEL_REAL_CONFIG, Settings::LARAVEL_CONFIG_NAME);\n }", "public static function Load($directory)\n {\n parent::Load($directory, \"peg.conf\");\n }", "public static function init() {\n foreach (static::$dirs as $dir) {\n if($phpFiles = glob($dir . DIRECTORY_SEPARATOR . '*.php')) {\n foreach ($phpFiles as $phpFile) {\n $namespace = basename($phpFile, '.php');\n static::$config[$namespace] = require_once $phpFile;\n }\n }\n }\n }", "protected static function loadSingleExtLocalconfFiles() {}", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::APP_CONFIG);\n $this->config = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal\n }\n\n $this->is_loaded = TRUE;\n }", "public function load()\n {\n $this->rootDir = '';\n\n /** @var string $arg */\n while ($arg = array_shift($this->arguments)) {\n\n if ($this->stringStartsWith('--directory=', $arg)) {\n $this->rootDir = str_replace('--directory=', '', $arg);\n }\n }\n }", "abstract public function loadConfig(array $config);", "public function getDirectoryConfig();", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "static function Load($directory, $configuration_file)\n {\n self::$settings = array();\n\n self::$directory = $directory;\n\n self::$file = self::$directory . \"/$configuration_file\";\n\n if(file_exists(self::$file))\n {\n self::$settings = parse_ini_file(self::$file, true);\n }\n }", "private function loadConfig()\n {\n $base = APP_ROOT.'config/';\n $filename = $base.'app.yml';\n if (!file_exists($filename)) {\n throw new ConfigNotFoundException('The application config file '.$filename.' could not be found');\n }\n\n $config = Yaml::parseFile($filename);\n\n // Populate the environments array\n $hostname = gethostname();\n $environments = Yaml::parseFile($base.'env.yml');\n foreach ($environments as $env => $hosts) {\n foreach ($hosts as $host) {\n if (fnmatch($host, $hostname)) {\n $this->environments[] = $env;\n\n // Merge the app config for the environment\n $filename = $base.$env.'/app.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config = array_merge($config, $envConfig);\n }\n }\n }\n }\n\n // Loop through each of the config files and add them\n // to the main config array\n foreach (glob(APP_ROOT.'config/*.yml') as $file) {\n $key = str_replace('.yml', '', basename($file));\n $config[$key] = Yaml::parseFile($file);\n\n // Loop through each of the environments and merge their config\n foreach ($this->environments as $env) {\n $filename = $base.$env.'/'.$key.'.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config[$key] = array_merge($config[$key], $envConfig);\n }\n }\n }\n\n // Create and store the config object\n return $this->config = new Config($config);\n }", "public function testConfigFromFileAndDirectory()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"route\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertContains(\"a route\", $config[\"config\"]);\n $this->assertArrayHasKey(\"items\", $config);\n $this->assertContains(\"a 404 route\", $config[\"items\"][0][\"config\"]);\n $this->assertContains(\"an internal route\", $config[\"items\"][1][\"config\"]);\n }", "abstract protected function loadConfig(array $config);", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "function load_config($path) {\n \n // Check path\n if(file_exists($path) == false) {\n throw new Exception(\"Unable to load configuration -- file not found: $path\");\n }\n \n // Check file\n if(is_file($path) == false) {\n throw new Exception(\"Unable to load configuration -- not a file: $path\");\n }\n \n // Check permissions\n if(is_readable($path) == false) {\n throw new Exception(\"Unable to load configuration -- access denied: $path\");\n }\n \n // Check size \n if(filesize($path) == 0) {\n throw new Exception(\"Unable to load configuration -- file is empty: $path\");\n }\n \n // Load parser\n require_once(YAML_PARSER);\n \n // Load config\n $config = Spyc::YAMLLoad($path);\n \n // Check result - if empty, throw an exception\n if(sizeof($config) == 0) {\n throw new Exception(\"Unable to load configuration -- parse error: $path\");\n }\n \n // General application options\n if(isset($config['info']['name'])) { $this->set_name($config['info']['name']); }\n if(isset($config['info']['admin email'])) { $this->set_admin_email($config['info']['admin email']); }\n if(isset($config['info']['admin name'])) { $this->set_admin_name($config['info']['admin name']); }\n if(isset($config['info']['base url'])) { $this->set_base_url($config['info']['base url']); }\n if(isset($config['info']['base directory'])) { $this->set_base_dir($config['info']['base directory']); }\n \n // Database\n if(isset($config['database']['name'])) { \n \n // Initialize db object\n $this->db = new StanfordDatabase();\n \n // Credentials\n if(isset($config['database']['name'])) { $this->db->set_database($config['database']['name']); }\n if(isset($config['database']['username'])) { $this->db->set_username($config['database']['username']); }\n if(isset($config['database']['password'])) { $this->db->set_password($config['database']['password']); }\n \n // Encryption\n if(isset($config['database']['use encryption'])) { $this->db->use_encryption($config['database']['use encryption']); }\n else { $this->db->use_encryption(false); }\n\n }\n \n // Use mysql sessions set to true\n if(isset($config['database']['use mysql sessions']) && $config['database']['use mysql sessions'] == true ) {\n \n // Check DB\n if($this->db instanceof StanfordDatabase) {\n \n // Enable MySQL sessions\n $this->db->setup_mysql_sessions();\n \n }\n else {\n \n // DB not configured\n throw new Exception(\"Cannot enable MySQL-based sessions -- database credentials not provided\"); \n \n }\n }\n \n // Logging\n if(isset($config['settings']['logging mode'])) {\n $this->util->set_error_reporting($config['settings']['logging mode']);\n }\n \n // Undo magic quotes\n if(isset($config['settings']['undo magic quotes']) && $config['settings']['undo magic quotes'] == true) {\n $this->util->undo_magic_quotes();\n }\n }", "private function load_config() {\n $this->config = new Config();\n }", "public static function load()\n {\n if(!self::$loaded)\n {\n $GLOBALS['_EZMVC_SYS_CONFIG'] = require __DIR__ . '/system.config.php'; //Load config file\n $GLOBALS['_EZMVC_SYS_CONFIG'] = is_array($GLOBALS['_EZMVC_SYS_CONFIG']) ? $GLOBALS['_EZMVC_SYS_CONFIG'] : []; //Make sure its an array\n\n $GLOBALS['_EZMVC_APP_CONFIG'] = require dirname(__DIR__) . '/app/config/app.config.php';\n $GLOBALS['_EZMVC_APP_CONFIG'] = is_array($GLOBALS['_EZMVC_APP_CONFIG']) ? $GLOBALS['_EZMVC_APP_CONFIG'] : [];\n }\n }", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "public function testDir_LazyLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock'));\n\n $this->assertType('Q\\Config_Dir', $config);\n $this->assertEquals(array(), (array)$config);\n \n $cfg_file1 = $config['file1'];\n $this->assertType('Q\\Config_File', $cfg_file1);\n $this->assertEquals(array(\"db\"=>array(\"host\"=>\"localhost\", \"dbname\"=>\"test\",\"user\"=>\"myuser\",\"pwd\"=>\"mypwd\"),\"output\"=>\"xml\",\"input\"=>\"json\"), (array)$cfg_file1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayNotHasKey('dir1', (array)$config);\n\n $cfg_dir1 = $config['dir1'];\n $this->assertType('Q\\Config_Dir', $cfg_dir1);\n $this->assertEquals(array(), (array)$cfg_dir1);\n $this->assertArrayHasKey('file1', (array)$config);\n $this->assertArrayHasKey('dir1', (array)$config); \n }", "public function loadConfiguration()\n {\n // Get bundles paths\n $bundles = $this->kernel->getBundles();\n $paths = array();\n $pathInBundles = 'Resources' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'nekland_admin.yml';\n\n foreach ($bundles as $bundle) {\n $paths[] = $bundle->getPath() . DIRECTORY_SEPARATOR . $pathInBundles;\n }\n $this->configuration->setPaths($paths);\n $this->configuration->loadConfigFiles();\n }", "private function loadConfigFiles()\n { if (!$this->configFiles) {\n $this->configFiles[] = 'config.neon';\n }\n\n foreach ($this->configFiles as $file) {\n $this->configurator->addConfig($this->paths->getConfigDir().'/'.$file);\n }\n }", "public static function autoload($path = GDN_CONF)\n {\n $cached = Cache::instance('system')->get('config-autoload');\n if ($cached) {\n self::$data = $cached;\n } else {\n // load default configs from $coreConfig\n if ($path !== self::$coreConfig) {\n self::autoload(self::$coreConfig);\n }\n\n self::loadDir($path);\n }\n }", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }", "public function testConfigurationFromDirectory()\n {\n $path = __DIR__ . '/files/';\n\n $configuration = Factory::fromDirectory($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n\n $this->assertEquals([\n 'key1' => 'value1',\n 'key2' => 'value2',\n 'key3' => [\n 'key31' => 'value31',\n 'key32' => 'value32'\n ]\n ], $configuration->getInternalContainer());\n }", "private function loadConfiguration()\n {\n if (!Configuration::configurationIsLoaded()) {\n Configuration::loadConfiguration();\n }\n }", "protected function setConfigurations()\n {\n if ($files = $this->getFiles('config'))\n {\n foreach ($files as $key => $filename)\n {\n $this->config->set(basename($filename, '.php'), require path('config').DIRECTORY_SEPARATOR.($filename));\n }\n }\n }", "private function loadIni(){\n if(file_exists($this->fullPath.$this->iniFile)) {\n $arCfg = parse_ini_file($this->fullPath.$this->iniFile);\n $this->loadConfigs($arCfg);\n }\n }", "public static function loadConfigs($files) {\n self::load_files_from_dir($files, APP_CONF_DIR);\n }", "protected function loadConfiguration()\n {\n $config_path = __DIR__ . '/../../config/tintin.php';\n\n if (!$this->isLumen()) {\n $this->publishes([\n $config_path => config_path('view.php')\n ], 'config');\n }\n\n $this->mergeConfigFrom($config_path, 'view');\n }", "public function testDir_EagerLoad()\n {\n $config = new Config_Dir($this->dir, array('transformer'=>'from-mock', 'ext'=>'mock','loadall'=>true));\n\n $this->assertType('Q\\Config_Dir', $config);\n\n $this->assertArrayHasKey('dir1', (array)$config);\n $this->assertArrayHasKey('dir2', (array)$config);\n $this->assertArrayHasKey('file1', (array)$config);\n\n $this->assertArrayHasKey('file3', (array)$config['dir1']);\n $this->assertArrayHasKey('file4', (array)$config['dir1']); \n }", "public function load($path = null)\n {\n // initialize / test basebath\n $this->initialize();\n\n // absolute path\n if( file_exists($path) )\n {\n $config = is_file($path)\n ? $path\n : realpath($path . '/paths.php');\n }\n\n // relative path\n else\n {\n // test if an actual config file was passed\n $path = preg_match('/paths\\.php$/', $path)\n ? $path\n : $this->basepath . '/' . $path . '/paths.php';\n\n // resolve real file\n $config = realpath($path);\n if( ! $config )\n {\n throw new \\InvalidArgumentException('Config path \"' .$path. '\" doesn\\'t resolve to a configuration file');\n }\n }\n\n // load config\n $paths = require $config;\n\n // detect directory separator if convertslashes is auto\n if($this->convertslashes === 'auto')\n {\n // set separator\n preg_match('%[\\/]%', implode('', $paths), $matches);\n $this->separator = count($matches) ? $matches[0] : DIRECTORY_SEPARATOR;\n }\n\n // convert base\n if($this->convertslashes)\n {\n $this->basepath = $this->fix($this->basepath);\n }\n\n // set paths\n foreach($paths as $key => $value)\n {\n $this->set($key, $value);\n }\n\n // return this\n return $this;\n }", "public function loadYamlConfig($filepath);", "public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }", "final protected function loadAllConfigFiles(ContainerBuilder $container): void\n {\n $directory = dirname((new ReflectionObject($this))->getFileName());\n $directory = realpath(sprintf('%s/../Resources/config/services', $directory));\n\n $loader = new YamlFileLoader($container, new FileLocator($directory));\n\n foreach ($this->configs() as $config) {\n $loader->load(sprintf('%s.yaml', $config));\n }\n }", "public function loadConfiguration()\n {\n \\Env::init();\n\n if (file_exists(SRC_ROOT . '/.env')) {\n $dotenv = new Dotenv(SRC_ROOT);\n $dotenv->load();\n $dotenv->required([\n 'DB_NAME',\n 'DB_USER',\n 'DB_PASSWORD',\n 'DB_HOST'\n ]);\n }\n\n define('APP_ENV', env('APP_ENV') ?: self::ENV_LIVE);\n\n if (!in_array(APP_ENV, $this->getAllowedEnvironments(), true)) {\n die('Invalid environment');\n }\n\n $configFileName = SRC_ROOT . '/config/env/' . APP_ENV . '.php';\n\n if (file_exists($configFileName)) {\n require $configFileName;\n }\n }", "protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }", "protected function load_config() {\n $this->config = Kohana::$config->load('imagecache');\n $this->config_patterns = Kohana::$config->load('imagecache_patterns');\n }", "private function loadConfiguration()\n {\n /** @var ConfigurationManager $configurationManager */\n $configurationManager = ConfigurationManager::getInstance();\n $this->configuration = $configurationManager->getMainConfiguration();\n }", "protected function loadConfig($rootDir)\n {\n // Require the config */\n require_once $this->normalizePath($rootDir) . '/config.php';\n }", "public function loadConfig($file) {\n $config = array();\n if (file_exists(PATH_CONFIGS . $file))\n include(PATH_CONFIGS . $file);\n if (!empty($config)) {\n foreach ($config as $name => $array) {\n $this->configs[$name] = $array;\n }\n }\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "public function loadConfig($data);", "protected function loadConfigsForRegister(): void\n {\n $shipConfigs = $this->getConfigsFromShip();\n $containersConfigs = $this->getConfigsFromContainers();\n\n $configs = array_merge($shipConfigs, $containersConfigs);\n\n foreach ($configs as $file){\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $this->mergeConfigFrom($file, $filename);\n }\n }", "public function addConfigDirectory(string $directory): void;", "public function config_path();", "public static function parse($dir = null)\n {\n self::$dir = ($dir != null ? rtrim($dir,'/').'/': dirname(dirname(dirname(__FILE__))).'/config/');\n\n $config = (object) array();\n // No configuration needed!\n if(!is_dir(self::$dir)){ return $config; }\n\n if(!is_readable(self::$dir.self::$default_config.'.php')){ return $config; }\n\n $cfg_arr = (array) require_once self::$dir.self::$default_config.'.php';\n\n if(self::$check_keys){\n\n if(!empty($_SERVER[self::$environment_key]) && is_readable(self::$dir.$_SERVER[self::$environment_key].'.php')){\n $env_arr = (array) require_once self::$dir.$_SERVER[self::$environment_key].'.php';\n $cfg_arr = array_replace($cfg_arr,$env_arr);\n }\n\n if(!empty($_SERVER[self::$developer_key]) && is_readable(self::$dir.$_SERVER[self::$developer_key].'.php')){\n $dev_arr = (array) require_once self::$dir.$_SERVER[self::$developer_key].'.php';\n $cfg_arr = array_replace($cfg_arr,$dev_arr);\n }\n\n $config = (object) $cfg_arr;\n }\n return $config;\n }", "public static function load()\n {\n $configFile = self::getConfigFilePath();\n\n if (!is_file($configFile)) {\n self::save([]);\n }\n\n $config = require($configFile);\n\n if (!is_array($config))\n return array();\n\n return $config;\n }", "public function loadConfig()\n {\n $fileName = \"setup.json\";\n\n if (! file_exists(WPADW_DIR . $fileName)) {\n $this->configParams = [];\n return $this;\n }\n\n $data = file_get_contents(WPADW_DIR . $fileName);\n\n $paramsArray = json_decode($data, true);\n\n $this->configParams = $paramsArray;\n\n return $this;\n }", "abstract protected function loadConfiguration($name);", "public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }", "public static function loadConfig($configFile) {\n\t}", "public function __construct()\n {\n if (is_file($config = root('config', 'config.php'))) {\n $this->item = (array) require($config);\n }\n if (is_file($config = _DIR_ . _DS_ . 'config.php')) {\n $this->set((array) require($config));\n }\n if(getenv('ENV')){\n if(is_file($config_env = root('config', getenv('ENV').'.php'))){\n $this->set((array) require($config_env));\n }\n }\n if (!$this->item) {\n throw new \\ErrorException('Unable load config');\n }\n }", "public function testConfigFromSingleFile()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"view\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayNotHasKey(\"items\", $config);\n $this->assertContains(\"a view\", $config[\"config\"]);\n }", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "public function config()\n\t{\n\t\treturn [\n\t\t\t__DIR__ . '/../config/config.php',\n\t\t];\n\t}", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "private function loadConfigRepository(): void\n {\n // Check Config\n if (\\count($this->configs) > 0) {\n return;\n }\n\n // Load Cache|Repository\n $store = $this->configRepo->findAll();\n foreach ($store as $config) {\n if (count($config->getValue()) === 1) {\n $val = $config->getValue()[0];\n\n if ('true' === $val) {\n $val = true;\n } elseif ('false' === $val) {\n $val = false;\n }\n } else {\n $val = $config->getValue();\n }\n\n $this->configs[$config->getName()] = $val;\n }\n }", "abstract protected function getConfigPath();", "public function test_Config_gives_access_to_path(){\n\t\t$path = $this->path;\n\t\t$config = new Config($path);\n\t\t$this->assertSame($path, $config->path);\n\n\t\t// Based on loadFromFilePath\n\t\t$config = new Config();\n\t\t$config->loadFromFile($this->path);\n\t\t$this->assertSame($this->path, $config->path);\n\t}", "public function load()\n {\n foreach ($this->config['autoload'] as $file) {\n if ( ! locate_template($this->getRelativePath($file), true, true)) {\n throw new FileNotFoundException(\"Autoloaded file [{$this->getPath($file)}] cannot be found. Please, check your autoloaded entries in `config/app.php` file.\");\n }\n }\n }", "public function loadBase()\n {\n $etcDir = $this->getOptions()->getEtcDir();\n $files = glob($etcDir.DS.'*.xml');\n $this->loadFile(current($files));\n\n while ($file = next($files)) {\n $merge = clone $this->_prototype;\n $merge->loadFile($file);\n $this->extend($merge);\n }\n\n if (in_array($etcDir.DS.'local.xml', $files)) {\n $this->_isLocalConfigLoaded = true;\n }\n\n return $this;\n }", "public static function read_config()\n\t{\n\t\t$config = realpath(dirname(__FILE__) . '/../../config_local.php');\n\t\t$hosted_config = Utils::get_hosted_path() . '/config_local.php';\n\n\t\tif (is_readable($config)) \n\t\t{\n\t\t\trequire($config);\n\t\t\t$is_hosted = FALSE;\n\t\t\t\n\t\t// maybe we are hosted\n\t\t} elseif (file_exists($hosted_config) )\n\t\t{\n\t\t\trequire($hosted_config);\n\t\t\trequire_once(Utils::get_hosted_path() . '/htdocs/system/system.php');\n\t\t\t$is_hosted = TRUE;\n\n\t\t// lets try the normal config location\n\t\t} elseif (is_readable('config.php')) \n\t\t{\n\t\t\trequire('config.php');\n\t\t\t$is_hosted = FALSE;\n\n\t\t// redirect\n\t\t} else \n\t\t{\n\t\t\theader('Location: install/index.php');\n\t\t\t$is_hosted = FALSE;\n\t\t}\n\n\t\tdefine('IS_HOSTED', $is_hosted);\n\t}", "public function loadConfiguration(): void\n {\n $config = $this->getConfig() + $this->defaults;\n $this->setConfig($config);\n\n $cb = $this->getContainerBuilder();\n\n $routingFilePath = $config['routingFile'];\n $neonRoutesLoader = $cb->addDefinition($this->prefix('neonRoutesLoader'));\n $neonRoutesLoader->setClass(NeonRoutesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters), $config['autoInternalIds']]);\n\n $neonLocalesLoader = $cb->addDefinition($this->prefix('neonLocalesLoader'));\n $neonLocalesLoader->setClass(NeonLocalesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters)]);\n\n $router = $cb->addDefinition($this->prefix('router'));\n $router->setClass(Router::class)\n ->addSetup('setAsSecured', [$config['isSecured']])\n ->addSetup('setFilesExtension', [$config['extension']]);\n }", "protected function loadConfiguration()\n {\n $configPath = __DIR__ . '/../../fixture/config/twigbridge.php';\n if (!$this->isLumen()) {\n $this->publishes([$configPath => config_path('twigbridge.php')], 'config');\n }\n $this->mergeConfigFrom($configPath, 'twigbridge');\n }", "function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}", "private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n $this->_config = $configLoader;\n\t}", "protected function loadConfigManually()\n {\n $basePath = config('swoole-tcp.laravel_base_path') ?: base_path();\n if ($this->isLumen && file_exists($basePath . '/config/swoole-tcp.php')) {\n $this->getLaravel()->configure('swoole-tcp');\n }\n }", "public function testConfigurationFromFile()\n {\n $path = __DIR__ . '/files/file1.config.php';\n\n $configuration = Factory::fromFile($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n $this->assertEquals(include $path, $configuration->getInternalContainer());\n }", "protected function defineConfig()\n {\n // Get config paths\n $configs = $this->config->getDirectly(__DIR__ . '/../Config/path.php')['default_config'] ?? [];\n\n // Add all of them to config collector if $configs is an array\n if (is_array($configs)) {\n foreach ($configs as $alias => $path) {\n $this->config->set($alias, $path);\n }\n }\n }", "function load_configs($file, $is_global = true)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid config file found in configs folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__CONFIG__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "private function setupPHPConfigFiles()\n {\n foreach( glob('app/etc/*.php') as $file )\n {\n $key = str_replace('.php', null, basename($file));\n $data = include $file;\n \n $this->config->add($key, $data);\n }\n }", "function load_config_array(string $dir) {\n\t\t$tmp = [];\n\t\t$files = scandir($dir, SCANDIR_SORT_ASCENDING);\n\t\tif ($files !== FALSE) {\n\t\t\tforeach (array_diff($files, ['.', '..']) as $f) {\n\t\t\t\t$inc = include($dir.'/'.$f);\n\t\t\t\tif (gettype($inc) === 'array') {\n\t\t\t\t\t$tmp = array_merge($tmp, $inc);\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Exception(\n\t\t\t\t\t\t\"Invalid configuration file. An array wasn't returned.\"\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}", "private function load()\n {\n if ($this->sites) {\n return;\n }\n $data = Yaml::parse(file_get_contents($this->file));\n $this->sites = $data['sites'];\n }", "protected function getConfigLoader()\n\t{\n\t\treturn new FileLoader(new Filesystem, $this->defaultPath);\n\t}", "public static function load_db_conf(){\n $db_config = include(CONFIGPATH.'db.conf.php');\n return $db_config;\n }", "private static function getConfig() {\n\n\t\t$pathRoot = $_SERVER['DOCUMENT_ROOT'].substr($_SERVER['PHP_SELF'],0, strpos($_SERVER['PHP_SELF'],\"/\",1)).\"/config/\";\n\n\t\t$jsonConfig = file_get_contents($pathRoot.'config.json');\n\t\tself::$arrayConfig = json_decode($jsonConfig);\n\t}", "function cfgLoader($loadType = null, $jsonFile = null, $iniFile = null , $fullPath = null, $arrayFile = null){\n $this->loadType = ($loadType==null) ? \"ANY\" : $loadType;\n\n //Default file names or provided names\n $this->jsonFile = ($jsonFile==null) ? \"config.json\" : $jsonFile;\n $this->iniFile = ($iniFile == null) ? \"config.ini\" : $iniFile;\n $this->arrayFile = ($arrayFile == null) ? \"arraycfg.php\" : $arrayFile;\n\n //Default folder for cfg files\n $this->fullPath = ($fullPath == null) ? \"../cfg/\" : $fullPath;\n\n switch ($this->loadType){\n case \"ANY\":\n $this->loadJson();\n $this->loadIni();\n $this->loadArray();\n break;\n\n case \"JSON\":\n $this->loadJson();\n break;\n\n case \"INI\":\n $this->loadIni();\n break;\n\n case \"ARRAY\":\n $this->loadArray();\n break;\n }\n }", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "protected function loadConfigsFromPackage(): void\n {\n $packageConfigs = $this->getConfigsFromPackage();\n foreach ($packageConfigs as $file){\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $this->mergeConfigFrom($file, $filename);\n }\n }", "public function __construct()\n {\n $this->config = include(dirname(__FILE__). '/../config/config.php');\n }" ]
[ "0.7491405", "0.7293052", "0.70488036", "0.70140076", "0.6827473", "0.6826427", "0.6819068", "0.6813193", "0.67902654", "0.6734792", "0.67178357", "0.66837424", "0.66582924", "0.6617847", "0.65621334", "0.65088016", "0.6489431", "0.64774245", "0.64361143", "0.64026636", "0.63910013", "0.6333253", "0.63285416", "0.6269235", "0.6268142", "0.62490207", "0.62386316", "0.6225116", "0.621974", "0.621724", "0.62071145", "0.6201898", "0.6200441", "0.6199939", "0.6186494", "0.6185615", "0.61771923", "0.61735535", "0.6153933", "0.6144213", "0.612803", "0.61147416", "0.610728", "0.609999", "0.6066394", "0.60080636", "0.6007621", "0.5990369", "0.59867454", "0.59709054", "0.5968794", "0.5963465", "0.59448224", "0.5926347", "0.59251887", "0.5912035", "0.59056395", "0.58921856", "0.5891645", "0.58798546", "0.587566", "0.58693475", "0.58691216", "0.58592397", "0.5836429", "0.5833618", "0.582945", "0.5810019", "0.5804441", "0.5792711", "0.5777742", "0.5735812", "0.57076603", "0.56924504", "0.5690637", "0.568988", "0.56804353", "0.56440717", "0.5641544", "0.5638279", "0.5635512", "0.5609837", "0.56094575", "0.5602054", "0.55952466", "0.5586274", "0.5576041", "0.55736357", "0.5572739", "0.55652153", "0.55599487", "0.55563164", "0.5553133", "0.55463505", "0.55456847", "0.55449545", "0.5543896", "0.5542794", "0.55348617", "0.553041" ]
0.6770147
9
Load configuration from file and directory.
public function testConfigFromFileAndDirectory() { $cfg = new Configuration(); $cfg->setBaseDirectories($this->dirs); $config = $cfg->load("route"); $this->assertInternalType("array", $config); $this->assertArrayHasKey("file", $config); $this->assertArrayHasKey("config", $config); $this->assertContains("a route", $config["config"]); $this->assertArrayHasKey("items", $config); $this->assertContains("a 404 route", $config["items"][0]["config"]); $this->assertContains("an internal route", $config["items"][1]["config"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function loadConfig()\n {\n $files = scandir($this->configPath());\n $configs = [];\n\n foreach ($files as $file) {\n $filePath = $this->configPath() . DIRECTORY_SEPARATOR . $file;\n\n if (is_file($filePath)) {\n $config = [basename($file, '.php') => include $filePath];\n if (is_array($config)) {\n $configs = array_merge($configs, $config);\n }\n }\n }\n\n $this->config = $configs;\n }", "public abstract function loadConfig($fileName);", "private function loadConfig()\n {\n\n $this->config = include(__DIR__ . '/../../config/config.php');\n\n }", "abstract protected function loadConfig();", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function readConfig() {\n if ( file_exists( $this->path . '/config/config.php' ) ) {\n require_once $this->path . '/config/config.php';\n }\n }", "function load_config() {\n\t\t$conf_file = @file_get_contents( LDAP_LOGIN_PATH.'data.dat' );\n\t\tif ($conf_file!==false)\n\t\t{\n\t\t\t$this->config = unserialize($conf_file);\n\t\t}\n\t}", "function loadConfig(){\n $file = file_get_contents($this->config_dir, FILE_USE_INCLUDE_PATH);\n $urls = json_decode($file,TRUE);\n //not the best way but error handling\n if ($file == NULL || $urls == NUll ){\n print(\"Error reading the config file or it it is empty\");\n }\n else{\n $this->config_data = $urls;\n\n }\n }", "private function load()\n {\n if (!file_exists($this->file)) {\n throw new Exception('config file not found');\n }\n // read contents of wordpress config\n // we can not require the configuration because it requires a shit load of other files\n $this->config = file_get_contents($this->file);\n }", "private function loadConfig() {\n $config = array();\n\n $this->config = $config;\n if (file_exists(__DIR__ . '/../config.php')) {\n require_once(__DIR__. '/../config.php');\n $this->config = array_merge($this->config, $config);\n //TODO check for required config entries\n } else {\n //TODO handle this nicer\n $this->fatalErr('NO_CFG', 'Unable to load config file');\n }\n\n if (array_key_exists('THEME', $this->config)) {\n $this->pageLoader->setTheme($this->config['THEME']);\n }\n }", "public function load_config() {\n if (!isset($this->config)) {\n $name = $this->get_name();\n $this->config = get_config(\"local_$name\");\n }\n }", "function load_config($path) {\n \n // Check path\n if(file_exists($path) == false) {\n throw new Exception(\"Unable to load configuration -- file not found: $path\");\n }\n \n // Check file\n if(is_file($path) == false) {\n throw new Exception(\"Unable to load configuration -- not a file: $path\");\n }\n \n // Check permissions\n if(is_readable($path) == false) {\n throw new Exception(\"Unable to load configuration -- access denied: $path\");\n }\n \n // Check size \n if(filesize($path) == 0) {\n throw new Exception(\"Unable to load configuration -- file is empty: $path\");\n }\n \n // Load parser\n require_once(YAML_PARSER);\n \n // Load config\n $config = Spyc::YAMLLoad($path);\n \n // Check result - if empty, throw an exception\n if(sizeof($config) == 0) {\n throw new Exception(\"Unable to load configuration -- parse error: $path\");\n }\n \n // General application options\n if(isset($config['info']['name'])) { $this->set_name($config['info']['name']); }\n if(isset($config['info']['admin email'])) { $this->set_admin_email($config['info']['admin email']); }\n if(isset($config['info']['admin name'])) { $this->set_admin_name($config['info']['admin name']); }\n if(isset($config['info']['base url'])) { $this->set_base_url($config['info']['base url']); }\n if(isset($config['info']['base directory'])) { $this->set_base_dir($config['info']['base directory']); }\n \n // Database\n if(isset($config['database']['name'])) { \n \n // Initialize db object\n $this->db = new StanfordDatabase();\n \n // Credentials\n if(isset($config['database']['name'])) { $this->db->set_database($config['database']['name']); }\n if(isset($config['database']['username'])) { $this->db->set_username($config['database']['username']); }\n if(isset($config['database']['password'])) { $this->db->set_password($config['database']['password']); }\n \n // Encryption\n if(isset($config['database']['use encryption'])) { $this->db->use_encryption($config['database']['use encryption']); }\n else { $this->db->use_encryption(false); }\n\n }\n \n // Use mysql sessions set to true\n if(isset($config['database']['use mysql sessions']) && $config['database']['use mysql sessions'] == true ) {\n \n // Check DB\n if($this->db instanceof StanfordDatabase) {\n \n // Enable MySQL sessions\n $this->db->setup_mysql_sessions();\n \n }\n else {\n \n // DB not configured\n throw new Exception(\"Cannot enable MySQL-based sessions -- database credentials not provided\"); \n \n }\n }\n \n // Logging\n if(isset($config['settings']['logging mode'])) {\n $this->util->set_error_reporting($config['settings']['logging mode']);\n }\n \n // Undo magic quotes\n if(isset($config['settings']['undo magic quotes']) && $config['settings']['undo magic quotes'] == true) {\n $this->util->undo_magic_quotes();\n }\n }", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::APP_CONFIG);\n $this->config = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal\n }\n\n $this->is_loaded = TRUE;\n }", "public function load()\n {\n $ini = APP_DIR.'config/'.ENVIRONMENT.'.ini';\n\n if(!file_exists($ini))\n Clockwork::throwError('Could not load config ('.$ini.')');\n\n $this->data = parse_ini_file($ini, true);\n \n $this->setValues();\n }", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "public static function load()\n {\n $files = glob(BASEDIR . '/config/*.php');\n foreach ($files as $file){\n $key = str_replace('.php', '', basename($file));\n static::$values[$key] = include $file;\n }\n }", "abstract public function loadConfig(array $config);", "private function loadConfig()\n {\n $base = APP_ROOT.'config/';\n $filename = $base.'app.yml';\n if (!file_exists($filename)) {\n throw new ConfigNotFoundException('The application config file '.$filename.' could not be found');\n }\n\n $config = Yaml::parseFile($filename);\n\n // Populate the environments array\n $hostname = gethostname();\n $environments = Yaml::parseFile($base.'env.yml');\n foreach ($environments as $env => $hosts) {\n foreach ($hosts as $host) {\n if (fnmatch($host, $hostname)) {\n $this->environments[] = $env;\n\n // Merge the app config for the environment\n $filename = $base.$env.'/app.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config = array_merge($config, $envConfig);\n }\n }\n }\n }\n\n // Loop through each of the config files and add them\n // to the main config array\n foreach (glob(APP_ROOT.'config/*.yml') as $file) {\n $key = str_replace('.yml', '', basename($file));\n $config[$key] = Yaml::parseFile($file);\n\n // Loop through each of the environments and merge their config\n foreach ($this->environments as $env) {\n $filename = $base.$env.'/'.$key.'.yml';\n if (file_exists($filename)) {\n $envConfig = Yaml::parseFile($filename);\n $config[$key] = array_merge($config[$key], $envConfig);\n }\n }\n }\n\n // Create and store the config object\n return $this->config = new Config($config);\n }", "abstract protected function loadConfig(array $config);", "public function loadConfiguration()\n {\n // Get bundles paths\n $bundles = $this->kernel->getBundles();\n $paths = array();\n $pathInBundles = 'Resources' . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'nekland_admin.yml';\n\n foreach ($bundles as $bundle) {\n $paths[] = $bundle->getPath() . DIRECTORY_SEPARATOR . $pathInBundles;\n }\n $this->configuration->setPaths($paths);\n $this->configuration->loadConfigFiles();\n }", "public static function load()\n {\n $entries = Configuration::get();\n \n foreach ($entries as $entry) {\n self::$config[$entry->id] = unserialize($entry->value);\n }\n }", "public function loadYamlConfig($filepath);", "public function loadConfig()\n {\n return parse_ini_file(\n DIR_ROOT . '/config.ini', False\n );\n }", "static function Load($directory, $configuration_file)\n {\n self::$settings = array();\n\n self::$directory = $directory;\n\n self::$file = self::$directory . \"/$configuration_file\";\n\n if(file_exists(self::$file))\n {\n self::$settings = parse_ini_file(self::$file, true);\n }\n }", "public function loadConfig($file) {\n $config = array();\n if (file_exists(PATH_CONFIGS . $file))\n include(PATH_CONFIGS . $file);\n if (!empty($config)) {\n foreach ($config as $name => $array) {\n $this->configs[$name] = $array;\n }\n }\n }", "protected function setConfigurations()\n {\n if ($files = $this->getFiles('config'))\n {\n foreach ($files as $key => $filename)\n {\n $this->config->set(basename($filename, '.php'), require path('config').DIRECTORY_SEPARATOR.($filename));\n }\n }\n }", "private function load_config() {\n $this->config = new Config();\n }", "public function setDirectory(string $path) : ConfigLoader;", "public function loadConfigs($confdir = null) {\n if (!is_object($this->shared)) {\n $this->shared = \\Ease\\Shared::instanced();\n }\n\n foreach (glob($confdir . '/*.json') as $configFile) {\n $this->shared->loadConfig($configFile, true);\n }\n\n $this->debug = \\Ease\\Functions::cfg('debug');\n $this->apiurl = \\Ease\\Functions::cfg('FLEXIBEE_URL');\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "public static function load()\n {\n if(!self::$loaded)\n {\n $GLOBALS['_EZMVC_SYS_CONFIG'] = require __DIR__ . '/system.config.php'; //Load config file\n $GLOBALS['_EZMVC_SYS_CONFIG'] = is_array($GLOBALS['_EZMVC_SYS_CONFIG']) ? $GLOBALS['_EZMVC_SYS_CONFIG'] : []; //Make sure its an array\n\n $GLOBALS['_EZMVC_APP_CONFIG'] = require dirname(__DIR__) . '/app/config/app.config.php';\n $GLOBALS['_EZMVC_APP_CONFIG'] = is_array($GLOBALS['_EZMVC_APP_CONFIG']) ? $GLOBALS['_EZMVC_APP_CONFIG'] : [];\n }\n }", "public function loadConfiguration()\n {\n \\Env::init();\n\n if (file_exists(SRC_ROOT . '/.env')) {\n $dotenv = new Dotenv(SRC_ROOT);\n $dotenv->load();\n $dotenv->required([\n 'DB_NAME',\n 'DB_USER',\n 'DB_PASSWORD',\n 'DB_HOST'\n ]);\n }\n\n define('APP_ENV', env('APP_ENV') ?: self::ENV_LIVE);\n\n if (!in_array(APP_ENV, $this->getAllowedEnvironments(), true)) {\n die('Invalid environment');\n }\n\n $configFileName = SRC_ROOT . '/config/env/' . APP_ENV . '.php';\n\n if (file_exists($configFileName)) {\n require $configFileName;\n }\n }", "private static function loadConfigurationFile()\n {\n if(self::$ConfigurationData == null)\n {\n $file_contents = file_get_contents(CONFIGURATION_FILE);\n $json_data = json_decode($file_contents, true);\n\n if(empty($json_data))\n {\n throw new Exception(\"Invalid JSON data in the configuration file\");\n }\n\n self::$ConfigurationData = $json_data;\n }\n }", "protected function loadConfig() {\n $json = new JSON();\n $viewConfig = $json->readFile(__SITE_PATH . \"\\\\config\\\\view.json\");\n $this->meta_info = $viewConfig['meta'];\n $this->js_files = $viewConfig['javascript'];\n $this->css_files = $viewConfig['css'];\n }", "private function loadConfigFiles()\n { if (!$this->configFiles) {\n $this->configFiles[] = 'config.neon';\n }\n\n foreach ($this->configFiles as $file) {\n $this->configurator->addConfig($this->paths->getConfigDir().'/'.$file);\n }\n }", "private function initialiseConfig()\n {\n $this->mergeConfigFrom(__DIR__ . '/..' . Settings::LARAVEL_REAL_CONFIG, Settings::LARAVEL_CONFIG_NAME);\n }", "public function load($path = null)\n {\n // initialize / test basebath\n $this->initialize();\n\n // absolute path\n if( file_exists($path) )\n {\n $config = is_file($path)\n ? $path\n : realpath($path . '/paths.php');\n }\n\n // relative path\n else\n {\n // test if an actual config file was passed\n $path = preg_match('/paths\\.php$/', $path)\n ? $path\n : $this->basepath . '/' . $path . '/paths.php';\n\n // resolve real file\n $config = realpath($path);\n if( ! $config )\n {\n throw new \\InvalidArgumentException('Config path \"' .$path. '\" doesn\\'t resolve to a configuration file');\n }\n }\n\n // load config\n $paths = require $config;\n\n // detect directory separator if convertslashes is auto\n if($this->convertslashes === 'auto')\n {\n // set separator\n preg_match('%[\\/]%', implode('', $paths), $matches);\n $this->separator = count($matches) ? $matches[0] : DIRECTORY_SEPARATOR;\n }\n\n // convert base\n if($this->convertslashes)\n {\n $this->basepath = $this->fix($this->basepath);\n }\n\n // set paths\n foreach($paths as $key => $value)\n {\n $this->set($key, $value);\n }\n\n // return this\n return $this;\n }", "public static function loadConfigs($files) {\n self::load_files_from_dir($files, APP_CONF_DIR);\n }", "static public function load($filename) {\n\t\t$filename .= '.php';\n\n\t\tif (!file_exists($filename)) {\n\t\t\tthrow new \\Exception('Configuration file not found: ' . $filename);\n\t\t}\n\n\t\tinclude $filename;\n\n\t\tif (!isset($config)) {\n\t\t\tthrow new \\Exception('No variable $config found in ' . $filename);\n\t\t}\n\n\t\tself::$values = $config;\n\t}", "protected function _load_config()\n {\n clearos_profile(__METHOD__, __LINE__);\n\n try {\n $config_file = new Configuration_File(self::FILE_CONFIG);\n $rawdata = $config_file->load();\n } catch (File_Not_Found_Exception $e) {\n // Not fatal, set defaults below\n } catch (Engine_Exception $e) {\n throw new Engine_Exception($e->get_message(), CLEAROS_WARNING);\n }\n\n if (isset($rawdata['allow_shell']) && preg_match(\"/(true|1)/i\", $rawdata['allow_shell']))\n $this->config['allow_shell'] = TRUE;\n else\n $this->config['allow_shell'] = FALSE;\n\n if (isset($rawdata['theme_mode']) && !empty($rawdata['theme_mode']))\n $this->config['theme_mode'] = $rawdata['theme_mode'];\n else\n $this->config['theme_mode'] = 'normal';\n\n if (isset($rawdata['theme']) && !empty($rawdata['theme']))\n $this->config['theme'] = $rawdata['theme'];\n else\n $this->config['theme'] = 'default';\n\n $this->is_loaded = TRUE;\n }", "public function loadConfig($data);", "private function loadConfiguration()\n {\n /** @var ConfigurationManager $configurationManager */\n $configurationManager = ConfigurationManager::getInstance();\n $this->configuration = $configurationManager->getMainConfiguration();\n }", "protected function load_config() {\n $this->config = Kohana::$config->load('imagecache');\n $this->config_patterns = Kohana::$config->load('imagecache_patterns');\n }", "protected function loadConfiguration()\n {\n $config_path = __DIR__ . '/../../config/tintin.php';\n\n if (!$this->isLumen()) {\n $this->publishes([\n $config_path => config_path('view.php')\n ], 'config');\n }\n\n $this->mergeConfigFrom($config_path, 'view');\n }", "private function read_config() {\n\t\t$sections = parse_ini_file($this->config['conf'], true);\n\t\tforeach ($sections as $sectionk => $sectionv) {\n\t\t\tforeach ($sectionv as $key => $var)\n\t\t\t\t$this->config[$sectionk . '.' . $key] = $var;\n\t\t}\n\t}", "private function loadConfiguration()\n {\n if (!Configuration::configurationIsLoaded()) {\n Configuration::loadConfiguration();\n }\n }", "public function loadConfig($file)\n {\n $options = [];\n try {\n $loader = new PhpConfig();\n $options = $loader->read($file);\n } catch (\\Exception $e) {\n Log::warning($e->getMessage());\n }\n\t\t$this->config('options', $options);\n\t}", "abstract protected function loadConfiguration($name);", "function loadConfigFile ($fileName) {\n\t\tif (file_exists ($fileName)) {\n\t\t\tif (is_readable ($fileName)) {\n\t\t\t\t$configItems = array ();\n\t\t\t\tinclude ($fileName);\n\t\t\t\t$this->loadConfigArray ($configItems);\n\t\t\t} else {\n\t\t\t\treturn new Error ('CONFIG_FILE_NOT_READABLE', $fileName);\n\t\t\t}\n\t\t} else {\n\t\t\treturn new Error ('CONFIG_FILE_NOT_FOUND', $fileName);\n\t\t}\n\t}", "public function testConfigFromDirectory()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"response\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayNotHasKey(\"file\", $config);\n $this->assertArrayNotHasKey(\"config\", $config);\n $this->assertArrayHasKey(\"items\", $config);\n $this->assertContains(\"part1\", $config[\"items\"][0][\"config\"]);\n $this->assertContains(\"part2\", $config[\"items\"][1][\"config\"]);\n }", "private function loadIni(){\n if(file_exists($this->fullPath.$this->iniFile)) {\n $arCfg = parse_ini_file($this->fullPath.$this->iniFile);\n $this->loadConfigs($arCfg);\n }\n }", "public static function loadConfig($configFile) {\n\t}", "protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }", "private function _loadConfig($options) {\n\n $conf_file = NULL;\n if (isset($options ['config'])) {\n $conf_file = $options ['config'];\n } else if (isset($options ['c'])) {\n $conf_file = $options ['c'];\n }\n\n if ($conf_file !== NULL && !file_exists($conf_file)) {\n $this->log(\"file does not exists\", self::ERROR);\n exit;\n }\n\n if ($conf_file !== NULL && file_exists($conf_file)) {\n $this->_config = parse_ini_file($conf_file, true);\n return $this;\n }\n }", "public function load_config() {\n if (!isset($this->config)) {\n $settingspluginname = 'assessmentsettings';\n $this->config = get_config(\"local_$settingspluginname\");\n }\n }", "public function loadConfig()\n {\n $this->setGlobalStoreOfShopNumber($this->getShopNumber());\n $this->loadArray($this->toArray());\n $this->setExportTmpAndLogSettings();\n }", "public static function load()\n {\n $configFile = self::getConfigFilePath();\n\n if (!is_file($configFile)) {\n self::save([]);\n }\n\n $config = require($configFile);\n\n if (!is_array($config))\n return array();\n\n return $config;\n }", "function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}", "public function testConfigurationFromFile()\n {\n $path = __DIR__ . '/files/file1.config.php';\n\n $configuration = Factory::fromFile($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n $this->assertEquals(include $path, $configuration->getInternalContainer());\n }", "public static function read_config()\n\t{\n\t\t$config = realpath(dirname(__FILE__) . '/../../config_local.php');\n\t\t$hosted_config = Utils::get_hosted_path() . '/config_local.php';\n\n\t\tif (is_readable($config)) \n\t\t{\n\t\t\trequire($config);\n\t\t\t$is_hosted = FALSE;\n\t\t\t\n\t\t// maybe we are hosted\n\t\t} elseif (file_exists($hosted_config) )\n\t\t{\n\t\t\trequire($hosted_config);\n\t\t\trequire_once(Utils::get_hosted_path() . '/htdocs/system/system.php');\n\t\t\t$is_hosted = TRUE;\n\n\t\t// lets try the normal config location\n\t\t} elseif (is_readable('config.php')) \n\t\t{\n\t\t\trequire('config.php');\n\t\t\t$is_hosted = FALSE;\n\n\t\t// redirect\n\t\t} else \n\t\t{\n\t\t\theader('Location: install/index.php');\n\t\t\t$is_hosted = FALSE;\n\t\t}\n\n\t\tdefine('IS_HOSTED', $is_hosted);\n\t}", "function parseConfig() {\n\n\t\t// Make sure our config file exists\n\t\tif(!file_exists(CONFIGPATH . $this->_options['configFile'])) {\n\t\t\tdie('Unable to find <b>'. CONFIGPATH . $this->_options['configFile'] .'</b> file, please check your application configuration');\n\t\t}\n\n\t\t// Switch the file extension\n\t\tswitch(PPI_Helper::getFileExtension($this->_options['configFile'])) {\n\t\t\tcase 'ini':\n\t\t\t\treturn new PPI_Config_Ini(parse_ini_file(CONFIGPATH . $this->_options['configFile'], true, INI_SCANNER_RAW), $this->_options['configBlock']);\n\n\t\t\tcase 'xml':\n\t\t\t\tdie('Trying to load a xml config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t\tcase 'php':\n\t\t\t\tdie('Trying to load a php config file but no parser yet created.');\n\t\t\t\tbreak;\n\n\t\t}\n\t}", "protected function loadConfigsForRegister(): void\n {\n $shipConfigs = $this->getConfigsFromShip();\n $containersConfigs = $this->getConfigsFromContainers();\n\n $configs = array_merge($shipConfigs, $containersConfigs);\n\n foreach ($configs as $file){\n $filename = pathinfo($file, PATHINFO_FILENAME);\n $this->mergeConfigFrom($file, $filename);\n }\n }", "public function loadConfig()\n {\n $fileName = \"setup.json\";\n\n if (! file_exists(WPADW_DIR . $fileName)) {\n $this->configParams = [];\n return $this;\n }\n\n $data = file_get_contents(WPADW_DIR . $fileName);\n\n $paramsArray = json_decode($data, true);\n\n $this->configParams = $paramsArray;\n\n return $this;\n }", "public static function Load($directory)\n {\n parent::Load($directory, \"peg.conf\");\n }", "private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }", "public function readConfigFile(): void\n {\n $configPath = __DIR__ . '/../../.config';\n if (!file_exists($configPath)) {\n echo \"Could not find .config\\n\";\n die;\n }\n $lines = preg_split('/[\\r\\n]+/', file_get_contents($configPath));\n foreach ($lines as $line) {\n if (empty($line)) {\n continue;\n }\n if (substr($line, 0, 1) == '#') {\n continue;\n }\n $kv = preg_split(\"/=/\", $line);\n $key = $kv[0];\n $value = $kv[1];\n $this->data[$key] = $value;\n }\n }", "function __construct() {\n if (!file_exists($this->configuration_file_path)) {\n \n die(\"FATAL: Missing \" . $this->configuration_file_path . `pwd` );\n \n }\n \n $raw_contents = file_get_contents($this->configuration_file_path);\n\n\n //parse json object\n try {\n\n $this->Config = json_decode( $raw_contents );\n\n } catch (Exception $e) {\n\n die(\"FATAL: Bad configuration file? \");\n\n }\n \n\n }", "public function loadConfiguration(): void\n {\n $config = $this->getConfig() + $this->defaults;\n $this->setConfig($config);\n\n $cb = $this->getContainerBuilder();\n\n $routingFilePath = $config['routingFile'];\n $neonRoutesLoader = $cb->addDefinition($this->prefix('neonRoutesLoader'));\n $neonRoutesLoader->setClass(NeonRoutesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters), $config['autoInternalIds']]);\n\n $neonLocalesLoader = $cb->addDefinition($this->prefix('neonLocalesLoader'));\n $neonLocalesLoader->setClass(NeonLocalesLoader::class)\n ->setArguments([Helpers::expand($routingFilePath, $cb->parameters)]);\n\n $router = $cb->addDefinition($this->prefix('router'));\n $router->setClass(Router::class)\n ->addSetup('setAsSecured', [$config['isSecured']])\n ->addSetup('setFilesExtension', [$config['extension']]);\n }", "protected static function loadSingleExtLocalconfFiles() {}", "public function load($files)\n\t{\n\t\t// multiple files\n\t\tif (strpos($files, ',')) {\n\t\t\t$filesList = explode(',', $files);\n\t\t}\n\t\telse { // single file\n\t\t\t$filesList[] = $files;\n\t\t}\n\n\t\tforeach($filesList as $file) {\n\t\t\t$file = trim($file);\n\n\t\t\t// default to BP./app/config/ dir\n\t\t\tif (substr($file, 0, 1 ) != \"/\") {\n\t\t\t\t$file = BP.'/app/config/'.$file;\n\t\t\t}\n\n\t\t\t// convert file into array\n\t\t\tif (file_exists($file)) {\n\t\t\t\t$config = parse_ini_file($file, true);\n\n\t\t\t\t// if it has sections, remove the config_title array that gets created\n\t\t\t\t// $configTitle = $config['config_title'];\n\t\t\t\t// unset($config['config_title']);\n\t\t\t\t// add the array using the config title as a key to the items array\n\n\t\t\t\tif (!is_array($config)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// has section headings\n\t\t\t\tif (is_array($config[key($config) ])) {\n\t\t\t\t\tforeach($config as $section => $values) {\n\t\t\t\t\t\t$this->container['config']->{$section} = (object)$values;\n\t\t\t\t\t}\n\t\t\t\t} else { // does not have sections\n\t\t\t\t\tforeach($config as $key => $value) {\n\t\t\t\t\t\t$this->container['config']->{$key} = $value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }", "function cfgLoader($loadType = null, $jsonFile = null, $iniFile = null , $fullPath = null, $arrayFile = null){\n $this->loadType = ($loadType==null) ? \"ANY\" : $loadType;\n\n //Default file names or provided names\n $this->jsonFile = ($jsonFile==null) ? \"config.json\" : $jsonFile;\n $this->iniFile = ($iniFile == null) ? \"config.ini\" : $iniFile;\n $this->arrayFile = ($arrayFile == null) ? \"arraycfg.php\" : $arrayFile;\n\n //Default folder for cfg files\n $this->fullPath = ($fullPath == null) ? \"../cfg/\" : $fullPath;\n\n switch ($this->loadType){\n case \"ANY\":\n $this->loadJson();\n $this->loadIni();\n $this->loadArray();\n break;\n\n case \"JSON\":\n $this->loadJson();\n break;\n\n case \"INI\":\n $this->loadIni();\n break;\n\n case \"ARRAY\":\n $this->loadArray();\n break;\n }\n }", "protected function initConfiguration()\n {\n if (!file_exists(self::$config_file)) {\n // get the configuration directly from CMS\n $this->getConfigurationFromCMS();\n }\n elseif ((false === (self::$config_array = json_decode(@file_get_contents(self::$config_file), true))) || !is_array(self::$config_array)) {\n throw new ConfigurationException(\"Can't read the Doctrine configuration file!\");\n }\n }", "public static function init() {\n foreach (static::$dirs as $dir) {\n if($phpFiles = glob($dir . DIRECTORY_SEPARATOR . '*.php')) {\n foreach ($phpFiles as $phpFile) {\n $namespace = basename($phpFile, '.php');\n static::$config[$namespace] = require_once $phpFile;\n }\n }\n }\n }", "public function __construct()\n {\n if (is_file($config = root('config', 'config.php'))) {\n $this->item = (array) require($config);\n }\n if (is_file($config = _DIR_ . _DS_ . 'config.php')) {\n $this->set((array) require($config));\n }\n if(getenv('ENV')){\n if(is_file($config_env = root('config', getenv('ENV').'.php'))){\n $this->set((array) require($config_env));\n }\n }\n if (!$this->item) {\n throw new \\ErrorException('Unable load config');\n }\n }", "public function loadConfig($filename)\n {\n return $this->getConfig()->loadConfig($filename);\n }", "public function load_config($file = '')\n {\n return $this->{$this->_driver}->load_config($file);\n }", "public static function autoload($path = GDN_CONF)\n {\n $cached = Cache::instance('system')->get('config-autoload');\n if ($cached) {\n self::$data = $cached;\n } else {\n // load default configs from $coreConfig\n if ($path !== self::$coreConfig) {\n self::autoload(self::$coreConfig);\n }\n\n self::loadDir($path);\n }\n }", "public function test_Config_gives_access_to_path(){\n\t\t$path = $this->path;\n\t\t$config = new Config($path);\n\t\t$this->assertSame($path, $config->path);\n\n\t\t// Based on loadFromFilePath\n\t\t$config = new Config();\n\t\t$config->loadFromFile($this->path);\n\t\t$this->assertSame($this->path, $config->path);\n\t}", "public function testConfigFromSingleFile()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"view\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayNotHasKey(\"items\", $config);\n $this->assertContains(\"a view\", $config[\"config\"]);\n }", "function LoadConfiguration()\r\n\t{\r\n\t\t$cinfFilePath = Site::GetConfigFilePath ();\r\n\t\t$config = simplexml_load_file ( $cinfFilePath );\r\n\t\t\r\n\t\t// load languages\r\n\t\tif (isset ( $config->languages ))\r\n\t\t{\r\n\t\t\t$langs = ( array ) $config->languages;\r\n\t\t\t$langsA = $langs ['language'];\r\n\t\t\t\r\n\t\t\tif (! is_array ( $langsA ))\r\n\t\t\t{\r\n\t\t\t\t\r\n\t\t\t\t$linkID = ( string ) $langsA->linkID;\r\n\t\t\t\t$linkName = ( string ) $langsA->linkName;\r\n\t\t\t\t$this->m_languages [$linkID] = $linkName;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tforeach ( $langsA as $lang )\r\n\t\t\t\t{\r\n\t\t\t\t\t$linkID = ( string ) $lang->linkID;\r\n\t\t\t\t\t$linkName = ( string ) $lang->linkName;\r\n\t\t\t\t\t\r\n\t\t\t\t\t$this->m_languages [$linkID] = $linkName;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$langKes = array_keys ( $this->m_languages );\r\n\t\t\t$this->m_languageDefault = $langKes [0];\r\n\t\t}\r\n\t\t\r\n\t\t// load templates\r\n\t\tif (isset ( $config->templates ))\r\n\t\t{\r\n\t\t\t$templates = ( array ) $config->templates;\r\n\t\t\t$langsA = $templates ['template'];\r\n\t\t\t\r\n\t\t\tif (! is_array ( $langsA ))\r\n\t\t\t{\r\n\t\t\t\t$this->m_templates = null;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->m_templates = array ();\r\n\t\t\t\t\r\n\t\t\t\tforeach ( $langsA as $lang )\r\n\t\t\t\t{\r\n\t\t\t\t\t$fileName = ( string ) $lang;\r\n\t\t\t\t\tarray_push ( $this->m_templates, $fileName );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// load siteURL\r\n\t\tif (isset ( $config->url ))\r\n\t\t{\r\n\t\t\t$this->m_URL = ( string ) $config->url;\r\n\t\t\t$this->m_URL = trim ( $this->m_URL );\r\n\t\t}\r\n\t\t\r\n\t\t// load siteURL\r\n\t\tif (isset ( $config->maxImageWidth ))\r\n\t\t{\r\n\t\t\t$this->m_maxImageWidth = ( int ) $config->maxImageWidth;\r\n\t\t}\r\n\t\t\r\n\t\t// secuirity-file root\r\n\t\tif (isset ( $config->securFolder ))\r\n\t\t{\r\n\t\t\t$this->m_sfRoot = ( string ) $config->securFolder;\r\n\t\t\t$this->m_sfRoot = trim ( $this->m_sfRoot );\r\n\t\t}\r\n\t\t\r\n\t\t// boxes\r\n\t\tif (isset ( $config->boxes ))\r\n\t\t{\r\n\t\t\t$boxes = ( array ) $config->boxes;\r\n\t\t\t$boxes = $boxes ['box'];\r\n\t\t\tif (! is_array ( $boxes ))\r\n\t\t\t{\r\n\t\t\t\t$this->m_boxes = array ($boxes );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->m_boxes = $boxes;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// product image root\r\n\t\tif (isset ( $config->productImageRoot ))\r\n\t\t{\r\n\t\t\t$str = ( string ) $config->productImageRoot;\r\n\t\t\t$this->m_prodImagRoot = trim ( $str );\r\n\t\t}\r\n\t\t\r\n\t\t// product image root\r\n\t\tif (isset ( $config->galleryRoot ))\r\n\t\t{\r\n\t\t\t$str = ( string ) $config->galleryRoot;\r\n\t\t\t$this->m_galleryImageRoot = trim ( $str );\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "final protected function loadAllConfigFiles(ContainerBuilder $container): void\n {\n $directory = dirname((new ReflectionObject($this))->getFileName());\n $directory = realpath(sprintf('%s/../Resources/config/services', $directory));\n\n $loader = new YamlFileLoader($container, new FileLocator($directory));\n\n foreach ($this->configs() as $config) {\n $loader->load(sprintf('%s.yaml', $config));\n }\n }", "function __loadConfig($plugin,$file) {\n // still support config values of v2.3 elements\n if (count(explode('.', $file)) > 0) {\n $file = str_replace('.', '_', $file);\n }\n \n // load config from app config folder\n if (Configure::load($file) === false) {\n // load config from plugin config folder\n if( $plugin ){\n\t if (Configure::load($plugin.'.'.$file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\n\t }else\n\t {\n\t if (Configure::load($file) === false) {\n\t echo '<p>Error: The '.$file.'.php could not be found in your app/config or app/plugins/comment/config folder. Please create it from the default comment/config/default.php.</p>';\n\t }\t \n\t }\n }\n }", "private function _loadConfig($filename)\n\t{\t\n\t\tif (!isset($config[$filename]))\n\t\t{\n\t\t\t$path = $this->pathToConfig . $filename . '.php';\n\t\t\tif (file_exists($path))\n\t\t\t{\n\t\t\t\trequire($this->pathToConfig . $filename . '.php');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new Exception(\"Config file {$path} does not exist!\");\n\t\t\t}\n\t\t}\n\t\t/*\n\t\t * $config is the array found in ALL config files stored in $this->pathToConfig/\n\t\t */\n\t\treturn $config;\n\t}", "public function config_path();", "private function loadPhpConfiguration()\n {\n // direttive php\n require Config::get('MAIN/core_path') . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'cache' . DIRECTORY_SEPARATOR . 'baseCache.class.php';\n $cache = new BaseCache(array('cache_dir' => 'ini', 'extension' => '.cache'));\n\n if(!$cache->has('php.ini'))\n {\n $options = array();\n if(file_exists(Config::get('application.dir') . DIRECTORY_SEPARATOR . 'ini' . DIRECTORY_SEPARATOR . 'php.ini'))\n {\n $options = parse_ini_file(Config::get('application.dir') . DIRECTORY_SEPARATOR . 'ini' . DIRECTORY_SEPARATOR . 'php.ini', true);\n }\n else\n {\n $options = parse_ini_file(Config::get('MAIN/core_path') . DIRECTORY_SEPARATOR . 'ini' . DIRECTORY_SEPARATOR . 'php.ini', true);\n }\n\n $cache->set('php.ini', serialize($options));\n }\n else\n {\n $options = unserialize($cache->get('php.ini', array()));\n }\n\n $options = Config::get('application.debug') ? (isset($options['dev']) ? $options['dev'] : array()) : (isset($options['prod']) ? $options['prod'] : array());\n\n foreach($options as $varname => $varvalue)\n {\n ini_set($varname, $varvalue);\n }\n\n // php version\n if(Config::has('phpversion') && Config::get('phpversion') > phpversion())\n {\n throw new CoreException(sprintf('Per eseguire l\\'applicazione è richiesto PHP %s, installato PHP %s', Config::get('phpversion'), phpversion()));\n }\n\n // error handler\n //set_error_handler(array('CoreException', 'errorHandler'));\n }", "function config(string $file, string $path = '')\n {\n if($path == ''){\n if(defined('LARAPRESS_PATH')){\n $path = LARAPRESS_PATH . '/config/';\n }\n }\n\n if(!is_string($path))\n return;\n\n $configFile = $path . $file . '.php';\n if(file_exists($configFile)){\n $array = include($configFile);\n\n if(!is_array($array))\n return;\n\n return $array;\n }\n }", "public function test_load_returns_empty_array_if_conf_dir_dnx()\n {\n $config = new Bootphp_Config_File_Reader('gafloogle');\n\n $this->assertSame([], $config->load('values'));\n }", "function load($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)\n {\n $file = ($file == '') ? 'config' : str_replace(EXT, '', $file);\n\n if (in_array($file, $this->is_loaded, TRUE))\n {\n return TRUE;\n }\n\n // {{{ Matchbox\n\n $ci = &get_instance();\n $module = $ci->matchbox->argument(3);\n\n if (!$filepath = $ci->matchbox->find('config/' . $file . EXT, $module)) {\n if ($fail_gracefully === true) {\n return false;\n }\n\n show_error('The configuration file ' . $file . EXT . ' does not exist.');\n }\n\n include($filepath);\n\n // }}}\n\n if ( ! isset($config) OR ! is_array($config))\n {\n if ($fail_gracefully === TRUE)\n {\n return FALSE;\n }\n show_error('Your '.$file.EXT.' file does not appear to contain a valid configuration array.');\n }\n\n if ($use_sections === TRUE)\n {\n if (isset($this->config[$file]))\n {\n $this->config[$file] = array_merge($this->config[$file], $config);\n }\n else\n {\n $this->config[$file] = $config;\n }\n }\n else\n {\n $this->config = array_merge($this->config, $config);\n }\n\n $this->is_loaded[] = $file;\n unset($config);\n\n log_message('debug', 'Config file loaded: config/'.$file.EXT);\n return TRUE;\n }", "public function loadDir($directory);", "protected function defineConfig()\n {\n // Get config paths\n $configs = $this->config->getDirectly(__DIR__ . '/../Config/path.php')['default_config'] ?? [];\n\n // Add all of them to config collector if $configs is an array\n if (is_array($configs)) {\n foreach ($configs as $alias => $path) {\n $this->config->set($alias, $path);\n }\n }\n }", "public function load()\n {\n foreach ($this->config['autoload'] as $file) {\n if ( ! locate_template($this->getRelativePath($file), true, true)) {\n throw new FileNotFoundException(\"Autoloaded file [{$this->getPath($file)}] cannot be found. Please, check your autoloaded entries in `config/app.php` file.\");\n }\n }\n }", "protected static function loadConfiguration()\n {\n if (null === self::$configuration) {\n self::$configuration = Register::getRegister();\n }\n }", "protected function loadFile(string $filename)\n\t{\n\t\tif (!isset($this->configFileLoaded[$filename])) {\n\t\t\t/* config folder Stored locally already resolved. Done in __construct */\n\t\t\t$file = $this->configFolder . $filename . '.php';\n\n\t\t\tif (file_exists($file)) {\n\t\t\t\t$this->config[strtolower($filename)] = require $file;\n\t\t\t}\n\n\t\t\t$this->configFileLoaded[$filename] = true;\n\t\t}\n\t}", "function load_configs($file, $is_global = true)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid config file found in configs folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__CONFIG__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "public function loadConfiguration()\n\t{\n\t\t// Set the configuration file path for the application.\n\t\t$file = JPATH_CONFIGURATION . '/configuration.php';\n\n\t\t// Verify the configuration exists and is readable.\n\t\tif (!is_readable($file))\n\t\t{\n\t\t\tthrow new \\RuntimeException('Configuration file does not exist or is unreadable.');\n\t\t}\n\n\t\t// Load the configuration file into an object.\n\t\trequire $file ;\n\t\t$config = new JConfig;\n\n\t\tif ($config === null)\n\t\t{\n\t\t\tthrow new \\RuntimeException(sprintf('Unable to parse the configuration file %s.', $file));\n\t\t}\n\n\t\t// Get the FB config file path\n\t\t$file = JPATH_BASE . '/config_fb.json';\n\n\t\t// Verify the configuration exists and is readable.\n\t\tif (!is_readable($file))\n\t\t{\n\t\t\tthrow new \\RuntimeException('FB-Configuration file does not exist or is unreadable.');\n\t\t}\n\n\t\t// Load the configuration file into an object.\n\t\t$configFb = json_decode(file_get_contents($file));\n\n\t\tif ($configFb === null)\n\t\t{\n\t\t\tthrow new \\RuntimeException(sprintf('Unable to parse the configuration file %s.', $file));\n\t\t}\n\n\t\t// Merge the configuration\n\t\t$config->fb_app_id \t\t= $configFb->app_id;\n\t\t$config->fb_app_secret \t= $configFb->app_secret;\n\n\t\t$this->config->loadObject($config);\n\n\t\treturn $this;\n\t}", "protected function Init() \n {\n // Load the APP config.php and add the defined vars\n $this->load($this->files['app']['file_path'], 'app');\n \n // Load the core.config.php and add the defined vars\n $this->load($this->files['core']['file_path'], 'core', 'config');\n \n // Load the database.config.php and add the defined vars\n $this->load($this->files['db']['file_path'], 'db', 'DB_configs');\n }", "public static function load(array $arguments, string $file = self::DEFAULT_FILE_PATH)\n {\n // Generate default config instance.\n self::$config = new Config();\n self::setOption('php_version', phpversion());\n\n // If received file name is valid file, parses this file.\n if (is_file($file)) {\n Logger::getInstance()->info('Load: '.$file);\n $config_yaml = Yaml::parse(file_get_contents($file));\n if (is_iterable($config_yaml)) {\n foreach ($config_yaml as $key => $value) {\n // `format` can not be specified from the configuration file.\n if ($key === 'format') {\n throw new InvalidConfigOptionException('`format` is an invalid option in config file.');\n }\n self::setOption($key, $value);\n }\n // If object is not iterable, It judges that this configuration file is invalid.\n } else {\n throw new InvalidConfigFilePathException('`'.$file.'` is not a valid YAML.');\n }\n // If the configuration file name does not exist and is not the default, throw an exception.\n } elseif ($file !== self::DEFAULT_FILE_PATH) {\n throw new InvalidConfigFilePathException('`'.$file.'` is not found.');\n // If the configuration file name does not exist and is the default, does not throw an exception.\n } else {\n Logger::getInstance()->info(self::DEFAULT_FILE_PATH.' is not found.');\n }\n\n // If the arguments are given, set it.\n if ($arguments['php-version']) {\n self::setOption('php_version', $arguments['php-version']);\n }\n if ($arguments['ignore-tools']) {\n self::setOption('ignore_tools', $arguments['ignore-tools']);\n }\n if ($arguments['only-tools']) {\n self::setOption('only_tools', $arguments['only-tools']);\n }\n if ($arguments['ignore-paths']) {\n self::setOption('ignore_paths', $arguments['ignore-paths']);\n }\n if ($arguments['extensions']) {\n self::setOption('extensions', $arguments['extensions']);\n }\n if ($arguments['vendor']) {\n self::setOption('vendor', $arguments['vendor']);\n }\n if ($arguments['format']) {\n self::setOption('format', $arguments['format']);\n }\n\n // Append ignore tools based on only tools\n if (!empty(self::$config->only_tools)) {\n $ignore_tools = array_filter(ToolBox::VALID_TOOLS, function ($tool) {\n return !in_array($tool, self::$config->only_tools, true);\n });\n self::$config->ignore_tools = array_unique(array_merge(self::$config->ignore_tools, $ignore_tools));\n }\n\n // If disabled vendor flag, add `vendor` directory to ignore paths.\n if (!self::$config->vendor) {\n self::$config->ignore_paths[] = 'vendor';\n }\n\n // Resolve ignore_paths to file name and reset.\n self::$config->ignore_paths = array_map(function ($path) {\n return realpath($path);\n }, Loader::dig(self::$config->ignore_paths, self::$config));\n\n Logger::getInstance()->info('PHP version: '.self::$config->php_version);\n Logger::getInstance()->info('Ignore tools: '.var_export(self::$config->ignore_tools, true));\n Logger::getInstance()->info('Ignore paths: '.var_export(self::$config->ignore_paths, true));\n Logger::getInstance()->info('Extensions: '.var_export(self::$config->extensions, true));\n Logger::getInstance()->info('Vendor: '.var_export(self::$config->vendor, true));\n Logger::getInstance()->info('Format: '.self::$config->format);\n }", "private function setupPHPConfigFiles()\n {\n foreach( glob('app/etc/*.php') as $file )\n {\n $key = str_replace('.php', null, basename($file));\n $data = include $file;\n \n $this->config->add($key, $data);\n }\n }" ]
[ "0.76238066", "0.75923675", "0.7495463", "0.7228489", "0.7221532", "0.7208892", "0.70912826", "0.69257027", "0.6921208", "0.68888867", "0.68343294", "0.6818689", "0.6799044", "0.6752239", "0.6751264", "0.67224234", "0.66852796", "0.66703916", "0.6600766", "0.6572733", "0.6541657", "0.65218985", "0.6517243", "0.64912987", "0.6471386", "0.64687806", "0.6459874", "0.64426386", "0.64092845", "0.64058125", "0.63963217", "0.6384738", "0.6384638", "0.63589543", "0.63457775", "0.63241297", "0.6297983", "0.62683845", "0.62671775", "0.62629336", "0.6262224", "0.62408066", "0.623512", "0.6214771", "0.61961937", "0.61795825", "0.61733156", "0.6170084", "0.6161637", "0.6158653", "0.6151233", "0.6140671", "0.6140143", "0.61361253", "0.6133727", "0.61330396", "0.6131369", "0.61307305", "0.6112423", "0.6095498", "0.6063981", "0.6038489", "0.6037703", "0.60359824", "0.603448", "0.6031173", "0.6029025", "0.60159266", "0.5995369", "0.59851474", "0.5981778", "0.59674037", "0.59464115", "0.5941215", "0.5932562", "0.59260666", "0.591535", "0.5914105", "0.58654124", "0.58635694", "0.58612514", "0.5860333", "0.58592504", "0.58580446", "0.58441454", "0.58326507", "0.5828718", "0.5828234", "0.58235604", "0.58229524", "0.58170956", "0.58081186", "0.58079237", "0.5803592", "0.5794847", "0.57871586", "0.5771177", "0.5764832", "0.5734776", "0.57330114" ]
0.6397723
30
Use mapping to load specific file for a configuration item.
public function testUseMapping() { $cfg = new Configuration(); $cfg->setBaseDirectories($this->dirs); $cfg->setMapping("item", ANAX_INSTALL_PATH . "/test/config/test1.php"); $config = $cfg->load("item"); $this->assertInternalType("array", $config); $this->assertArrayHasKey("file", $config); $this->assertArrayHasKey("config", $config); $this->assertArrayHasKey("key1", $config["config"]); $this->assertContains("value1", $config["config"]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "abstract protected function _loadMappingFile($file);", "abstract protected function _loadMappingFile($file);", "public static function load($mapName)\n {\n\n foreach (Conf::$confPath as $path) {\n\n if (!$this->source)\n $menuPath = $path.'/menu/'.$this->name.'/';\n else\n $menuPath = $path.'/menu/'.$this->source.'/';\n\n if (!file_exists($menuPath))\n continue;\n\n $folder = new LibFilesystemFolder($menuPath);\n\n foreach ($folder->getFiles() as $file)\n include $file->getName(true);\n\n // break after found data\n break;\n }\n\n }", "public function loadMappings($filepath);", "public abstract function loadConfig($fileName);", "function configurationLoad() {\n\t\tglobal $podserver_config_map;\n\t\t$item_idx = 0;\n\t\tunset($this->itemsConfiguration);\n\t\t$this->itemsConfiguration = array();\n\t\t// load the configuration details for each item in the map\n\t\tforeach ($podserver_config_map as $itemToConfigure){\n\t\t\t// get the configuration variable by indirection ($$)\n\t\t\tglobal $$itemToConfigure[0];\n\t\t\t// get the label for the item in the correct language by indirection ($$)\n\t\t\t$label_item_variable = 'label_'.$itemToConfigure[0];\n\t\t\tglobal $$label_item_variable;\n\t\t\tif ($$label_item_variable == '') $$label_item_variable = '$'.$label_item_variable;\n\t\t\tif (isset($_SESSION['lang']) && $_SESSION['lang'] == 'debug') $$label_item_variable = '$'.$label_item_variable;\n\t\t\t// get the help for the item in the correct language by indirection ($$)\n\t\t\t$help_item_variable = 'help_'.$itemToConfigure[0];\n\t\t\tglobal $$help_item_variable;\n\t\t\tif (isset($_SESSION['lang']) && $_SESSION['lang'] == 'debug') $$help_item_variable = '$'.$help_item_variable;\n\t\t\t// get the title for the item in the correct language by indirection ($$)\n\t\t\t$title_item_variable = 'title_'.$itemToConfigure[0];\n\t\t\tglobal $$title_item_variable;\n\t\t\t// show title variable name for language debug\n\t\t\tif (isset($_SESSION['lang']) && $_SESSION['lang'] == 'debug') $$title_item_variable = '$'.$title_item_variable;\n\t\t\t// get the default value from configuration map if no value found for the item in the configuration file\n\t\t\tif ($$itemToConfigure[0] == '') $$itemToConfigure[0] = $itemToConfigure[4];\n\t\t\t// load the item with all datas (map, value, title and label)\n\t\t\t$this->itemsConfiguration[] = new ItemConfiguration(\n\t\t\t\t\t\t\t$itemToConfigure[0],\n\t\t\t\t\t\t\t$itemToConfigure[1],\n\t\t\t\t\t\t\t$itemToConfigure[2],\n\t\t\t\t\t\t\t$itemToConfigure[3],\n\t\t\t\t\t\t\t$$itemToConfigure[0],\n\t\t\t\t\t\t\t$itemToConfigure[5],\n\t\t\t\t\t\t\t$$label_item_variable,\n\t\t\t\t\t\t\t$$title_item_variable,\n\t\t\t\t\t\t\t$$help_item_variable\n\t\t\t\t\t\t\t);\t\t\t\n\t\t}\n\t}", "function loadFileMap()\r\n{\r\n return false;\r\n $file_map_path = Gravitycar\\lib\\builders\\FileMapBuilder::getFileMapPath();\r\n if (file_exists($file_map_path)) {\r\n require_once($file_map_path);\r\n } else {\r\n buildFileMap();\r\n require_once($file_map_path);\r\n }\r\n return $map;\r\n}", "public function load_maps_file()\r\n {\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file from manaserv');\r\n\r\n // load the configured path and filename from config file\r\n $this->maps_file = $this->CI->config->item('manaserv-data_path') . XML_MAPS_FILE;\r\n\r\n // check if the file really exists and is readable\r\n if (!file_exists($this->maps_file))\r\n {\r\n show_error('The '. XML_MAPS_FILE .' file ' . $this->maps_file . ' configured'.\r\n ' in mana_config.php cannot be found');\r\n return;\r\n }\r\n else\r\n {\r\n // reset current maps\r\n $this->maps = array();\r\n\r\n // load and parse the xml file\r\n $maps = simplexml_load_file($this->maps_file);\r\n foreach ($maps as $map)\r\n {\r\n // loop through defined maps and build internal array\r\n $m = new Map(\r\n intval($map->attributes()->id), // id\r\n strval($map->attributes()->name) // name\r\n );\r\n\r\n // set description if available\r\n if (strlen(strval($map->attributes()->description)) > 0)\r\n {\r\n $m->setDescription(strval($map->attributes()->description));\r\n }\r\n\r\n $this->maps[$m->getId()] = $m;\r\n }\r\n\r\n $this->flush_maps();\r\n }\r\n log_message('debug', 'Reloading '. XML_MAPS_FILE .' file ... done');\r\n }", "abstract protected function defineMapping();", "public function load()\n {\n foreach ($this->aMappingConfiguration as $sLinkedEntity => $aMappingSetup) {\n $this->loadMapped(new $sLinkedEntity());\n }\n }", "abstract protected function getMapping();", "abstract protected function getMapping();", "abstract protected function loadConfiguration($name);", "private function mapPath($file)\n {\n if (isset(static::$staticMapping[$file])) {\n return static::$staticMapping[$file];\n }\n\n return $file;\n }", "abstract public function load($filename);", "protected function loadMappingFile($file)\n {\n return Yaml::parse(file_get_contents($file));\n }", "abstract protected function loadConfig();", "abstract public function load($file, $context);", "protected function setMap( $map_file )\n {\n $handle = file_get_contents( get_template_directory_uri() . '/includes/gravityforms/' . $map_file );\n $this->map = json_decode( $handle, true );\n }", "public function __construct() {\n $json = file_get_contents(\"config/app.json\");\n // Decodes data from that file and changes $map to that data.\n $this->map = json_decode($json, true);\n }", "protected static function loadSingleExtLocalconfFiles() {}", "abstract protected function loadDefinition();", "protected function xmlIniMapFactory()\n {\n $map = new Map();\n $map->add(\n Path::factory('/fwk/ini', 'ini', array())\n ->loop(true)\n ->attribute('category')\n ->value('value')\n );\n \n return $map;\n }", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "abstract protected function load();", "function load( $filename = NULL )\n\t{\n\t\tif ( is_file( $filename ) ) {\n\n\t\t} else {\n\t\t\tthrow new FileNotFound( 'config file not exist!' );\n\t\t}\n\t}", "public function getMappingTargets() {\n $targets = parent::getMappingTargets();\n $targets['fid'] = array(\n 'name' => t('File ID'),\n 'description' => t('The fid of the file. NOTE: use this feature with care, file ids are usually assigned by Drupal.'),\n 'optional_unique' => TRUE,\n );\n $targets['filename'] = array(\n 'name' => t('Filename'),\n 'description' => t('The filename of the file.'),\n 'optional_unique' => TRUE,\n );\n $targets['uri'] = array(\n 'name' => t('File URI'),\n 'description' => t('The URI of the file. NOTE: use this feature with care, file URIs are usually assigned by Drupal. If the media module is installed, it will attempt to parse the passed URI for remote files.'),\n 'optional_unique' => TRUE,\n );\n $targets['bundle'] = array(\n 'name' => t('File Type'),\n 'description' => t('The type/bundle of the file. NOTE: use this feature with care, file types are usually assigned by Drupal.'),\n );\n $targets['uid'] = array(\n 'name' => t('User ID'),\n 'description' => t('The Drupal user ID of the file author.'),\n );\n $targets['user_name'] = array(\n 'name' => t('Username'),\n 'description' => t('The Drupal username of the file author.'),\n );\n $targets['user_mail'] = array(\n 'name' => t('User email'),\n 'description' => t('The email address of the file author.'),\n );\n $targets['node_usage'] = array(\n 'name' => t('File usage (node) by Feeds GUID'),\n 'description' => t('The list of nodes that use a file.'),\n 'optional_unique' => TRUE,\n );\n $targets['term_usage'] = array(\n 'name' => t('File usage (term) by Feeds GUID'),\n 'description' => t('The list of terms that use a file.'),\n 'optional_unique' => TRUE,\n );\n\n // Let other modules expose mapping targets.\n self::loadMappers();\n $entity_type = $this->entityType();\n $bundle = $this->config['bundle'] ? $this->config['bundle'] : FILE_TYPE_NONE;\n drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle);\n\n return $targets;\n }", "public function load($file);", "public function load($file);", "public function load($file);", "protected function _resourceMap()\n\t{\n\t\t$resourceMap = new \\ResourceMapGenerator();\n\t\t$id = '';\n\n\t\t// Retrieves the ID from alias\n\t\tif (substr(strtolower($this->_alias), -4) == '.rdf')\n\t\t{\n\t\t\t$lastSlash = strrpos($this->_alias, '/');\n\t\t\t$lastDot = strrpos($this->_alias, '.rdf');\n\t\t\t$id = substr($this->_alias, $lastSlash, $lastDot);\n\t\t}\n\n\t\t// Create download headers\n\t\t$resourceMap->pushDownload($this->config->get('webpath'));\n\t\texit;\n\t}", "public abstract function load();", "function load($filename){\n\n\t\t//Check if the input is valid\n\t\tif(!\\lib_validation\\validate($filename, LV_STRING))\n\t\t\treturn null;\n\t\t\n\t\t//Escape characters just to be safe \n\t\t$filename = addslashes($filename);\n\t\t\n\t\t//Convert namespace to a file path\n\t\t$filename = \"configs/\" . $filename . \".json\";\n\t\t\n\t\t//Checks if the file exists\n\t\tif(!file_exists($filename))\n\t\t\treturn null;\n\t\t\n\t\t//Load the file\n\t\t$json = file_get_contents($filename);\n\t\t\n\t\t//Parse the file\n\t\t$data = json_decode($json, true);\n\t\t\n\t\t//Return the results (associative array)\n\t\treturn $data;\n\t}", "public function loadFromFile($file)\n {\n \n }", "function loadConf($id, $file=CONFERENCES)\n{\n\t$confs = getJSON($file);\n\t$index = searchIndex($confs, $id);\n\t$result = NULL;\n\t\n\tif($index >= 0){\n\t\t$result = $confs[$index];\n\t}\n\treturn $result;\n}", "abstract public function load();", "abstract public function load();", "protected function _config_mapper($param)\n { \n \tif($this->sh_Options){\n \t\t// post init customization variables.\n \t\t$this->sh_Options = array_merge((array)$this->sh_Options, (array)$param);\n \t} else {\n \t\t// constructor initialization with default values from config file.\n \t\t$this->sh_Options = $param;\n \t}\n }", "function cfgLoader($loadType = null, $jsonFile = null, $iniFile = null , $fullPath = null, $arrayFile = null){\n $this->loadType = ($loadType==null) ? \"ANY\" : $loadType;\n\n //Default file names or provided names\n $this->jsonFile = ($jsonFile==null) ? \"config.json\" : $jsonFile;\n $this->iniFile = ($iniFile == null) ? \"config.ini\" : $iniFile;\n $this->arrayFile = ($arrayFile == null) ? \"arraycfg.php\" : $arrayFile;\n\n //Default folder for cfg files\n $this->fullPath = ($fullPath == null) ? \"../cfg/\" : $fullPath;\n\n switch ($this->loadType){\n case \"ANY\":\n $this->loadJson();\n $this->loadIni();\n $this->loadArray();\n break;\n\n case \"JSON\":\n $this->loadJson();\n break;\n\n case \"INI\":\n $this->loadIni();\n break;\n\n case \"ARRAY\":\n $this->loadArray();\n break;\n }\n }", "public function buildClassAliasMapFile() {}", "protected function _getMapping($className)\n {\n //try loading mapping from original driver first\n $mapping = null;\n if (!is_null($this->_originalDriver)) {\n if ($this->_originalDriver instanceof FileDriver) {\n $mapping = $this->_originalDriver->getElement($className);\n }\n }\n\n //if no mapping found try to load mapping file again\n if (is_null($mapping)) {\n $yaml = $this->_loadMappingFile($this->locator->findMappingFile($className));\n $mapping = $yaml[$className];\n }\n\n return $mapping;\n }", "function load_configs($file, $is_global = true)\n{\n\n if (substr($file, -5) != '.json') {\n throw new Exception('Invalid config file found in configs folder.');\n }\n\n $fname = strtolower(substr(basename($file), 0, - (strlen('.json'))));\n\n $GLOBALS[\"__CONFIG__{$fname}__\"] = json_decode(file_get_contents($file), true);\n}", "public function getMapping() {}", "public static function load()\n {\n $files = glob(BASEDIR . '/config/*.php');\n foreach ($files as $file){\n $key = str_replace('.php', '', basename($file));\n static::$values[$key] = include $file;\n }\n }", "function sconfig_item($name, $item) {\r\r\n\r\r\n static $config_item = array();\r\r\n\r\r\n if (!isset($config_item[$item])) {\r\r\n\r\r\n $config = config_load($name);\r\r\n\r\r\n if (!isset($config[$item]))\r\r\n return FALSE;\r\r\n\r\r\n $config_item[$item] = $config[$item];\r\r\n }\r\r\n\r\r\n return $config_item[$item];\r\r\n}", "public function loadXMLFile($filename,$map_path, $formatting = FALSE){\r\n \r\n $path = $this->_preparePath($map_path);\r\n $this->xmlfile = $this->_initDocument($path .DS. $filename, $formatting);\r\n \r\n $this->absolutepath = rtrim($path,'/') .DS. $filename;\r\n \r\n return $this->xmlfile;\r\n }", "protected function setMainDictionaryPath() {}", "public function getPropertyMappingConfiguration() {}", "public function testConfigurationFromFile()\n {\n $path = __DIR__ . '/files/file1.config.php';\n\n $configuration = Factory::fromFile($path);\n\n $this->assertInstanceOf(Configuration::class, $configuration);\n $this->assertEquals(include $path, $configuration->getInternalContainer());\n }", "function SM_loadConfigReader($rName, $user, $rFile='') {\n \n // globalize\n global $SM_siteManager;\n\n // rFile shouldn't be passed unless this is SMCONFIG calling us\n if ($rFile == '') {\n // find file\n $rFile = $SM_siteManager->findSMfile($rName.'_reader', 'configReaders', 'inc', true);\n }\n\n // include the file\n include_once($rFile);\n\n // found it, instantiate and return\n $className = 'SM_configReader_'.$rName;\n $reader = new $className();\n $reader->setUser($user);\n\n return $reader;\n}", "protected function loadMappedFile($class){\n // check for existing base directory in the $baseDir\n if (isset($this->baseDir[$class]) === false) {\n return false;\n } else {\n // look through base directories for this namespace prefix\n foreach ($this->baseDir as $key => $value) {\n if($key === $class) {\n // create the file from base directory and the class with extension\n $file = $value\n . $this->splitClass($class)\n . '.php';\n \n // get the File\n if ($this->requireFile($file)) {\n // yeah, we're done\n return $file;\n } else {\n // Houston, we have problem. it didn't work\n return false;\n }\n }\n }\n }\n }", "private function mapData($originalValue, $filename)\n {\n $path = $this->kernel->getContainer()->getParameter('path_maps') . DIRECTORY_SEPARATOR . $filename . \".json\";\n $content = @file_get_contents($path);\n if ($content && $maps = json_decode($content, true)) {\n $originalValue = mb_strtolower($originalValue);\n $mappedValue = isset($maps[$originalValue]) ? $maps[$originalValue] : $originalValue;\n } else {\n $mappedValue = $originalValue;\n }\n return $mappedValue;\n }", "protected function loadFile(SplFileInfo $file)\n {\n $path = $this->shimsDirectory . $file->getRelativePath() . '/' . $file->getFilename();\n\n require $path;\n }", "private function LoadConfigFile(){\n $a = file_get_contents($this->RootDIR . 'config/main.json');\n $this->Config = json_decode($a, true);\n }", "private function loadFiles()\n {\n $finder = new Finder();\n\n foreach (Config::get('routing_dirs') as $directory) {\n $finder\n ->files()\n ->name('*.yml')\n ->in($directory)\n ;\n\n foreach ($finder as $file) {\n $resource = $file->getRealPath();\n $this->routes = array_merge($this->routes, Yaml::parse(file_get_contents($resource)));\n }\n }\n }", "function someloader($filepath) {\n\treturn SomeLoader::import($filepath);\n}", "function load($classmap, $base = null) {\n spl_autoload_register(function($class) use ($classmap, $base) {\n $class = strtolower($class);\n if(!isset($classmap[$class])) return false;\n if($base) {\n include($base . DS . $classmap[$class]); \n } else {\n include($classmap[$class]);\n }\n });\n}", "function loadIniFiles()\n {\n \n $ff = HTML_FlexyFramework::get();\n $ff->generateDataobjectsCache(true);\n $this->dburl = parse_url($ff->database);\n \n \n $dbini = 'ini_'. basename($this->dburl['path']);\n \n \n $iniCache = isset( $ff->PDO_DataObject) ? $ff->PDO_DataObject['schema_location'] : $ff->DB_DataObject[$dbini];\n if (!file_exists($iniCache)) {\n return;\n }\n \n $this->schema = parse_ini_file($iniCache, true);\n $this->links = parse_ini_file(preg_replace('/\\.ini$/', '.links.ini', $iniCache), true);\n \n\n \n }", "function setClassMappingsPath($value) {\n\t\t//$path = realpath($value . '/') . '/';\n\t\t$GLOBALS['amfphp']['customMappingsPath'] = $value;\n\t}", "private function loadFromMediaItem(MediaItem $item)\n\t{\n\t\t// set srcPath dependent if absolute path was given or not\n\t\t$this->srcPath = $item->fullPath;\n\t\t// is the file existing\n\t\tif (!file_exists($this->srcPath))\n\t\t\tthrow new \\Exception(\"This File does not exist or path ROOT'$item->path' is wrong\");\n\t\t// load\n\t\t$this->intern_load();\n\t}", "public function getItemFromPath($givenItemPath);", "public function __construct($map) {\r\n\t\tif(is_numeric($map)) {\r\n\t\t\t$this->id = (int)$map;\r\n\t\t\t$this->path = Imperator::getSettings()->getBasePath().'/etc/maps/'.$map.'.xml';\r\n\t\t} else {\r\n\t\t\t$this->id = (int)(basename($map, '.xml'));\r\n\t\t\t$this->path = $map;\r\n\t\t}\r\n\t\tif(!file_exists($this->path)) {\r\n\t\t\tthrow new \\InvalidArgumentException('Map \"'.$this->id.'\" not found at \"'.$this->path.'\".');\r\n\t\t}\r\n\t}", "public function testConfigFromSingleFile()\n {\n $cfg = new Configuration();\n $cfg->setBaseDirectories($this->dirs);\n $config = $cfg->load(\"view\");\n\n $this->assertInternalType(\"array\", $config);\n $this->assertArrayHasKey(\"file\", $config);\n $this->assertArrayHasKey(\"config\", $config);\n $this->assertArrayNotHasKey(\"items\", $config);\n $this->assertContains(\"a view\", $config[\"config\"]);\n }", "public static function loadStrapper() {\n\t\t\n\t}", "public function map($aliases)\n\t{\n\t\tforeach ((array) $aliases as $alias => $file)\n\t\t{\n\t\t\tif ( ! is_numeric($alias))\n\t\t\t{\n\t\t\t\t$this->aliases[$alias] = $this->parse($file);\n\t\t\t}\n\t\t}\n\t}", "function config($key = null, $default = null)\n {\n $data = null;\n\n $base_directory = base_directory() . '/config/';\n\n $keys = explode('.', $key);\n $keyLength = count($keys);\n\n if ($keyLength > 1) {\n $file = $base_directory . $keys[0] . '.php';\n if (file_exists($file)) {\n $data = include $file;\n\n //Parse into the array structure of file\n for ($i = 1; $i < $keyLength; $i++) {\n $data = $data[$keys[$i]];\n }\n } else {\n //throw new \\App\\Exceptions\\GeneralException('asdasdasdasdsa');\n throw new Exception('Config : ' . $file . ' file does not exists.');\n }\n } else {\n return;\n }\n return $data;\n }", "public function load($path);", "public function load($path);", "public function load($path);", "function _loadCustom($f_name, $localename)\r\n\t{\r\n\t\t/* custom language file */\r\n\t\t$f = $this->_getFileName();\r\n\t\t$f_custom = str_replace($this->pathFile, $f_name, $f);\r\n\t\t$f_custom = str_replace($this->pathLocale , $localename, $f_custom);\r\n\t\t$f_name = $this->varName.'_'.$f_name;\r\n\t\tif (file_exists($f_custom))\r\n\t\t{\r\n\t\t\tinclude($f_custom);\r\n\t\t\tif (isset(${$this->varName}))\r\n\t\t\t{\r\n\t\t\t\t$this->$f_name = ${$this->varName};\r\n\t\t\t}\r\n# asort($this->$f_name);\r\n\t\t}\r\n\t}", "protected function getConfigLoader()\n\t{\n\t\treturn new FileLoader(new Filesystem, $this->defaultPath);\n\t}", "public function load($key);", "public function load($name);", "protected function load()\n {\n if ($this->cache->contains($this->getCacheKey())) {\n $this->map = $this->cache->fetch($this->getCacheKey());\n } else {\n $this->generateMap();\n }\n }", "private static function loadAppConfig() {\n\t\t\t$appConfJson = file_get_contents(JIAOYU_PROJECT_HOME.\"/app/conf/config.json\");\n\t\t\ttry {\n\t\t\t\t$appConf = JsonUtils::decode($appConfJson);\n\t\t\t} catch (JsonException $e) {\n\t\t\t\tthrow new ConfigurationException(\"Error initializing app config: \".$e->getMessage());\n\t\t\t}\n\n\t\t\t// OK - now we can load up the config array from the file\n\t\t\tforeach ($appConf as $configKey => $configValue) {\n\t\t\t\tself::$config[$configKey] = $configValue;\n\t\t\t}\n\t\t}", "private function loadIni(){\n if(file_exists($this->fullPath.$this->iniFile)) {\n $arCfg = parse_ini_file($this->fullPath.$this->iniFile);\n $this->loadConfigs($arCfg);\n }\n }", "protected function _findMappingFile($className)\n {\n $fileName = str_replace('\\\\', '.', $className) . $this->_fileExtension;\n \n // Check whether file exists\n foreach ((array) $this->_paths as $path) {\n if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {\n return $path . DIRECTORY_SEPARATOR . $fileName;\n }\n }\n\n throw MappingException::mappingFileNotFound($className, $fileName);\n }", "public function loadFile($filePath);", "function map_image($map_name)\n {\n $html_dir = path(config('file_layout', 'html_dir', './html'));\n $map_dir = config('static_files', 'map_image_dir', 'static/images/maps');\n $ext = config('static_files', 'map_image_ext', '.jpg');\n $mapfile = $map_dir . '/' . $map_name . $ext;\n if (file_exists($html_dir . '/' . $mapfile)) {\n return $mapfile;\n }\n $no_image_file = config('static_files', 'map_no_image_file', 'no-image.jpg');\n $theme_no_image_file = path($html_dir . '/themes/' . current_theme() . '/images/' . $no_image_file);\n if (file_exists($theme_no_image_file)) { //search file in theme first.\n return 'themes/' . curretn_theme() . '/images/' . $no_image_file;\n } elseif (file_exists($html_dir . '/' . $map_dir . '/' . $no_image_file)) {\n return $map_dir . '/' . $no_image_file;\n }\n return '';\n }", "public function get($key, $default = null)\n {\n list($namespace, $group, $item) = $this->parseKey($key);\n\n // Configuration items are actually keyed by \"collection\", which is simply a\n // combination of each namespace and groups, which allows a unique way to\n // identify the arrays of configuration items for the particular files.\n $collection = $this->getCollection($group, $namespace);\n\n $this->load($group, $namespace, $collection);\n\n return array_get($this->items[$collection], $item, $default);\n }", "static function loadConfig() {\n\t\t$config = self::file($_SERVER[\"DOCUMENT_ROOT\"] . \"/../config.json\");\n\t\tif (!is_null($config))\n\t\t\tself::$config = json_decode($config);\n\t}", "public function loadSchemaFromFile(string $fileName): void\n {\n // Guessing which loader has to be used in this case\n // Ex: for .bini file, we will use BoucheryDescLoader\n $loader = $this->findMatchingLoader($fileName);\n\n // If no loader was found\n if (!$loader) {\n throw new LoaderNotFoundException(sprintf(\n 'No loader was found to analyse \"%s\" !',\n $fileName\n ));\n }\n\n // We load the configuration out of the file\n $this->configuration = $loader->load($fileName);\n }", "public function load($filePath)\n\t{\n\t $filePath = SugarAutoLoader::existingCustomOne($filePath);\n\n\t\t$dashletdefs = array();\n\t\tinclude($filePath);\n\t\t$this->dashletdefs = $dashletdefs;\n\t}", "private function Load($fullpath, $data=null){\r\n global $BASECONFIG;\r\n extract($BASECONFIG[\"ALIASES\"]);\r\n if(!is_null($data)){\r\n extract($data);\r\n }\r\n if(file_exists($fullpath)){\r\n require_once ($fullpath);\r\n return true;\r\n }\r\n else{\r\n return false;\r\n }\r\n }", "public function loadCacheFile( $filepath, $classname );", "public function init()\n\t{\n\t\tparent::init();\n\t\t//$this->itemFile = Yii::getAlias($this->itemFile);\n\t\t$this->load();\n\t}", "public static function fileConfig($resource)\n {\n self::$config = new Config($resource, new ConfigLoader());\n self::$config->load();\n self::$config->configure();\n }", "public function loadYamlConfig($filepath);", "function loadFile($src){\n if(file_exists($src) && is_readable($src))\n {\n include $src;\n if(isset($CONFIG)) $this->add($CONFIG);\n }\n }", "protected function loadFile(string $filename)\n\t{\n\t\tif (!isset($this->configFileLoaded[$filename])) {\n\t\t\t/* config folder Stored locally already resolved. Done in __construct */\n\t\t\t$file = $this->configFolder . $filename . '.php';\n\n\t\t\tif (file_exists($file)) {\n\t\t\t\t$this->config[strtolower($filename)] = require $file;\n\t\t\t}\n\n\t\t\t$this->configFileLoaded[$filename] = true;\n\t\t}\n\t}", "function yml_get_file($search, $ymlfile)\n {\n return yml::getFile($search, $ymlfile);\n }", "public function loadAliasesFrom($path, $namespace, $key = 'aliases');", "public function get_loader($key)\n {\n }", "private function getDataFromFilename($fileRoute) {\n\n //Single item details\n $fileInstance = File::instance(DATA_DIR . 'proposal/' . $fileRoute);\n\n if (!$fileInstance->content()) {\n //Item not found\n return;\n }\n\n return Yaml::parse($fileInstance->content());\n }", "function config_item($field)\r\r\n {\r\r\n $CI =& get_instance(); \r\r\n //return the full asset path\r\r\n return $CI->config->config[$field];\r\r\n }", "private function map(): \\Generator\n {\n $path = realpath($this->path) . '/composer/autoload_psr4.php';\n\n if (file_exists($path) && is_array($map = require $path)) {\n yield from $map;\n }\n }", "public function load()\n\t{\n\t\tif (file_exists(self::$configPath))\n\t\t{\n\t\t\t$this->config = json_decode(file_get_contents(self::$configPath), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->config = array();\n\t\t}\n\t}", "protected function initFileLoader() \n\t{\n\t\t$this->fileLoader = new FileLoader();\n\t}" ]
[ "0.715688", "0.715688", "0.674381", "0.66927046", "0.59624374", "0.58681685", "0.577434", "0.56895036", "0.5648088", "0.547104", "0.54583377", "0.54583377", "0.5452885", "0.535551", "0.5302228", "0.53017014", "0.5297954", "0.5230354", "0.5229483", "0.51966995", "0.51557714", "0.5150051", "0.51483804", "0.5137139", "0.5137139", "0.5137139", "0.5137139", "0.5091613", "0.5043832", "0.50417966", "0.50417966", "0.50417966", "0.50261456", "0.50232315", "0.50096434", "0.49784014", "0.4970064", "0.4945799", "0.4945799", "0.49274483", "0.49214813", "0.49110365", "0.49012047", "0.49010924", "0.48879135", "0.4862674", "0.48608905", "0.48483652", "0.484209", "0.48335797", "0.48291916", "0.48270243", "0.4820353", "0.47994947", "0.47848722", "0.47642827", "0.47563997", "0.47550088", "0.47529855", "0.47510803", "0.47484583", "0.47316176", "0.47172526", "0.47116658", "0.47089878", "0.4698058", "0.46958026", "0.4694533", "0.46862105", "0.46862105", "0.46862105", "0.46844512", "0.46830714", "0.4664452", "0.46609804", "0.46547386", "0.46534353", "0.46516618", "0.46498004", "0.46485212", "0.4637272", "0.4634717", "0.46246612", "0.46243864", "0.4624028", "0.46230298", "0.46043774", "0.46011627", "0.45945457", "0.45860463", "0.45813075", "0.4579202", "0.4568195", "0.45624343", "0.45538875", "0.4552512", "0.45507836", "0.4547485", "0.45466718", "0.45427352" ]
0.69689333
2
' hash_call: Function to perform the API call to PayPal using API signature
protected function hash_call($methodName, $nvpStr) { $API_Endpoint = Config::get('paypal.api_endpoint'); //'------------------------------------ //' PayPal API Credentials //' Replace <API_USERNAME> with your API Username //' Replace <API_PASSWORD> with your API Password //' Replace <API_SIGNATURE> with your Signature //'------------------------------------ $API_UserName = Config::get('paypal.api_username'); $API_Password = Config::get('paypal.api_password'); $API_Signature = Config::get('paypal.api_signature'); // BN Code is only applicable for partners $sBNCode = "PP-ECWizard"; $PROXY_HOST = '127.0.0.1'; $PROXY_PORT = '808'; $USE_PROXY = false; $version = "93"; //setting the curl parameters. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $API_Endpoint); curl_setopt($ch, CURLOPT_VERBOSE, 1); //turning off the server and peer verification(TrustManager Concept). curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled. //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php if ($USE_PROXY) curl_setopt($ch, CURLOPT_PROXY, $PROXY_HOST . ":" . $PROXY_PORT); //NVPRequest for submitting to server $nvpreq = "METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode); //setting the nvpreq as POST FIELD to curl curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq); //getting response from server $response = curl_exec($ch); //convrting NVPResponse to an Associative Array $nvpResArray = $this->deformatNVP($response); $nvpReqArray = $this->deformatNVP($nvpreq); $_SESSION['nvpReqArray'] = $nvpReqArray; if (curl_errno($ch)) { // moving to display page to display curl errors $_SESSION['curl_error_no'] = curl_errno($ch); $_SESSION['curl_error_msg'] = curl_error($ch); //Execute the Error handling module to display errors. } else { //closing the curl curl_close($ch); } return $nvpResArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function hash_call($methodName, $nvpStr)\r\n {\r\n \r\n //declaring of global variables\r\n //global $API_Endpoint, $API_UserName, $API_Password, $API_Signature, $API_AppID;\r\n //global $USE_PROXY, $PROXY_HOST, $PROXY_PORT;\r\n \r\n $this->API_Endpoint .= \"/\" . $methodName;\r\n \r\n //setting the curl parameters.\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL,$this->API_Endpoint);\r\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\r\n\r\n //turning off the server and peer verification(TrustManager Concept).\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\r\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\r\n\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\r\n curl_setopt($ch, CURLOPT_POST, 1);\r\n \r\n // Set the HTTP Headers\r\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\r\n 'X-PAYPAL-REQUEST-DATA-FORMAT: NV',\r\n 'X-PAYPAL-RESPONSE-DATA-FORMAT: NV',\r\n 'X-PAYPAL-SECURITY-USERID: ' . $this->API_UserName,\r\n 'X-PAYPAL-SECURITY-PASSWORD: ' .$this->API_Password,\r\n 'X-PAYPAL-SECURITY-SIGNATURE: ' . $this->API_Signature,\r\n 'X-PAYPAL-SERVICE-VERSION: 1.3.0',\r\n 'X-PAYPAL-APPLICATION-ID: ' . $this->API_AppID\r\n ));\r\n \r\n //if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\r\n //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \r\n if($this->USE_PROXY)\r\n curl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST. \":\" . $this->PROXY_PORT); \r\n\r\n // RequestEnvelope fields\r\n $detailLevel = urlencode(\"ReturnAll\"); // See DetailLevelCode in the WSDL for valid enumerations\r\n $errorLanguage = urlencode(\"en_US\"); // This should be the standard RFC 3066 language identification tag, e.g., en_US\r\n\r\n // NVPRequest for submitting to server\r\n $nvpreq = \"requestEnvelope.errorLanguage=$errorLanguage&requestEnvelope.detailLevel=$detailLevel\";\r\n $nvpreq .= \"&$nvpStr\";\r\n\r\n //setting the nvpreq as POST FIELD to curl\r\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\r\n \r\n //getting response from server\r\n $response = curl_exec($ch);\r\n \r\n //converting NVPResponse to an Associative Array\r\n $nvpResArray=$this->deformatNVP($response);\r\n $nvpReqArray=$this->deformatNVP($nvpreq);\r\n $_SESSION['nvpReqArray']= $nvpReqArray;\r\n\r\n if (curl_errno($ch)) \r\n {\r\n // moving to display page to display curl errors\r\n $_SESSION['curl_error_no']=curl_errno($ch) ;\r\n $_SESSION['curl_error_msg']=curl_error($ch);\r\n\r\n //Execute the Error handling module to display errors. \r\n } \r\n else \r\n {\r\n //closing the curl\r\n curl_close($ch);\r\n }\r\n\r\n return $nvpResArray;\r\n }", "function hash_call($methodName,$nvpStr){\n\t\t//declaring of global variables\n\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->PAYPAL_API_ENDPOINT);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t\t//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \n\t\tif($this->PAYPAL_USE_PROXY)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PAYPAL_PROXY_HOST.\":\".$this->PAYPAL_PROXY_PORT); \n\t\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->PAYPAL_VERSION) . $nvpStr;\t\n\t\t}\n\t\t\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\t\t\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray = $this->deformatNVP($response);\n\t\t$nvpReqArray = $this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} else {\n\t\t\t//closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t}\n\t\n\treturn $nvpResArray;\n\t}", "function hash_call($methodName,$nvpStr)\n\t{\n\t\tsession_start();\n\t\t// form header string\n\t\t$nvpheader=$this->nvpHeader();\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t//in case of permission APIs send headers as HTTPheders\n\t\tif(!empty($this->AUTH_token) && !empty($this->AUTH_signature) && !empty($this->AUTH_timestamp))\n\t\t {\n\t\t\t$headers_array[] = \"X-PP-AUTHORIZATION: \".$nvpheader;\n\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, $headers_array);\n\t\tcurl_setopt($ch, CURLOPT_HEADER, false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$nvpStr=$nvpheader.$nvpStr;\n\t\t}\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t //Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php\n\t\tif($this->USE_PROXY == TRUE)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PROXY_HOST.\":\".$this->PROXY_PORT);\n\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->version) . $nvpStr;\n\t\t}\n\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\n\t\t if (curl_errno($ch) == 60) {\n\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO,\n\t\t\tdirname(__FILE__) . '/cacert.pem');\n\t\t\t$response = curl_exec($ch);\n\t\t}\n\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray=$this->deformatNVP($response);\n\t\t$nvpReqArray=$this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t $_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t $_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t $this->APIerror();\n\t\t\t //$location = \"APIError.php\";\n\t\t\t //header(\"Location: $location\");\n\t\t } else {\n\t\t\t //closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t }\n\n\t\treturn $nvpResArray;\n\t}", "public function hash_call($method_name, $nvpstr)\n\t{\n\t $settings = $this->pex_settings;\n\t $nvpheader = \"&PWD=\".urlencode($settings['api_password']).\"&USER=\".urlencode($settings['api_username']).\"&SIGNATURE=\".urlencode($settings['api_signature']);\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$settings['api_endpoint']);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t$nvpstr=$nvpheader.$nvpstr;\n\t\t//check if version is included in $nvpstr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpstr))) == strlen($nvpstr)) {\n\t\t\t$nvpstr = \"&VERSION=\" . urlencode($settings['api_version']) . $nvpstr;\t\n\t\t}\n\t\t$nvpreq=\"METHOD=\".urlencode($method_name).$nvpstr;\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpresarray = $this->deformat_nvp($response);\n\t\t$nvpreqarray = $this->deformat_nvp($nvpreq);\n\t\t$_SESSION['nvpreqarray']=$nvpreqarray;\n\t\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no'] = curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg'] = curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} \n\t\telse {\n\t\t\t//closing the curl\n\t\t\tcurl_close($ch);\n\t\t}\n\t\treturn $nvpresarray;\n\t}", "function payment_sign($query, $api_key) {\n $clear_text = '';\n ksort($query);\n foreach ($query as $key => $value) {\n if (substr($key, 0, 2) === \"x_\") {\n $clear_text .= $key . $value;\n }\n }\n $hash = hash_hmac(\"sha256\", $clear_text, $api_key);\n return str_replace('-', '', $hash);\n }", "function refundCallBackIndex()\n{\n $refundCallbackVO = array(\n 'merchantId' => 'test_merchant',\n 'refundId' => 'test_456',\n 'tradeNo' => 'REFTRADE20190415060401022956957',\n 'orderId' => 'test_123',\n 'refundAmount' => '1000',\n 'currency' => 'INR',\n 'status' => '1',\n 'errorCode' => '',\n 'errorMsg' => '',\n 'sign' => '055E10F63AF852BDAC8FA174C65F2F8A',\n );\n\n //verify your sign\n $sign = $refundCallbackVO['sign'];\n // Use the test environment link: secretKey needs to be secretKey for the test environment\n // Use the production environment link: the secretKey needs to be secretKey for the production environment\n if (verifyForMd5('test_key', $refundCallbackVO, $sign)) {//change to your merchant secret key from SHAREit pay\n //Process the notify from SHAREit pay with your own logic\n if (true) {\n //default response format without modify\n $successResponse = array(\n 'result_code' => 200,\n 'message' => 'success',\n );\n return json_encode($successResponse, true);\n } else {\n //Exception\n //default response format without modify\n $failureResponse = array(\n 'result_code' => 500,\n 'message' => 'failure',\n );\n return json_encode($failureResponse, true);\n }\n } else {\n echo 'sign error';\n //default response format without modify\n $failureResponse = array(\n 'result_code' => 500,\n 'message' => 'failure',\n );\n return json_encode($failureResponse, true);\n }\n\n}", "private function hash_call($methodName, $nvpStr) {\n\n\t\t// form header string\n\t\t$nvpheader = $this->nvpHeader();\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $this->_api_endpoint);\n\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t\t$nvpStr=$nvpheader.$nvpStr;\n\n\t\t$nvpStr = \"&VERSION=\" . urlencode(self::VERSION) . $nvpStr;\n\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\n\t\t// set the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\n\t\tif (curl_errno($ch) == 60) {\n\t\t\tcurl_setopt($ch, CURLOPT_CAINFO,\n\t\t\t\tdirname(__FILE__) . '/PayPal_cacert.pem');\n\t\t\t$response = curl_exec($ch);\n\t\t}\n\n\t\t//converting NVPResponse to an Associative Array\n\t\t$nvpResArray = $this->deformatNVP($response);\n\n\t\tif (curl_errno($ch)) {\n\t\t\tthrow new \\Exception(curl_error($ch), curl_errno($ch));\n\t\t} else {\n\t\t\t//closing the curl\n\t\t\tcurl_close($ch);\n\t\t}\n\n\t\treturn $nvpResArray;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) \n\t{\n\t\tglobal $environment;\n\t\t$API_UserName = urlencode('fhefoto_api1.yahoo.no');\n\t\t$API_Password = urlencode('N6SEDXLJKPN6PPWY');\n\t\t$API_Signature = urlencode('AlVtORxlymlrQpGY-fnzOdIuxvT1A2nTmy.LlXvPkOP5oU0VdZitgeEV');\n\t\n\t\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\t\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t}\n\t\t$version = urlencode('51.0');\n\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\t$httpResponse = curl_exec($ch);\n\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\n\t\treturn $httpParsedResponseAr;\n\t}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\tglobal $API_UserName, $API_Password, $API_Signature;\n\n\t// Set up your API credentials, PayPal end point, and API version.\n\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t//$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t}\n\t$version = urlencode('57.0');\n\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// Set the API operation, version, and API signature in the request.\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n\t// Set the request as a POST FIELD for curl.\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// Get response from the server.\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "function PPHttpPost($methodName_, $nvpStr_) {\n\tglobal $environment;\n\n\t$API_UserName = urlencode('tuhins_1351114574_biz_api1.gmail.com');\n\t$API_Password = urlencode('1351114606');\n\t$API_Signature = urlencode('AdfcyT4sNBLU3ISgRRnYiJXaGd4hAjDiSEgVQesi8ykS-6Sp5pC4c5bM');\n\t$API_Endpoint = \"https://api-3t.paypal.com/nvp\";\n\tif(\"sandbox\" === $environment || \"beta-sandbox\" === $environment) {\n\t\t$API_Endpoint = \"https://api-3t.$environment.paypal.com/nvp\";\n\t}\n\t$version = urlencode('58.0');\n\n\t// setting the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n\t// turning off the server and peer verification(TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\n\t// NVPRequest for submitting to server\n\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\n\t// setting the nvpreq as POST FIELD to curl\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n\t// getting response from server\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t}\n\n\t// Extract the RefundTransaction response details\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\n\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\n\treturn $httpParsedResponseAr;\n}", "function buy_sell($pairing_id,$amount,$rate,$type){\n\tif($ch = curl_init ()){\n\t\t$data['pairing'] = $pairing_id;//btc/thb\n\t\t$data['amount'] = $amount;\n\t\t$data['rate'] = $rate;\n\t\t$data['type'] = $type;\n\t\t$data['key'] = 'xxx';\n\t\t$mt = explode(' ', microtime());\n\t\t$nonce = $mt[1].substr($mt[0], 2, 6);\n\t\t$data['nonce'] = $nonce;\n\t\t$data['signature'] = hash('sha256', 'xxx'.$nonce.'xxx');\n\t\t// if($this->twofa != ''){\n\t\t\t// $data['twofa'] = $this->twofa;\n\t\t// }\n\t\t\n\t\tcurl_setopt ( $ch, CURLOPT_URL, 'https://bx.in.th/api/order/');\n\t\tcurl_setopt ( $ch, CURLOPT_FOLLOWLOCATION, false );\n\t\tcurl_setopt ( $ch, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt ( $ch, CURLOPT_CONNECTTIMEOUT, 5 );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYPEER, false );\n\t\tcurl_setopt ( $ch, CURLOPT_SSL_VERIFYHOST, false ); \n\t\tcurl_setopt ( $ch, CURLOPT_POST, count($data));\n\t\tcurl_setopt ( $ch, CURLOPT_POSTFIELDS,$data);\n\t\t\n\t\t$str = curl_exec ( $ch );\n\t\n\t\tcurl_close ( $ch );\n\t\t\n\t\t$str = json_decode($str);\n\t\n\t\treturn $str;\n\n\t}\n\n}", "function PPHttpPost($methodName_, $nvpStr_) {\n\n\t\n\t\t// Set up your API credentials, PayPal end point, and API version.\n\t\t$API_UserName = urlencode('eshop_1309605309_biz_api1.gmail.com');\n\t\t$API_Password = urlencode('1309605353');\n\t\t$API_Signature = urlencode('AiPC9BjkCyDFQXbSkoZcgqH3hpacA4TlLrMdwUVOcGq8BK4tNk9Rdji5');\n\t\t$API_Endpoint = \"https://api-3t.sandbox.paypal.com/nvp\";\n\t\t\n\t\t$version = urlencode('51.0');\n\t\n\t\t// Set the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t// Turn off the server and peer verification (TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\n\t\t// Set the API operation, version, and API signature in the request.\n\t\t$nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\t\n\t\t// Set the request as a POST FIELD for curl.\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\t\n\t\t// Get response from the server.\n\t\t$httpResponse = curl_exec($ch);\n\t\n\t\tif(!$httpResponse) {\n\t\t\texit(\"$methodName_ failed: \".curl_error($ch).'('.curl_errno($ch).')');\n\t\t}\n\t\n\t\t// Extract the response details.\n\t\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t\n\t\t$httpParsedResponseAr = array();\n\t\tforeach ($httpResponseAr as $i => $value) {\n\t\t\t$tmpAr = explode(\"=\", $value);\n\t\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t\t}\n\t\t}\n\t\n\t\tif((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t\t}\n\t\n\t\treturn $httpParsedResponseAr;\n\t}", "function getHashes($txnid, $amount, $productinfo, $firstname, $email, $user_credentials, $udf1, $udf2, $udf3, $udf4, $udf5,$cardBin)\r\n{\r\n $key = 'uWnwLgWB';\r\n $salt = 'JEoXThKDZm';\r\n\r\n $payhash_str = $key . '|' . checkNull($txnid) . '|' .checkNull($amount) . '|' .checkNull($productinfo) . '|' . checkNull($firstname) . '|' . checkNull($email) . '|' . checkNull($udf1) . '|' . checkNull($udf2) . '|' . checkNull($udf3) . '|' . checkNull($udf4) . '|' . checkNull($udf5) . '||||||' . $salt;\r\n $paymentHash = strtolower(hash('sha512', $payhash_str));\r\n $arr['payment_hash'] = $paymentHash;\r\n\r\n $cmnNameMerchantCodes = 'get_merchant_ibibo_codes';\r\n $merchantCodesHash_str = $key . '|' . $cmnNameMerchantCodes . '|default|' . $salt ;\r\n $merchantCodesHash = strtolower(hash('sha512', $merchantCodesHash_str));\r\n $arr['get_merchant_ibibo_codes_hash'] = $merchantCodesHash;\r\n\r\n $cmnMobileSdk = 'vas_for_mobile_sdk';\r\n $mobileSdk_str = $key . '|' . $cmnMobileSdk . '|default|' . $salt;\r\n $mobileSdk = strtolower(hash('sha512', $mobileSdk_str));\r\n $arr['vas_for_mobile_sdk_hash'] = $mobileSdk;\r\n\r\n\r\n\r\n $cmnPaymentRelatedDetailsForMobileSdk1 = 'payment_related_details_for_mobile_sdk';\r\n $detailsForMobileSdk_str1 = $key . '|' . $cmnPaymentRelatedDetailsForMobileSdk1 . '|default|' . $salt ;\r\n $detailsForMobileSdk1 = strtolower(hash('sha512', $detailsForMobileSdk_str1));\r\n $arr['payment_related_details_for_mobile_sdk_hash'] = $detailsForMobileSdk1;\r\n\r\n //used for verifying payment(optional)\r\n $cmnVerifyPayment = 'verify_payment';\r\n $verifyPayment_str = $key . '|' . $cmnVerifyPayment . '|'.$txnid .'|' . $salt;\r\n $verifyPayment = strtolower(hash('sha512', $verifyPayment_str));\r\n $arr['verify_payment_hash'] = $verifyPayment;\r\n return $arr;\r\n}", "public function execute()\n {\n if (!empty($_GET[\"responseid\"]) && !empty($_GET[\"requestid\"])) {\n $order_id = base64_decode($_GET[\"requestid\"]);\n $response_id = base64_decode($_GET[\"responseid\"]);\n\n $mode = $this->_paymentMethod->getMerchantConfig('modes');\n\n if ($mode == 'Test') {\n $mid = $this->_paymentMethod->getMerchantConfig('test_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('test_mkey');\n $client = new SoapClient(\"https://testpti.payserv.net/Paygate/ccservice.asmx?WSDL\");\n } elseif ($mode == 'Live') {\n $mid = $this->_paymentMethod->getMerchantConfig('live_mid');\n $mkey = $this->_paymentMethod->getMerchantConfig('live_mkey');\n $client = new SoapClient(\"https://ptipaygate.paynamics.net/ccservice/ccservice.asmx?WSDL\");\n }\n\n $request_id = '';\n $length = 8;\n $characters = '0123456789';\n $charactersLength = strlen($characters);\n $randomString = '';\n for ($i = 0; $i < $length; $i++) {\n $request_id .= $characters[rand(0, $charactersLength - 1)];\n }\n\n $merchantid = $mid;\n $requestid = $request_id;\n $org_trxid = $response_id;\n $org_trxid2 = \"\";\n $cert = $mkey;\n $data = $merchantid . $requestid . $org_trxid . $org_trxid2;\n $data = utf8_encode($data . $cert);\n\n // create signature\n $sign = hash(\"sha512\", $data);\n\n $params = array(\"merchantid\" => $merchantid,\n \"request_id\" => $requestid,\n \"org_trxid\" => $org_trxid,\n \"org_trxid2\" => $org_trxid2,\n \"signature\" => $sign);\n\n $result = $client->query($params);\n $response_code = $result->queryResult->txns->ServiceResponse->responseStatus->response_code;\n $response_message = $result->queryResult->txns->ServiceResponse->responseStatus->response_message;\n\n switch ($response_code) {\n case 'GR001':\n case 'GR002':\n case 'GR033':\n $this->getResponse()->setRedirect(\n $this->_getUrl('checkout/onepage/success')\n );\n break;\n default:\n $this->messageManager->addErrorMessage(\n __($response_message)\n );\n /** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect */\n $resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n return $resultRedirect->setPath('checkout/cart');\n break;\n }\n\n// $this->getResponse()->setRedirect(\n// $this->_getUrl('checkout/onepage/success')\n// );\n }\n }", "function huiten_daifu_pay($parms){\n\n $huiten_config = $GLOBALS['huiten_config'];\n\n $url = 'http://121.42.248.56:8080/pay-platform-api/doQhyHtGateBusiness';//请求地址\n\n $merNo = $huiten_config['merchantNo'];//\n\n $signKey = $huiten_config['signKey'];//\n\n $resMap=array();\n\n $resMap['requestNo']=$parms['requestNo'];\n\n $resMap['version']='V1.0';\n\n $resMap['productId']='0203';\n\n $resMap['transId']='005';\n\n $resMap['merNo']=$merNo;\n\n $resMap['orderDate']=date('Ymd');\n\n $resMap['orderNo']=$parms['orderNo'];\n\n $resMap['notifyUrl']='http://www.euamote.me/index.php/Home/Deposit/huiten_notify.html';\n\n $resMap['dfType']='001';\n\n $resMap['transAmt']=$parms['transAmt'];\n\n $resMap['isCompay']='0';\n\n $resMap['phoneNo']=$parms['phoneNo'];\n\n $resMap['customerName']=$parms['customerName'];\n\n $resMap['accBankNo']=$parms['accBankNo'];\n\n $resMap['accBankName']=$parms['accBankName'];\n\n $resMap['acctNo']=$parms['acctNo'];\n\n $resMap['signature']=strtoupper(md5($resMap['requestNo'].$resMap['productId'].$resMap['merNo'].$signKey));\n\n\n\n $data=array();\n\n $data['reqJson']=json_encode($resMap,256);\n\n return json_decode(post($url,$data), true);\n}", "public function invoke(PayPalApiStruct $webhook, Context $context): void;", "public function verify($params = array())\r\n {\r\n $returnURL = \"http://localhost\"; \r\n $cancelURL = \"http://localhost\"; \r\n $currencyCode = \"USD\";\r\n $startingDate = \"2011-02-24T13:00:00\"; \r\n $endingDate = \"2011-02-28T13:00:00\"; \r\n $maxTotalAmountOfAllPayments = \"2000\"; \r\n $senderEmail = \"\"; \r\n $maxNumberOfPayments = \"\"; \r\n // NO_PERIOD_SPECIFIED\r\n // DAILY - each day\r\n // WEEKLY - each week\r\n // BIWEEKLY - every other week\r\n // SEMIMONTHLY - twice a month\r\n // MONTHLY - each month\r\n // ANNUALLY - each year \r\n $paymentPeriod = \"\"; \r\n \r\n $dateOfMonth = \"\"; \r\n $dayOfWeek = \"\";\r\n $maxAmountPerPayment = \"\"; \r\n $maxNumberOfPaymentsPerPeriod = \"\"; \r\n $pinType = \"\"; \r\n $resArray = $this->CallPreapproval ($returnURL, $cancelURL, $currencyCode, $startingDate, $endingDate, $maxTotalAmountOfAllPayments,\r\n $senderEmail, $maxNumberOfPayments, $paymentPeriod, $dateOfMonth, $dayOfWeek,\r\n $maxAmountPerPayment, $maxNumberOfPaymentsPerPeriod, $pinType\r\n );\r\n $ack = strtoupper($resArray[\"responseEnvelope.ack\"]);\r\n if($ack==\"SUCCESS\")\r\n {\r\n $this->preapprovalKey = $resArray[\"preapprovalKey\"];\r\n $cmd = \"cmd=_ap-preapproval&preapprovalkey=\" . urldecode($resArray[\"preapprovalKey\"]);\r\n $this->Redirect( $cmd );\r\n //return $resArray[\"preapprovalKey\"];\r\n } \r\n else \r\n {\r\n $ErrorCode = urldecode($resArray[\"error(0).errorId\"]);\r\n $ErrorMsg = urldecode($resArray[\"error(0).message\"]);\r\n $ErrorDomain = urldecode($resArray[\"error(0).domain\"]);\r\n $ErrorSeverity = urldecode($resArray[\"error(0).severity\"]);\r\n $ErrorCategory = urldecode($resArray[\"error(0).category\"]);\r\n $this->errors = $ErrorCode.':'.$ErrorMsg.' '.$ErrorDomain.' '.$ErrorSeverity.' '.$ErrorCategory;\r\n $this->logging('verify Error : '. $this->errors);\r\n return false;\r\n }\r\n }", "function PPHttpPost($methodName_, $nvpStr_, $PayPalApiUsername, $PayPalApiPassword, $PayPalApiSignature, $PayPalMode) {\n $API_UserName = urlencode($PayPalApiUsername);\n $API_Password = urlencode($PayPalApiPassword);\n $API_Signature = urlencode($PayPalApiSignature);\n\n $paypalmode = ($PayPalMode == 'sandbox') ? '.sandbox' : '';\n\n $API_Endpoint = \"https://api-3t\" . $paypalmode . \".paypal.com/nvp\";\n $version = urlencode('109.0');\n\n // Set the curl parameters.\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n\n // Turn off the server and peer verification (TrustManager Concept).\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_POST, 1);\n\n // Set the API operation, version, and API signature in the request.\n $nvpreq = \"METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_\";\n\n // Set the request as a POST FIELD for curl.\n curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);\n\n // Get response from the server.\n $httpResponse = curl_exec($ch);\n\n if (!$httpResponse) {\n exit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n }\n\n // Extract the response details.\n $httpResponseAr = explode(\"&\", $httpResponse);\n\n $httpParsedResponseAr = array();\n foreach ($httpResponseAr as $i => $value) {\n $tmpAr = explode(\"=\", $value);\n if (sizeof($tmpAr) > 1) {\n $httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n }\n }\n\n if ((0 == sizeof($httpParsedResponseAr)) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n exit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n }\n\n return $httpParsedResponseAr;\n }", "function getEncodedSignature($hostName,$digestEncoded,$SS_KEY,$path)\r\n{\r\n $signatureString = \"host: \".$hostName.\"\\n(request-target): post \".$path.\"\\n\".\"digest: SHA-256=\".$digestEncoded.\"\\n\".\"v-c-merchant-id: starlock01\";\r\n $signatureByteString = utf8_encode($signatureString);\r\n $decodeKey = base64_decode($SS_KEY);\r\n $signature = base64_encode(hash_hmac(\"sha256\", $signatureByteString,\r\n $decodeKey, true));\r\n return $signature;\r\n}", "function sloodle_signature($data) {\n \tglobal $CFG;\n\n $salt = '';\n if ( isset($CFG->sloodle_signature_salt) && ($CFG->sloodle_signature_salt != '' ) ) {\n $salt = $CFG->sloodle_signature_salt;\n } else {\n $salt = random_string(40);\n set_config('sloodle_signature_salt', $salt);\n }\n\n if (function_exists('hash_hmac')) {\n return hash_hmac('sha256', $data, $salt);\n }\n return sloodle_custom_hmac('sha1', $data, $salt);\n }", "public function createPaypalPayment(){\n try {\n $client = new Client();\n $paymentResponse = $client->request('POST', $this->paypalPaymentUrl, [\n 'headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $this->salesData->salesData()\n ]);\n $this->parsePaymentBody($paymentResponse);\n \n } catch (\\Exception $ex) {\n $error = $ex->getMessage();\n return $error;\n }\n return $this->paymentBody->id;\n\n }", "public function payment_successful()\n {\n $user_id=$this->session->userdata('user_id');\n\n $status = $this->input->post(\"status\");\n $firstname = $this->input->post(\"firstname\");\n $amount = $this->input->post(\"amount\");\n $txnid = $this->input->post(\"txnid\");\n $posted_hash = $this->input->post(\"hash\");\n $key = $this->input->post(\"key\");\n $productinfo = $this->input->post(\"productinfo\");\n // $membership_package=$this->input->post('membership_package');\n $email = $this->input->post(\"email\");\n $salt = SALT;\n //echo $membership_package;die();\n\n\n if ($this->input->post(\"additionalCharges\")) {\n $additionalCharges = $this->input->post(\"additionalCharges\");\n $retHashSeq = $additionalCharges . '|' . $salt . '|' . $status . '|||||||||||' . $email . '|' . $firstname . '|' . $productinfo . '|' . $amount . '|' . $txnid . '|' . $key;\n } else {\n\n $retHashSeq = $salt . '|' . $status . '|||||||||||' . $email . '|' . $firstname . '|' . $productinfo . '|' . $amount . '|' . $txnid . '|' . $key;\n }\n $hash = hash(\"sha512\", $retHashSeq);\n\n if ($hash != $posted_hash) {\n $data['msg'] = \"Invalid Transaction. Please try again\";\n } else {\n \n //echo $user_id;die();\n // echo $status;\n // echo $txnid;\n // echo $amount;\n // echo $firstname;\n // echo $hash;die();\n //echo $membership_package;die();\n $data=array(\n 'user_id'=>$user_id,\n 'user_name'=>$firstname,\n 'status'=>$status,\n 'txnid'=>$txnid,\n 'amount'=>$amount,\n 'hash'=>$hash\n );\n\n //print_r($data);die();\n $path = base_url();\n $url = $path.'api/User_api/SavePayment';\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n $response_json = curl_exec($ch);\n curl_close($ch);\n $response = json_decode($response_json, true);\n // print_r($response_json);die();\n $data['msg'] = \"<h3>Thank You. Your order status is \" . $status . \".</h3>\";\n $data['msg'] .= \"<h4>Your Transaction ID for this transaction is \" . $txnid . \".</h4>\";\n $data['msg'] .= \"<h4>We have received a payment of Rs. \" . $amount . \". Your order will soon be shipped.</h4>\";\n \n }\n $this->load->view('includes/header.php');\n $this->load->view('pages/profile/membership_view',$data);\n //$this->load->view('pages/payment/success.php',$data);\n $this->load->view('includes/footer.php');\n }", "static function STKPush_processrequest($timestamp, $account_ref, $transaction_desc, $amount, $phone_number, $callbackurl)\n {\n $url = 'https://' . env('MPESA_SUBDOMAIN') . '.safaricom.co.ke/mpesa/stkpush/v1/processrequest';\n\n $access_token = self::generate_access_token();\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-Type:application/json', 'Authorization:Bearer ' . $access_token)); //setting custom header\n\n $curl_post_data = array(\n //Fill in the request parameters with valid values\n 'BusinessShortCode' => self::$business_shortcode,\n 'Password' => self::generate_mpesa_password($timestamp),\n 'Timestamp' => $timestamp,\n 'TransactionType' => 'CustomerPayBillOnline',\n 'Amount' => $amount,\n 'PartyA' => $phone_number,\n 'PartyB' => self::$business_shortcode,\n 'PhoneNumber' => $phone_number,\n 'CallBackURL' => $callbackurl,\n 'AccountReference' => $account_ref,\n 'TransactionDesc' => $transaction_desc\n );\n\n Log::debug('Request Body',['body'=>$curl_post_data]);\n\n $data_string = json_encode($curl_post_data);\n\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data_string);\n\n if (config('app.env') === 'local') {\n curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);\n }\n $curl_response = curl_exec($curl);\n if (config('app.env') === 'local') Log::info($curl_response);\n return json_decode($curl_response);\n }", "function spgateway_credit_refund($params) {\n\n $amount = $params['amount']; # Format: ##.##\n $TotalAmount = round($amount);\n $transid = $params['transid'];\n\n # 是否為測試模式\n $posturl = ($params['testMode']==\"on\") ? 'https://ccore.spgateway.com/MPG/mpg_gateway'\n : 'https://core.spgateway.com/MPG/mpg_gateway' ;\n\n // post data\n $PostData = http_build_query(\n array( 'RespondType' => 'String',\n 'Version' => '1.0',\n 'Amt' => $TotalAmount,\n 'TradeNo' => $transid,\n 'TimeStamp' => time(),\n 'IndexType' => '2',\n 'CloseType' => '2'\n ));\n $PostData = trim(\n bin2hex(\n mcrypt_encrypt( MCRYPT_RIJNDAEL_128,\n $params['HashKey'],\n spgateway_credit_addpadding($PostData),\n MCRYPT_MODE_CBC,\n $params['HashIV'])\n )\n );\n\n // post\n $post = array( 'MerchantID_' => $params['MerchantID'],\n 'PostData_' => $PostData);\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $posturl);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $post);\n if ($params['testMode']=='on') curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); // On dev server only!\n $result = curl_exec($ch);\n curl_close($ch);\n\n parse_str(trim($result),$result);\n\n switch($result['Status']){\n case 'SUCCESS':\n case 'TRA10045':\n return array('status'=>'success', 'rawdata'=>$result, 'transid'=>$result['TradeNo'], 'fees'=>0);\n case 'TRA10058':\n case 'TRA10675':\n case 'TRA10013':\n case 'TRA10035':\n return array('status'=>'declined', 'rawdata'=>$result);\n default:\n return array('status'=>'error', 'rawdata'=>$result);\n }\n}", "public function pay(): JsonResponse;", "public function paypal(Request $request)\n {\nrequire 'vendor/autoload.php';\n\n$apiContext = new \\PayPal\\Rest\\ApiContext(\n new \\PayPal\\Auth\\OAuthTokenCredential(\n 'AedIVbiADiRsvL3jFM6Z6Kcx5wSgwyBIMJFFQq0UFcBfrew-mhHGMZVpqWJhvQGbn-HkUpt5F023HH4n',\n 'EIs32ISB07N21Ey0z2a4Qthy5Obo173s1wD9Yx9hhiYJoC2bxdnNJVLpb2MvnT5QTYK74RBMg84FvPd4'\n )\n);\n\n return response()->json([\n 'message' => 'paypal route hit',\n 'request' => $request->all()\n ]);\n }", "function PPHttpPost($methodName_, $nvpStr_) {\n $submit_data = array(\n\t\t'METHOD' => $methodName_,\n\t\t'VERSION' => '52.0',\n\t\t'PWD' => MODULE_PAYMENT_PAYPAL_NVP_PW,\n\t\t'USER' => MODULE_PAYMENT_PAYPAL_NVP_USER_ID,\n\t\t'SIGNATURE' => MODULE_PAYMENT_PAYPAL_NVP_SIG,\n\t\t'IPADDRESS' => get_ip_address(),\n\t);\n\n\t$data = ''; // initiate XML string\n while(list($key, $value) = each($submit_data)) {\n \tif ($value <> '') $data .= '&' . $key . '=' . urlencode($value);\n }\n\t$data .= substr($data, 1) . $nvpStr_; // build the submit string\n\n\tif(\"sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE || \"beta-sandbox\" === MODULE_PAYMENT_PAYPAL_NVP_TESTMODE) {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_SANDBOX_SIG_URL;\n\t} else {\n\t\t$API_Endpoint = MODULE_PAYMENT_PAYPAL_NVP_LIVE_SIG_URL;\n\t}\n\t// Set the curl parameters.\n\t$ch = curl_init();\n\tcurl_setopt($ch, CURLOPT_URL, $API_Endpoint);\n\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t// Turn off the server and peer verification (TrustManager Concept).\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($ch, CURLOPT_POST, 1);\n\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n//echo 'string = ' . $data . '<br>';\n\t$httpResponse = curl_exec($ch);\n\n\tif(!$httpResponse) {\n\t\t$messageStack->add('XML Read Error (cURL) #' . curl_errno($ch) . '. Description = ' . curl_error($ch),'error');\n\t\treturn false;\n//\t\texit(\"$methodName_ failed: \" . curl_error($ch) . '(' . curl_errno($ch) . ')');\n\t}\n\t// Extract the response details.\n\t$httpResponseAr = explode(\"&\", $httpResponse);\n\t$httpParsedResponseAr = array();\n\tforeach ($httpResponseAr as $i => $value) {\n\t\t$tmpAr = explode(\"=\", $value);\n\t\tif(sizeof($tmpAr) > 1) {\n\t\t\t$httpParsedResponseAr[$tmpAr[0]] = $tmpAr[1];\n\t\t}\n\t}\n\tif (0 == sizeof($httpParsedResponseAr) || !array_key_exists('ACK', $httpParsedResponseAr)) {\n\t\t$messageStack->add('PayPal Response Error.','error');\n\t\treturn false;\n//\t\texit(\"Invalid HTTP Response for POST request($nvpreq) to $API_Endpoint.\");\n\t}\n\treturn $httpParsedResponseAr;\n }", "function execute_payment($access_token, $payerId, $paymentID) {\n\n global $host;\n $url = $host.'/v1/payments/payment/'.$paymentID.'/execute/';\n\n $postdata= '{\"payer_id\" : \"'.$payerId.'\"}';\n\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_HEADER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer '.$access_token,\n 'Content-Type: application/json'\n )); // An array of HTTP header fields to set, in the format array('Content-type: text/plain', 'Content-length: 100')\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n\n $response = curl_exec( $curl );\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl));\n curl_close($curl);\n } else {\n $info = curl_getinfo($curl);\n curl_close($curl); \n\n if($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n return $response;\n }\n\n }\n\n return $response;\n\n}", "public function pay();", "function MakeSignedRequest()\n{\n $user_id = 1;\n $request_uri = SERVER_BASE . 'services.php';\n\n // Parameters, appended to the request depending on the request method.\n // Will become the POST body or the GET query string.\n $params = array(\n 'service' => 'rest',\n 'method' => 'Version',\n 'response' => RESPONSE\n );\n\n // Obtain a request object for the request we want to make\n $req = new OAuthRequester($request_uri, 'GET', $params);\n\n // Sign the request, perform a curl request and return the results, throws OAuthException exception on an error\n $result = $req->doRequest($user_id);\n\n // $result is an array of the form: array ('code'=>int, 'headers'=>array(), 'body'=>string)\n var_dump($result);\n echo $result['body'];\n}", "function makePayment($arr) {\n\t$accessToken = \"eYgzn2wfvScb1aIf3QLs\";\n\t$merchantNumber = \"T511564901\";\n\t$secretToken = \"1qcvgmCNmSvP1ikAG38uSoAPr7ePByuMcWuMWKsa\";\n\n\t$apiKey = base64_encode(\n\t\t$accessToken . \"@\" . $merchantNumber . \":\" . $secretToken\n\t);\n\n\t$checkoutUrl = \"https://api.v1.checkout.bambora.com/sessions\";\n\n\t$request = array();\n\t$request[\"order\"] = array();\n\t$request[\"order\"][\"id\"] = $arr['orderID'];\n\t$request[\"order\"][\"amount\"] = $arr['amount'];\n\t$request[\"order\"][\"currency\"] = \"NOK\";\n\n\t$request[\"url\"] = array();\n\t$request[\"url\"][\"accept\"] = $arr['acceptURL'];\n\t$request[\"url\"][\"cancel\"] = $arr['cancelURL'];\n\t$request[\"url\"][\"callbacks\"] = array();\n\t$request[\"url\"][\"callbacks\"][] = array(\"url\" => $arr['callbackURL']);\n\n\t$requestJson = json_encode($request);\n\n\t$contentLength = isset($requestJson) ? strlen($requestJson) : 0;\n\n\t$headers = array(\n\t\t'Content-Type: application/json',\n\t\t'Content-Length: ' . $contentLength,\n\t\t'Accept: application/json',\n\t\t'Authorization: Basic ' . $apiKey\n\t);\n\n\t$curl = curl_init();\n\n\tcurl_setopt($curl, CURLOPT_CUSTOMREQUEST, \"POST\");\n\tcurl_setopt($curl, CURLOPT_POSTFIELDS, $requestJson);\n\tcurl_setopt($curl, CURLOPT_URL, $checkoutUrl);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n\tcurl_setopt($curl, CURLOPT_HTTPHEADER, $headers);\n\tcurl_setopt($curl, CURLOPT_FAILONERROR, false);\n\tcurl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n\n\t$rawResponse = curl_exec($curl);\n\t$response = json_decode($rawResponse);\n\t\n\treturn $response;\n}", "function sendData($api, $amount, $redirect, $factorNumber = null)\n{\n $data = \"api=$api&amount=$amount&redirect=$redirect&factorNumber=$factorNumber\";\n $curl = curl_init();\n curl_setopt($curl, CURLOPT_URL, \"https://pay.ir/payment/test/send\");\n curl_setopt($curl, CURLOPT_POST, true);\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n curl_close($curl);\n\n if ($response) {\n return json_decode($response, true);\n } else {\n return false;\n }\n\n}", "public function webhook()\n {\n $bodyReceived = file_get_contents('php://input');\n\n // Receive HTTP headers that you received from PayPal webhook.\n $headers = getallheaders();\n\n /**\n * Uppercase all the headers for consistency\n */\n $headers = array_change_key_case($headers, CASE_UPPER);\n\n $signatureVerification = new \\PayPal\\Api\\VerifyWebhookSignature();\n $signatureVerification->setWebhookId(env('PAYPAL_WEBHOOK_ID'));\n $signatureVerification->setAuthAlgo($headers['PAYPAL-AUTH-ALGO']);\n $signatureVerification->setTransmissionId($headers['PAYPAL-TRANSMISSION-ID']);\n $signatureVerification->setCertUrl($headers['PAYPAL-CERT-URL']);\n $signatureVerification->setTransmissionSig($headers['PAYPAL-TRANSMISSION-SIG']);\n $signatureVerification->setTransmissionTime($headers['PAYPAL-TRANSMISSION-TIME']);\n\n $webhookEvent = new \\PayPal\\Api\\WebhookEvent();\n $webhookEvent->fromJson($bodyReceived);\n $signatureVerification->setWebhookEvent($webhookEvent);\n $request = clone $signatureVerification;\n\n try {\n $output = $signatureVerification->post($this->apiContext);\n } catch(\\Exception $ex) {\n print_r($ex->getMessage());\n exit(1);\n }\n\n $verificationStatus = $output->getVerificationStatus();\n $responseArray = json_decode($request->toJSON(), true);\n\n $event = $responseArray['webhook_event']['event_type'];\n\n if ($verificationStatus == 'SUCCESS')\n {\n switch($event)\n {\n case 'BILLING.SUBSCRIPTION.CANCELLED':\n case 'BILLING.SUBSCRIPTION.SUSPENDED':\n case 'BILLING.SUBSCRIPTION.EXPIRED':\n case 'BILLING_AGREEMENTS.AGREEMENT.CANCELLED':\n\n // $user = User::where('payer_id',$responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'])->first();\n $this->updateStatus($responseArray['webhook_event']['resource']['payer']['payer_info']['payer_id'], 0);\n break;\n }\n }\n echo $verificationStatus;\n exit(0);\n }", "private function generate_signature()\n {\n $phrase = implode('', func_get_args());\n /**\n * Sign data and make final signature\n */\n $signature = '';\n $private_key_id = openssl_pkey_get_private($this->private_key);\n if (!openssl_sign($phrase, $signature, $private_key_id, OPENSSL_ALGO_SHA1)) {\n throw new BankException('OPEN SSL SIGN ERROR');\n }\n\n return $signature;\n }", "public function processPayment();", "public function actionCheck($param)\n {\n\n /*$json = json_decode($data);\n echo $json->tls_version.'<br />';\n //$curl_info = curl_version();\n //echo $curl_info['ssl_version'];\n printf(\"0x%x\\n\", OPENSSL_VERSION_NUMBER);*/\n\n define(\"LOG_FILE\", __DIR__.\"/Paypal.log\");\n $raw_post_data = file_get_contents('php://input');\n $raw_post_array = explode('&', $raw_post_data);\n $myPost = array();\n foreach ($raw_post_array as $keyval) {\n $keyval = explode ('=', $keyval);\n if (count($keyval) == 2)\n $myPost[$keyval[0]] = urldecode($keyval[1]);\n }\n $req = 'cmd=_notify-validate';\n if(function_exists('get_magic_quotes_gpc')) {\n \t$get_magic_quotes_exists = true;\n }\n foreach ($myPost as $key => $value) {\n \t$value = $get_magic_quotes_exists && get_magic_quotes_gpc() == 1\n ? urlencode(stripslashes($value))\n : urlencode($value);\n $req .= \"&$key=$value\";\n }\n $paypal_url = $this->settings->paypal_demo ? 'https://www.sandbox.paypal.com/cgi-bin/webscr' : 'https://www.paypal.com/cgi-bin/webscr';\n $ch = curl_init($paypal_url);\n if ($ch == false) {\n \tdie('no curl init');\n }\n curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_SSLVERSION, 6);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $req);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);\n curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));\n $res = curl_exec($ch);\n if (curl_errno($ch) != 0) {\n $error = curl_error($ch);\n \t//error_log(date('[Y-m-d H:i e] '). \"Can't connect to PayPal to validate IPN message: \" . $error . PHP_EOL, 3, LOG_FILE);\n \tcurl_close($ch);\n \tdie($error);\n } else {\n\t\tif(DEBUG == true) {\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP request of validation request:\". curl_getinfo($ch, CURLINFO_HEADER_OUT) .\" for IPN payload: $req\" . PHP_EOL, 3, LOG_FILE);\n\t\t\t//error_log(date('[Y-m-d H:i e] '). \"HTTP response of validation request: $res\" . PHP_EOL, 3, LOG_FILE);\n\t\t}\n\t\tcurl_close($ch);\n }\n $tokens = explode(\"\\r\\n\\r\\n\", trim($res));\n $res = trim(end($tokens));\n if (strcmp($res, \"VERIFIED\") == 0) {\n if($param->receiver_email == '' || $param->receiver_email != $this->settings->paypal_email\n || !$param->Exists('item_number', true) || $param->mc_currency != 'USD') {\n //error_log('Error 1'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n $this->_table->current = $param->item_number;\n if($this->_table->id != $param->item_number || $this->_table->status != 0\n || (float)$param->mc_gross != (float)$this->_table->sum) {\n //error_log('Error 2'.PHP_EOL, 3, LOG_FILE);\n die('error');\n }\n if(strtolower($param->payment_status) == 'completed') {\n $this->_table->status = 2;\n $this->_table->message = $param->txn_id;\n $this->_table->date_payed = date(\"Y-m-d H:m:i\");\n $this->_table->Save();\n //error_log(date('[Y-m-d H:i e] '). \"Verified IPN: $req \". PHP_EOL, 3, LOG_FILE);\n die('ok');\n } else {\n //error_log(date('[Y-m-d H:i e] '). \"Status: \".$param->payment_status.PHP_EOL, 3, LOG_FILE);\n }\n } else if (strcmp ($res, \"INVALID\") == 0) {\n \t//error_log(date('[Y-m-d H:i e] '). \"Invalid IPN: $req\" . PHP_EOL, 3, LOG_FILE);\n }\n die('error');\n }", "public function bluepay_capture_payment($params)\n\t{\n\t\t$this->_api_method = 'CAPTURE';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "function pay($refNumber, $amount, $currency, $transactionID = \"\", $locale = \"en\") {\n\t\t\t\n\t\t\tif (empty($refNumber) || empty($amount) || empty($currency)) {\n\t\t\t\techo \"[ERROR] refNumber, amount and currency is REQUIRED\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userAddress)) {\n\t\t\t\techo \"[ERROR] Please set userAddress\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userCity)) {\n\t\t\t\techo \"[ERROR] Please set userCity\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userEmail)) {\n\t\t\t\techo \"[ERROR] Please set userEmail\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userFirstName)) {\n\t\t\t\techo \"[ERROR] Please set userFirstName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\telse if(empty($this->userLastName)) {\n\t\t\t\techo \"[ERROR] Please set userLastName\";\n\t\t\t\texit;\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($transactionID)) {\n\t\t\t\t$transactionID = uniqid();\n\t\t\t}\n\t\t\t\n\t\t\t$url = \"https://testsecureacceptance.cybersource.com/pay\";\n\t\t\tif($this->isLive) {\n\t\t\t\t$url = \"https://secureacceptance.cybersource.com/pay\";\n\t\t\t}\n\t\t\t\n\t\t\t$arr = array(\n\t\t\t\t'access_key' => $this->accessKey,\n\t\t\t\t'profile_id' => $this->profileID,\n\t\t\t\t'locale' => $locale,\n\t\t\t\t'transaction_uuid' => $transactionID,\n\t\t\t\t'signed_field_names' => $this->signVariables,\n\t\t\t\t'unsigned_field_names' => $this->unsign,\n\t\t\t\t'signed_date_time' => gmdate(\"Y-m-d\\TH:i:s\\Z\"),\n\t\t\t\t'transaction_type' => \"sale\",\n\t\t\t\t'reference_number' => $refNumber,\n\t\t\t\t'auth_trans_ref_no' => $refNumber,\n\t\t\t\t'merchant_descriptor' => \"Pixil\",\n\t\t\t\t'amount' => $amount,\n\t\t\t\t'currency' => strtoupper($currency),\n\t\t\t\t'bill_to_address_city' => $this->userCity,\n\t\t\t\t'bill_to_address_country' => $this->userCountry,\n\t\t\t\t'bill_to_email' => $this->userEmail,\n\t\t\t\t'bill_to_address_line1' => $this->userAddress,\n\t\t\t\t'bill_to_forename' => $this->userFirstName,\n\t\t\t\t'bill_to_surname' => $this->userLastName,\n\t\t\t\t'bill_to_address_line2' => \"\",\n\t\t\t\t'bill_to_address_state' => \"\",\n\t\t\t\t'bill_to_address_postal_code' => \"\",\n\t\t\t\t'bill_to_phone' => \"\"\n\t\t\t);\n\t\t\t\n\t\t\tif (!empty($this->mdd1)) {\n\t\t\t\t$arr['merchant_defined_data1'] = $this->mdd1;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data1\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd2)) {\n\t\t\t\t$arr['merchant_defined_data2'] = $this->mdd2;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data2\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd3)) {\n\t\t\t\t$arr['merchant_defined_data3'] = $this->mdd3;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data3\";\n\t\t\t}\n\t\t\tif (!empty($this->mdd4)) {\n\t\t\t\t$arr['merchant_defined_data4'] = $this->mdd4;\n\t\t\t\t$arr['unsigned_field_names'] .= \",merchant_defined_data4\";\n\t\t\t}\n\t\t\t\n\t\t\t$signature = $this->sign($arr);\n\t\t\t\n\t\t\t$html = \"<html><head></head><body><form action='$url' method='post'/>\"; \n\t\t\tforeach($arr as $key => $value) {\n\t\t\t\t$html .= \"<input type='hidden' name='$key' value='$value' />\";\n\t\t\t}\n\t\t\t\n\t\t\t$html .= \"<input type='hidden' name='signature' value='$signature' />\";\n\t\t\t\n\t\t\t$html .= \"</form>\";\n\t\t\t$html .= \"<script type='text/javascript'>\";\n\t\t\t$html .= \"setTimeout(function() { document.forms[0].submit(); }, 2000);\";\n\t\t\t$html .= \"</script>\";\n\t\t\t$html .= \"</body>\";\n\t\t\techo $html;\n\t\t}", "public function gopayAction()\n {\n \t$uid = $this->uid;\n $buy_type = $_GET;\n $buy_type = array_keys($buy_type);\n\n //$buy_type\n //[\"callback\\/apipay\",\"btnOrder1\",\"uid\"]\n $buy_type = str_replace('btnOrder', '', $buy_type[1]);\n\n //check buy_type\n $price = 0;\n\n\t\t//加码\n\t\t$nowTime = time();\n\t\t$changeStartTime = strtotime('2012-01-18 00:00:01');\n\t\t$changeEndTime = strtotime('2012-01-26 23:59:59');\n\n\t\tif (($nowTime >= $changeStartTime) && ($nowTime <= $changeEndTime)) {\n\t\t\t$changestatus = 1;\n\t\t} else {\n\t\t\t$changestatus = 2;\n\t\t}\n\n //以分为单位\n\t\tif ($changestatus == 1) {\n\t\t\t$payment = $this->_aryPayDay;\n\t\t} else {\n\t\t\t$payment = $this->_aryPay;\n\t\t}\n\n $gold = 0;\n $itemName = '';\n foreach ($payment as $item) {\n if ($buy_type == $item['id']) {\n $price = $item['price'];\n $gold = $item['gold'];\n $itemName = $item['name'];\n break;\n }\n }\n\n if ($price <= 0 || empty($buy_type) || empty($itemName)) {\n exit;\n }\n\n $rowUser = Hapyfish2_Platform_Bll_User::getUser($uid);\n $orderId = Hapyfish2_Island_Bll_Payment::createPayOrderId($rowUser['puid']);\n $buyer_time = time();\n //call api\n $params = array();\n $params['format'] = 'json';\n $params['item_id'] = $buy_type;\n $params['item_version_id'] = 2;\n $params['total_price'] = $price;\n \t \t/*if ($uid == 10650884) {\n \t$params['total_price'] = 1;\n }*/\n $params['item_name'] = $itemName;\n $params['item_version_name'] = '宝石';\n $params['page_ret_url'] = HOST . '/callback/paydone?';\n $params['proxy_code'] = 'HAPPYFISH';\n $params['outer_order_id'] = $orderId;\n $params['buyer_time'] = $buyer_time;\n $params['description'] = '';\n $params['alipay_id'] = '374052723';//'2088302111803535';\n $rest = Taobao_Rest::getInstance();\n $rest->setUser($puid, $this->info['session_key']);\n $data = $rest->jianghu_getVasIsvUrl($params);\n if (empty($data) || !is_array($data) || !isset($data['vas_isv_url_get_response']['vas_isv_url'])) {\n info_log('101' ,'tb2payfailed');\n \techo '<html><body>request timeout,please try again later.</body></html>';\n exit;\n }\n \t\t$dataUrl = $data['vas_isv_url_get_response']['vas_isv_url'];\n try {\n\t if (isset($dataUrl['aplipay_isv_address'])) {\n\t\t //create pay order\n\t\t $amount = (int)($price/100);\n\t\t $tradeNo = $dataUrl['order_id'];\n\t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n return $this->_redirect($dataUrl['aplipay_isv_address']);\n }\n info_log('102' ,'tb2payfailed');\n\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n \t\techo \"<html><body>$msg</body></html>\";\n\t exit;\n\t\t }\n\t else {\n\t \tif (1 == $dataUrl['status']) {\n \t \t//create pay order\n \t\t $amount = (int)($price/100);\n \t\t $tradeNo = $dataUrl['order_id'];\n \t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n $order = Hapyfish2_Island_Bll_Payment::getOrder($uid, $orderId);\n if ($order['status'] == 1) {\n return $this->_redirect('/pay/payfinish');\n }\n $payRst = Hapyfish2_Island_Bll_Payment::completeOrder($uid, $order);\n if ($payRst == 0) {\n $log = Hapyfish2_Util_Log::getInstance();\n\t\t $log->report('tb2paydone', array($orderId, $amount, $tradeNo, $uid, 1));\n return $this->_redirect('/pay/payfinish');\n }\n else {\n info_log('103' ,'tb2payfailed');\n }\n }\n else {\n info_log('102' ,'tb2payfailed');\n }\n\t\t\t //$msg = $dataUrl['message'];\n\t\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\techo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t \telse {\n\t \t //info_log('104:'.json_encode($dataUrl) ,'tb2payfailed');\n\t \t info_log('104:'.json_encode($data) ,'tb2payfailed');\n\t \t\t$msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\treturn $this->_redirect('http://pay.taobao.com/account/pay_for_account.htm');\n\t \t\t//echo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t }\n } catch (Exception $e) {\n echo '-100';\n exit;\n }\n\n info_log('105' ,'tb2payfailed');\n\t\techo \"<html><body>Please retry.</body></html>\";\n\t\texit;\n }", "public function savedata(Request $req){\n \n /* All Required Parameters by your Gateway will differ from gateway to gateway refer the gate manual */\n \n $txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);\n $hashSequence = \"key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10\";\n\n $hashVarsSeq = explode('|', $hashSequence);\n $hash_string = '';\t\n\tforeach($hashVarsSeq as $hash_var) {\n $hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : '';\n $hash_string .= '|';\n }\n\n $hash_string .= 'TrxgYYoPbH';\n\n $amount = $req['amount'];\n $firstname = $req ['firstname'];\n $email = $req ['email'];\n $phone = $req ['phone'];\n\n $hash = strtolower(hash('sha512', $hash_string));\n\n \n $parameters = [\n 'key' => '9Dkhrlk5',\n 'txnid' => $txnid,\n 'surl'=> \"https://chaalagas.com/cng\",\n 'furl'=> 'lpgdomestic',\n 'amount' => $amount,\n 'firstname' => $firstname ,\n 'email' => $email,\n 'phone' => $phone,\n 'productinfo' => 'Security Guard Application Form Fees',\n 'amount'=> $amount\n ];\n \n $order = Indipay::prepare($parameters);\n return Indipay::process($order);\n\n $candidate = new securityappmodel;\n $candidate->firstname = $req ['firstname'];\n $candidate->middlename= $req ['middlename'];\n $candidate->lastname= $req ['lastname'];\n $candidate->mothername = $req ['mothername'];\n $candidate->fathername= $req ['fathername'];\n $candidate->mobile= $req ['phone'];\n $candidate->email= $req ['email'];\n $candidate->dob= $req ['dob'];\n $candidate->caste= $req ['caste'];\n $candidate->aadharnumber= $req ['aadharnumber'];\n $candidate->maritalstatus= $req ['maritalstatus'];\n $candidate->state= $req ['state'];\n $candidate->district= $req ['district'];\n $candidate->thesil= $req ['thesil'];\n $candidate->permanentaddress= $req ['permanentaddress'];\n $candidate->currentaddress= $req ['currentaddress'];\n $candidate->education= $req ['education'];\n $candidate->percentage= $req ['percentage'];\n $candidate->experience= $req ['experience'];\n $candidate->jobdivision= $req ['jobdivision'];\n $candidate->jobdistrict= $req ['jobdistrict'];\n $candidate-> save();\n\n $ref = $candidate->id;\n $name= $candidate->firstname;\n $candidate->referenceid = \"CGPLSG2021100$ref\";\n $newref = $candidate->referenceid;\n $candidate->save();\n\n\n return redirect(\"/\")->with('alert','Dear'.$name.' your Application is Successfully Submitted and Your Reference Nuber is'. $newref);\n \n }", "public function execute(){\n\n $body = '{\"payer_id\":\"' . $this->payer_id . '\"}';\n $client = new Client();\n try{\n $paymentInfo = $client->request('POST', $this->execute_url, ['headers' => [\n 'Content-Type' => 'application/json',\n 'Authorization' => 'Bearer ' . $this->accessKey,\n ],\n 'body' => $body\n ]);\n }\n catch (\\Exception $ex) {\n $error = json_encode($ex->getMessage());\n return($error);\n }\n $this->parsePaymentBody($paymentInfo);\n return $this->paymentBody;\n\n }", "public function testAddSignature()\n {\n $data = array(\n 'foo' => 'baa'\n );\n\n $transaction = $this->client->transaction()->addSignature(655, $data);\n $this->assertEquals($data, get_object_vars($transaction->post), 'Passed variables are not correct');\n $this->assertEquals('POST', $transaction->request_method, 'The PHP Verb Is Incorrect');\n $this->assertEquals('/transactions/655/signature/capture', $transaction->path, 'The path is incorrect');\n\n }", "public function callbackhostedpaymentAction()\n {\n $boError = false;\n $formVariables = array();\n $model = Mage::getModel('paymentsensegateway/direct');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n $checkout = Mage::getSingleton('checkout/type_onepage');\n $session = Mage::getSingleton('checkout/session');\n $szPaymentProcessorResponse = '';\n $order = Mage::getModel('sales/order');\n $order->load(Mage::getSingleton('checkout/session')->getLastOrderId());\n $nVersion = Mage::getModel('paymentsensegateway/direct')->getVersion();\n $boCartIsEmpty = false;\n \n try\n {\n $hmHashMethod = $model->getConfigData('hashmethod');\n $szPassword = $model->getConfigData('password');\n $szPreSharedKey = $model->getConfigData('presharedkey');\n \n $formVariables['HashDigest'] = $this->getRequest()->getPost('HashDigest');\n $formVariables['MerchantID'] = $this->getRequest()->getPost('MerchantID');\n $formVariables['StatusCode'] = $this->getRequest()->getPost('StatusCode');\n $formVariables['Message'] = $this->getRequest()->getPost('Message');\n $formVariables['PreviousStatusCode'] = $this->getRequest()->getPost('PreviousStatusCode');\n $formVariables['PreviousMessage'] = $this->getRequest()->getPost('PreviousMessage');\n $formVariables['CrossReference'] = $this->getRequest()->getPost('CrossReference');\n $formVariables['Amount'] = $this->getRequest()->getPost('Amount');\n $formVariables['CurrencyCode'] = $this->getRequest()->getPost('CurrencyCode');\n $formVariables['OrderID'] = $this->getRequest()->getPost('OrderID');\n $formVariables['TransactionType'] = $this->getRequest()->getPost('TransactionType');\n $formVariables['TransactionDateTime'] = $this->getRequest()->getPost('TransactionDateTime');\n $formVariables['OrderDescription'] = $this->getRequest()->getPost('OrderDescription');\n $formVariables['CustomerName'] = $this->getRequest()->getPost('CustomerName');\n $formVariables['Address1'] = $this->getRequest()->getPost('Address1');\n $formVariables['Address2'] = $this->getRequest()->getPost('Address2');\n $formVariables['Address3'] = $this->getRequest()->getPost('Address3');\n $formVariables['Address4'] = $this->getRequest()->getPost('Address4');\n $formVariables['City'] = $this->getRequest()->getPost('City');\n $formVariables['State'] = $this->getRequest()->getPost('State');\n $formVariables['PostCode'] = $this->getRequest()->getPost('PostCode');\n $formVariables['CountryCode'] = $this->getRequest()->getPost('CountryCode');\n \n if(!PYS_PaymentFormHelper::compareHostedPaymentFormHashDigest($formVariables, $szPassword, $hmHashMethod, $szPreSharedKey))\n {\n $boError = true;\n $szNotificationMessage = \"The payment was rejected for a SECURITY reason: the incoming payment data was tampered with.\";\n Mage::log(\"The Hosted Payment Form transaction couldn't be completed for the following reason: [\".$szNotificationMessage. \"]. Form variables: \".print_r($formVariables, 1));\n }\n else\n {\n $paymentsenseOrderId = Mage::getSingleton('checkout/session')->getPaymentsensegatewayOrderId();\n $szOrderStatus = $order->getStatus();\n $szStatusCode = $this->getRequest()->getPost('StatusCode');\n $szMessage = $this->getRequest()->getPost('Message');\n $szPreviousStatusCode = $this->getRequest()->getPost('PreviousStatusCode');\n $szPreviousMessage = $this->getRequest()->getPost('PreviousMessage');\n $szOrderID = $this->getRequest()->getPost('OrderID');\n \n if($szOrderStatus != 'pys_paid' &&\n $szOrderStatus != 'pys_preauth')\n {\n $checkout->saveOrderAfterRedirectedPaymentAction(true,\n $this->getRequest()->getPost('StatusCode'),\n $this->getRequest()->getPost('Message'),\n $this->getRequest()->getPost('PreviousStatusCode'),\n $this->getRequest()->getPost('PreviousMessage'),\n $this->getRequest()->getPost('OrderID'),\n $this->getRequest()->getPost('CrossReference'));\n }\n else \n {\n // cart is empty\n $boCartIsEmpty = true;\n $szPaymentProcessorResponse = null;\n \n // chek the StatusCode as the customer might have just clicked the BACK button and re-submitted the card details\n // which can cause a charge back to the merchant\n $this->_fixBackButtonBug($szOrderID, $szStatusCode, $szMessage, $szPreviousStatusCode, $szPreviousMessage);\n }\n }\n }\n catch (Exception $exc)\n {\n $boError = true;\n $szNotificationMessage = Paymentsense_Paymentsensegateway_Model_Common_GlobalErrors::ERROR_183;\n Mage::logException($exc);\n }\n \n $szPaymentProcessorResponse = $session->getPaymentprocessorresponse();\n if($boError)\n {\n if($szPaymentProcessorResponse != null &&\n $szPaymentProcessorResponse != '')\n {\n $szNotificationMessage = $szNotificationMessage.'<br/>'.$szPaymentProcessorResponse;\n }\n \n $model->setPaymentAdditionalInformation($order->getPayment(), $this->getRequest()->getPost('CrossReference'));\n //$order->getPayment()->setTransactionId($this->getRequest()->getPost('CrossReference'));\n \n if($nVersion >= 1410)\n {\n if($order)\n {\n $orderState = 'pending_payment';\n $orderStatus = 'pys_failed_hosted_payment';\n $order->setCustomerNote(Mage::helper('paymentsensegateway')->__('Hosted Payment Failed'));\n $order->setState($orderState, $orderStatus, $szPaymentProcessorResponse, false);\n $order->save();\n }\n }\n if($nVersion == 1324 || $nVersion == 1330)\n {\n Mage::getSingleton('checkout/session')->addError($szNotificationMessage);\n }\n else \n {\n Mage::getSingleton('core/session')->addError($szNotificationMessage);\n }\n $order->save();\n \n $this->_clearSessionVariables();\n $this->_redirect('checkout/onepage/failure');\n }\n else\n {\n // set the quote as inactive after back from paypal\n Mage::getSingleton('checkout/session')->getQuote()->setIsActive(false)->save();\n\n if($boCartIsEmpty == false)\n {\n // send confirmation email to customer\n if($order->getId())\n {\n $order->sendNewOrderEmail();\n }\n \n if($nVersion >= 1410)\n {\n // TODO : no need to remove stock item as the system will do it in 1.6 version\n if($nVersion < 1600)\n {\n $model->subtractOrderedItemsFromStock($order);\n }\n $this->_updateInvoices($order, $szPaymentProcessorResponse);\n }\n \n if($nVersion != 1324 && $nVersion != 1330)\n {\n if($szPaymentProcessorResponse != '')\n {\n Mage::getSingleton('core/session')->addSuccess($szPaymentProcessorResponse);\n }\n }\n }\n \n $this->_redirect('checkout/onepage/success', array('_secure' => true));\n }\n }", "public function wpp_hash($method = null, $nvp = null) {\n\t\t$HttpSocket = new HttpSocket();\n\n\t\t$required_nvp = 'METHOD='.$method;\n\t\t$required_nvp .= '&VERSION='.Configure::read('Paypal.version');\n\t\t$required_nvp .= '&USER='.Configure::read('Paypal.username');\n\t\t$required_nvp .= '&PWD='.Configure::read('Paypal.password');\n\t\t$required_nvp .= '&SIGNATURE='.Configure::read('Paypal.signature');\n\t\tdebug($required_nvp);\n\t\tdie();\n\t\t$http_responder = $HttpSocket->post(Configure::read('Paypal.endpoint'), $required_nvp.$nvp);\n\t\tif (!$http_responder) {\n\t\t\tthrow new BadRequestException($method.'failed: '.$http_responder['reasonPhrase']);\n\t\t}\n\t\t\n\t\t$responder = explode('&', $http_responder);\n\t\t$parsed_response = array();\n\t\t\n\t\tforeach($responder as $response) {\n\t\t\t$response_array = explode('=', $response);\n\t\t\tif (count($response_array) >= 1)\n\t\t\t\t$parsed_response[$response_array[0]] = urldecode($response_array[1]);\n\t\t}\n\t\t\n\t\tif ((count($parsed_response) < 1) || !array_key_exists('ACK', $parsed_response))\n\t\t\tthrow new BadRequestException('Invalid HTTP Response for POST request ('.$required_nvp.$nvp.') to '.Configure::read('Paypal.endpoint'));\n\t\t\n\t\treturn $parsed_response;\n\t}", "public function getHashSignedById(): string;", "abstract protected function handlePayment();", "function successpayment()\n {\n\n /* Check for allowed IP */\n if ($this->config['allow_ip']) {\n $allowed_ip = explode(',', $this->config['allow_ip']);\n $valid_ip = in_array($_SERVER['REMOTE_ADDR'], $allowed_ip);\n if (!$valid_ip) {\n // TODO log\n return false;\n }\n }\n\n $response['orderId'] = $_POST['orderId'];\n $response['serviceName'] = $_POST['serviceName'];\n $response['eshopAccount'] = $_POST['eshopAccount'];\n $response['paymentStatus'] = $_POST['paymentStatus'];\n $response['userName'] = $_POST['userName'];\n $response['userEmail'] = $_POST['userEmail'];\n $response['paymentData'] = $_POST['paymentData'];\n $response['hash'] = $_POST['hash'];\n\n if (!empty($response['hash'])) {\n\n $order = uc_order_load($response['orderId']);\n if (!count($order))\n trigger_error('RBK Money : Полученный orderId (' . $response['orderId'] . ') не найден в базе', E_USER_WARNING);\n\n $string = $this->config['eshopId'] . '::' . $response['orderId'] . '::' . $response['serviceName'] . '::' . $response['eshopAccount'] . '::' . number_format($order->order_total, 2, '.', '') . '::' . $this->config['recipientCurrency'] . '::' . $response['paymentStatus'] . '::' . $response['userName'] . '::' . $response['userEmail'] . '::' . $response['paymentData'] . '::' . $this->config['secretKey'];\n $crc = md5($string);\n\n if ($response['hash'] == $crc) {\n list($dataBill) = $this->qs('*', array('id' => $response['orderId']));\n switch ($response['paymentStatus']) {\n case self::STATUS_PROCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_order_update_status($response['orderId'], 'processing');\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment processing'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n case self::STATUS_SUCCESS:\n $this->owner->payTransaction($dataBill['owner_id'], PAY_PAID);\n /*uc_payment_enter($response['orderId'], 'RBK Money', $order->order_total, $order->uid, NULL, NULL);\n uc_cart_complete_sale($order);\n uc_order_comment_save($response['orderId'], $order->uid, t('RBK Money: payment successful'), $type = 'admin', $status = 1, $notify = FALSE);*/\n break;\n }\n } elseif ($response['hash'] !== $crc) {\n /*uc_order_update_status($response['orderId'], 'canceled');\n uc_order_comment_save($response['orderId'], $order->uid, t('MD5 checksum fail, possible fraud. Order canceled'), $type = 'admin', $status = 1, $notify = FALSE);\n watchdog('uc_rbkmoney', 'MD5 checksum fail, possible fraud. Order canceled');*/\n trigger_error('RBK Money : Полученный hash не верный', E_USER_WARNING);\n }\n }\n }", "function performPaymentInitialization() {\r\n\t\t;\r\n\t\t$request = \"\";\r\n\t\t$response = \"\";\r\n\t\t$requestbuffer;\r\n\t\t$xmlData = \"\";\r\n\t\t$hm;\r\n\t\ttry {\r\n\t\t\tif ($request != null) {\r\n\t\t\t\t$xmlData = $data;\r\n\t\t\t} else {\r\n\t\t\t\t$keyParser = new KeyStore ();\r\n\t\t\t\t$this->key = $keyParser->parseKeyStore ( $this->keystorePath );\r\n\t\t\t\t$xmlData = $this->parseResource ( $this->key, $this->resourcePath, $this->alias );\r\n\t\t\t}\r\n\t\t\tvar_dump ( $xmlData );\r\n\t\t\t\r\n\t\t\tif ($xmlData != null) {\r\n\t\t\t\t$hm = $this->parseXMLRequest ( $xmlData );\r\n\t\t\t} else {\r\n\t\t\t\t$error = \"Alias name does not exits\";\r\n\t\t\t}\r\n\t\t\tvar_dump ( $hm );\r\n\t\t\t$this->key = $hm ['resourceKey'];\r\n\t\t\t// echo $this->key;\r\n\t\t\t$requestbuffer = $this->buildHostRequest ();\r\n\t\t\t$requestbuffer .= \"id=\" . $hm [\"id\"] . \"&\";\r\n\t\t\t\r\n\t\t\t$requestbuffer .= 'password=' . $hm ['password'] . \"&\";\r\n\t\t\t$webaddr = $hm ['webaddress'];\r\n\t\t\t// echo \"<br><br><br><br>\" . $requestbuffer . \"<br><br><br>\";\r\n\t\t\t$request = $requestbuffer;\r\n\t\t\tvar_dump ( $request );\r\n\t\t\t// var_dump($request);\r\n\t\t\t// var_dump($webaddr);\r\n\t\t\t$pipe = new ipayTransactionPipe ();\r\n\t\t\t// echo \"<br/>REQUEST\" . $request;\r\n\t\t\t\r\n\t\t\t$response = $pipe->performHostedTransaction ( $request, $webaddr );\r\n\t\t\tVAR_DUMP ( $response );\r\n\t\t\t// System.out.println(\"response:::::::\" + response);\r\n\t\t\tif ($response == null) {\r\n\t\t\t\t// echo \"null\";\r\n\t\t\t\t$this->error = \"Error while connecting \" . $response;\r\n\t\t\t\treturn - 1;\r\n\t\t\t} else {\r\n\t\t\t\tif ($response != null) {\r\n\t\t\t\t\t// echo \"not null\";\r\n\t\t\t\t\t$this->setpaymentId ( $response [0] );\r\n\t\t\t\t\t$this->setpaymentPage ( $response [1] );\r\n\t\t\t\t\t// $this->paymentPage = $response[1];\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$this->error = \"Error while connecting \" + $response;\r\n\t\t\t\t\treturn - 1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch ( Exception $e ) {\r\n\t\t\t\r\n\t\t\t$this->error = \"Error while connecting \" + $response;\r\n\t\t\treturn - 1;\r\n\t\t}\r\n\t}", "public function CallRefund( $payKey, $transactionId, $trackingId, $receiverEmailArray, $receiverAmountArray )\r\n {\r\n /* Gather the information to make the Refund call.\r\n The variable nvpstr holds the name value pairs\r\n */\r\n \r\n $nvpstr = \"\";\r\n \r\n // conditionally required fields\r\n if (\"\" != $payKey)\r\n {\r\n $nvpstr = \"payKey=\" . urlencode($payKey);\r\n if (0 != count($receiverEmailArray))\r\n {\r\n reset($receiverEmailArray);\r\n while (list($key, $value) = each($receiverEmailArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").email=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n if (0 != count($receiverAmountArray))\r\n {\r\n reset($receiverAmountArray);\r\n while (list($key, $value) = each($receiverAmountArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").amount=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n }\r\n elseif (\"\" != $trackingId)\r\n {\r\n $nvpstr = \"trackingId=\" . urlencode($trackingId);\r\n if (0 != count($receiverEmailArray))\r\n {\r\n reset($receiverEmailArray);\r\n while (list($key, $value) = each($receiverEmailArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").email=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n if (0 != count($receiverAmountArray))\r\n {\r\n reset($receiverAmountArray);\r\n while (list($key, $value) = each($receiverAmountArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").amount=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n }\r\n elseif (\"\" != $transactionId)\r\n {\r\n $nvpstr = \"transactionId=\" . urlencode($transactionId);\r\n // the caller should only have 1 entry in the email and amount arrays\r\n if (0 != count($receiverEmailArray))\r\n {\r\n reset($receiverEmailArray);\r\n while (list($key, $value) = each($receiverEmailArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").email=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n if (0 != count($receiverAmountArray))\r\n {\r\n reset($receiverAmountArray);\r\n while (list($key, $value) = each($receiverAmountArray))\r\n {\r\n if (\"\" != $value)\r\n {\r\n $nvpstr .= \"&receiverList.receiver(\" . $key . \").amount=\" . urlencode($value);\r\n }\r\n }\r\n }\r\n }\r\n\r\n /* Make the Refund call to PayPal */\r\n $resArray = $this->hash_call(\"Refund\", $nvpstr);\r\n\r\n /* Return the response array */\r\n return $resArray;\r\n }", "private function signature(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\t\t\t\n\t\t\t$first_name = $this->_request['first_name'];\t\t\n\t\t\t$last_name = $this->_request['last_name'];\t\n\t\t\t$data = $this->_request['data'];\n\t\t\t$current_datetime = new DateTime(); \n\t\t\t$sig_name = strtolower(preg_replace(\"/[\\W\\s+]/\",\"\", $first_name.'_'.$last_name.'_'.$current_datetime->format('Y-m-d_His')));\n\t\t\t$signature = base64_decode(str_replace(\"data:image/png;base64,\",\"\",$data));\n\t\t\t$result=file_put_contents(\"../signatures/\".$sig_name.\".png\",$signature);\t\n\t\t\tif($result){\n\t\t\t\t $this->response($sig_name.'.png', 200);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// If invalid inputs \"Bad Request\" status message and reason\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Signature Failed\");\n\t\t\t\t$this->response($this->json($error), 400);\t\t\t\t\t\t\n\t\t\t}\t\t\n\t\t}", "public function makePayment () {\n \n // sent to bank for verification and transaction code\n \n srand(time());\t\t\t\t\n $pool = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!#%&\";\n for($index = 0; $index < 20; $index++) {\n $sid .= substr($pool,(rand()%(strlen($pool))), 1);\n }\n \n $errorCode = 0;\n\t\t$errorMessage = \"\";\n \n $error[\"id\"] = $errorCode;\n\t\t$error[\"message\"] = $errorMessage;\n\t\t\n\t\t$data[\"error\"] = $error;\n\t\t \n $data[\"transaction_code\"] = $sid;\n\n $data = json_encode($data);\n \n return $data; \n }", "function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}", "public function makePayment($amountTobePaid)\n {\n\n $this->transactionId = uniqid();\n $encodedAuth = base64_encode($this->apiUser . \":\" . $this->apiPassword);\n $postRequest = array(\n \"total_amount\" => $amountTobePaid,\n \"return_url\" => $this->returnUrl,\n \"notify_url\" => $this->notifyUrl,\n \"transaction_id\" => $this->transactionId,\n \"description\"=> \"PayUnit web payments\"\n );\n $cURLConnection = curl_init();\n if($this->mode === \"test\"){\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/sandbox/gateway/initialize\");\n }else{\n curl_setopt($cURLConnection, CURLOPT_URL, \"https://app-payunit.sevengps.net/api/gateway/initialize\");\n }\n curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, json_encode($postRequest)); \n $secArr = array(\n \"x-api-key: {$this->apiKey}\",\n \"authorization: Basic: {$encodedAuth}\",\n 'Accept: application/json',\n 'Content-Type: application/json',\n \"mode: {$this->mode}\"\n );\n $all = array_merge($postRequest,$secArr);\n curl_setopt($cURLConnection, CURLOPT_HTTPHEADER,$all);\n curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);\n $apiResponse = curl_exec($cURLConnection);\n curl_close($cURLConnection);\n $jsonArrayResponse = json_decode($apiResponse);\n echo(isset($jsonArrayResponse));\n if(isset($jsonArrayResponse->body->transaction_url)){\n echo(\"dfdgdg\");\n //die();\n header(\"Location: {$jsonArrayResponse->body->transaction_url}\");\n exit(); \n }\n else{\n echo($apiResponse);\n }\n }", "function bunq_CreateRequest($amount, $description, $redirect, $user = 0, $account = 0) {\n\n\t$apiContext = ApiContext::restore(ApiContext::FILENAME_CONFIG_DEFAULT);\n\t$users = User::listing($apiContext)->getValue();\n\t//$user = $users[$user]->getUserPerson();\n\t$user = $users[$user]->getUserCompany();\n\t$userId = $user->getId();\n\t$monetaryAccounts = MonetaryAccount::listing($apiContext, $userId)->getValue();\n\t$monetaryAccount = $monetaryAccounts[$account]->getMonetaryAccountBank();\n\t$monetaryAccountId = $monetaryAccount->getId();\n\t$requestMap = [\n\t\tBunqMeTab::FIELD_BUNQME_TAB_ENTRY => [\n\t\t\tBunqMeTabEntry::FIELD_AMOUNT_INQUIRED => new Amount($amount, 'EUR'),\n\t\t\tBunqMeTabEntry::FIELD_REDIRECT_URL => $redirect,\n\t\t\tBunqMeTabEntry::FIELD_DESCRIPTION => $description\n\t\t]\n\t];\n\t$createBunqMeTab = BunqMeTab::create($apiContext, $requestMap, $userId, $monetaryAccountId)->getValue();\n\t$bunqMeRequest = BunqMeTab::get($apiContext, $userId, $monetaryAccountId, $createBunqMeTab)->getValue();\n\t$r[\"id\"] = $bunqMeRequest->getId();\n\t$r[\"uuid\"] = $bunqMeRequest->getBunqmeTabEntry()->getUuid();\n\t$r[\"amount\"] = $bunqMeRequest->getBunqmeTabEntry()->getAmountInquired()->getValue();\n\t$r[\"paymentlink\"] = $bunqMeRequest->getBunqmeTabShareUrl();\n\t$r[\"status\"] = $bunqMeRequest->getBunqmeTabEntry()->getStatus();\n\t$r[\"description\"] = $bunqMeRequest->getBunqmeTabEntry()->getDescription();\n\t$r[\"redirecturl\"] = $bunqMeRequest->getBunqmeTabEntry()->getRedirectUrl();\n\t$r[\"raw\"] = $bunqMeRequest;\n\treturn $r;\n\n}", "function parse_authorize_payment_response($response) {\n // check total length\n if (sizeof($response)<51){\n return result_response_parse_error('response length error :' . sizeof($response));\n }\n // check STX\n if ($response[0]!=STX) {\n return result_response_parse_error('response STX error');\n }\n // check command\n if ($response[1]!=CMD_AUTHORIZE_PAYMENT) {\n return result_response_parse_error('response CMD error');\n }\n // check checksum\n $data = array_slice($response,2,47);\n $checksum = calc_checksum(CMD_AUTHORIZE_PAYMENT,$data);\n if ($checksum!=$response[49]) {\n return result_response_parse_error('response CHECKSUM error');\n }\n // check ETX\n if ($response[50]!=ETX) {\n return result_response_parse_error('response ETX error');\n }\n $rdata = array();\n // get ticket\n $ticket_data = array_slice($data,0,8);\n $rdata['ticket'] = bytes_to_string($ticket_data);\n // get receipt\n $receipt_data = array_slice($data,8,10);\n $rdata['receipt'] = bytes_to_string($receipt_data);\n // value, as parking fee, in sen\n $value_data = array_slice($data,18,6);\n $rdata['value'] = intval(bytes_to_string($value_data));\n // gst, as parking fee gst\n $gst_data = array_slice($data,24,4);\n $rdata['gst'] = intval(bytes_to_string($gst_data));\n // pdate, as payment datatime\n $pdate_data = array_slice($data,28,12);\n $rdata['pdate'] = bytes_to_string($pdate_data);\n // grace period,\n $grace_data = array_slice($data,40,3);\n $rdata['grace'] = intval(bytes_to_string($grace_data));\n // status\n $statu_data = array_slice($data,43,4);\n $rdata['status'] = bytes_to_string($statu_data);\n return result_success_data($rdata);\n}", "public function CallPaymentDetails( $payKey, $transactionId, $trackingId )\r\n {\r\n $nvpstr = \"\";\r\n // conditionally required fields\r\n if (\"\" != $payKey)\r\n {\r\n $nvpstr = \"payKey=\" . urlencode($payKey);\r\n }\r\n elseif (\"\" != $transactionId)\r\n {\r\n $nvpstr = \"transactionId=\" . urlencode($transactionId);\r\n }\r\n elseif (\"\" != $trackingId)\r\n {\r\n $nvpstr = \"trackingId=\" . urlencode($trackingId);\r\n }\r\n /* Make the PaymentDetails call to PayPal */\r\n $resArray = $this->hash_call(\"PaymentDetails\", $nvpstr);\r\n /* Return the response array */\r\n return $resArray;\r\n }", "public function generateSignature(string $toSign): GenerateSignatureResponse;", "public function createOfferPurchaseUrl($amount, $user_id, $connect_transaction_id, $return_url, $cancel_url) {\n $this->__createLog('Entering into class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [createOfferPurchaseUrl] with transaction id:'.$connect_transaction_id);\n // code for chiave \n $prod_payment_mac_key = $this->container->getParameter('prod_payment_mac_key');\n // code for alias\n $prod_alias = $this->container->getParameter('prod_alias');\n $payment_type_send = self::TAMOIL_OFFER_CODE;; //TAMOIL OFFER\n $payment_type = ApplaneConstentInterface::TAMOIL_OFFER_CARTISI_PURCHASE_CODE;\n //$amount = 1;\n //amount is coming in multiple of 100 already.\n $dec_amount = (float)sprintf(\"%01.2f\", $amount);\n $amount = 1 ;\n// $amount = $dec_amount;\n //code for codTrans\n $codTrans = \"6THCH\" . time() . $user_id . $payment_type_send;\n // code for divisa\n $currency_code = ApplaneConstentInterface::TAMOIL_OFFER_CURRENCY;\n //code for string for live\n $string = \"codTrans=\" . $codTrans . \"divisa=\" . $currency_code . \"importo=\" . $amount . \"$prod_payment_mac_key\";\n //code for sting for test - fix\n //$string = \"codTrans=\" . $codTrans . \"divisa=\" . $currency_code . \"importo=\" . $amount . \"$test_payment_mac_key\";\n //code for mac\n $mac = sha1($string);\n //$prod_alias = $test_alias;\n //code for symfony url hit by payment gateway\n $base_url = $this->container->getParameter('symfony_base_url');\n $urlpost = $base_url.self::OFFER_PURCHASE_POST_URL;\n //$urlpost = 'http://php-sg1234.rhcloud.com/ipn_test.php';\n $urlpost = $this->createUrls($urlpost, $connect_transaction_id);\n //get entity manager object\n $em = $this->container->get('doctrine')->getManager();\n \n \n $contract_number = ApplaneConstentInterface::TAMOIL_CONTRACT_CONSTANT.$user_id.'_'.time();\n $cancel_url = $this->createUrls($cancel_url, $connect_transaction_id);\n \n $return_url = $this->createUrls($return_url, $connect_transaction_id);\n //code for session id\n $session_id = $user_id;\n //code for descrizione\n $description_amount = $amount/100;\n $description = \"payment_for_\".$description_amount.\"_euro_with_type_\".$payment_type.\"_to_Sixthcontinent\";\n //code for url that is angular js url for payment success and failure\n $url = $return_url;\n //code for tipo_servizio (type service)\n $type_service = self::PAYMENT_SERVICE;\n //code for final url to return\n $final_url = $this->container->getParameter('oneclick_pay_url').\"?session_id=$session_id&alias=$prod_alias&urlpost=$urlpost&tipo_servizio=$type_service&mac=$mac&divisa=$currency_code&importo=$amount&codTrans=$codTrans&url=$url&url_back=$cancel_url&num_contratto=$contract_number&descrizione=$description\";\n $result_data = array('url'=>$final_url, 'transaction_code'=>$codTrans, 'mac'=>$mac, 'description'=>$description, 'url_back'=>$cancel_url, 'url_post'=>$urlpost, 'return_url'=>$return_url);\n $this->__createLog('Exiting from class [SixthContinent\\SixthContinentConnectBundle\\Services\\SixthcontinentOfferTransactionService] and function [createOfferPurchaseUrl] with transaction id:'.Utility::encodeData($result_data));\n return $result_data;\n }", "function thrive_transactions_callblack() {\n\n\t// Always check for nonce before proceeding...\n\t$nonce = filter_input( INPUT_GET, 'nonce', FILTER_SANITIZE_STRING );\n\n\t// If INPUT_GET is empty try input post\n\tif ( empty( $nonce ) ) {\n\n\t\t$nonce = filter_input( INPUT_POST, 'nonce', FILTER_SANITIZE_STRING );\n\n\t}\n\n\tif ( ! wp_verify_nonce( $nonce, 'thrive-transaction-request' ) ) \n\t{\n\n\t\tdie( \n\t\t\t__( 'Invalid Request. Your session has already expired (invalid nonce). \n\t\t\t\tPlease go back and refresh your browser. Thanks!', 'thrive' ) \n\t\t);\n\n\t}\n\n\t$method = filter_input( INPUT_POST, 'method', FILTER_SANITIZE_ENCODED );\n\n\tif ( empty( $method ) ) {\n\t\t// try get action\n\t\t$method = filter_input( INPUT_GET, 'method', FILTER_SANITIZE_ENCODED );\n\t}\n\n\t$allowed_callbacks = array(\n\n\t\t// Tickets/Tasks callbacks\n\t\t'thrive_transaction_add_ticket',\n\t\t'thrive_transaction_delete_ticket',\n\t\t'thrive_transaction_fetch_task',\n\t\t'thrive_transaction_edit_ticket',\n\t\t'thrive_transaction_complete_task',\n\t\t'thrive_transaction_renew_task',\n\n\t\t// Comments callback functions.\n\t\t'thrive_transaction_add_comment_to_ticket',\n\t\t'thrive_transaction_delete_comment',\n\n\t\t// Project callback functions.\n\t\t'thrive_transactions_update_project',\n\t\t'thrive_transactions_delete_project',\n\t);\n\n\tif ( function_exists( $method ) ) {\n\t\tif ( in_array( $method, $allowed_callbacks ) ) {\n\t\t\t// execute the callback\n\t\t\t$method();\n\t\t} else {\n\t\t\tthrive_api_message(array(\n\t\t\t\t'message' => 'method is not listed in the callback',\n\t\t\t));\n\t\t}\n\t} else {\n\t\tthrive_api_message(array(\n\t\t\t'message' => 'method not allowed or method does not exists',\n\t\t));\n\t}\n\n\tthrive_api_message(array(\n\t\t\t'message' => 'transaction callback executed',\n\t\t));\n}", "public function sendPayment($transactionID, $transactionDesc, $data) {\n //init SOAP client\n if(DEPLOYED) {\n $payID = '2272';\n $payPass = 'sM%4D$3i2Tq';\n $url = 'https://api.integrapay.com.au/basic/PayLinkService.svc?WSDL';\n } else {\n $payID = '1131';\n $payPass = '6i?B}Tg7k*5';\n $url ='https://apitest.integrapay.com.au/basic/PayLinkService.svc?WSDL';\n }\n\n $client = new SoapClient($url, array(\"trace\" => 1, \"exception\" => 0));\n\n $programTitle = 'LuckyBuys';\n //Set variables\n $args = array('username' => $payID,\n 'password' => $payPass,\n 'transactionID' => uniqid() . '_' . $transactionID,\n 'transactionDescription' => $transactionDesc,\n 'creditCardNumber' => $data['cc_num'],\n 'creditCardExpiryDate' => $data['cc_exp_year'] . $data['cc_exp_mon'],\n 'creditCardCcv' => $data['cc_cvc'],\n 'creditCardName' => $data['cc_name'],\n 'transactionAmountInCents' => $data['amount'],\n 'payerFirstName' => $data['firstname'],\n 'payerLasttName' => $data['lastname'],\n 'payerAddressLine1' => $data['street1'],\n 'payerAddressLine2' => $data['street2'],\n 'payerAddressSuburb' => $data['suburb'],\n 'payerAddressState' => $data['state'],\n 'payerAddressPostCode' => $data['postcode'],\n 'payerAddressCountry' => $data['country'],\n 'payerMobile' => $data['mobile'],\n 'payerExtraInfo' => $data['email'],\n 'auditUsername' => $programTitle.' Website'\n );\n\n //DO NOT PRINT PAYMENT DETAILS TO LOG IN LIVE SYSTEM\n //This would mean credit card detaisl were stored on our server, which is\n //not allowed unless you are PCI compliant.\n //debugln(\"sending to $url\");\n //debugln($args);\n\n $retry = false;\n $attempt = 3;\n try {\n //Send payment\n do {\n $output = $client->ImmediateCreditCardTransactionFullPayerInfo($args);\n $resID = $output->resultID;\n if($resID === 'R') {\n sleep(10 + rand(0, 10));\n $retry = ($attempt++ < 3);\n }\n } while ($retry);\n\n } catch (Exception $e) {\n $retVal = 'Sorry, there was an error processing your payment: <br>'.strstr($e->getMessage(), 'Parameter name', true);\n return array('status' => 'Failure', 'message' => $retVal);\n }\n\n if($output->resultRejectionTypeID === 0) {\n $retVal = $output->resultBankReceiptID;\n return array('status' => 'Success', 'message' => $retVal);\n } else {\n $retVal = 'There was an error processing payment:<br>'.$output->resultDescription;\n return array('status' => 'Failure', 'message' => $retVal);\n }\n }", "protected function signature( $uri, $body)\n {\n $url = Uri::composeComponents($uri->getScheme(), $uri->getAuthority(), $uri->getPath(), '', '');\n $data = $url . '|' . $body;\n\t\t\n return hash_hmac('sha256', $data, $this->secret);\n }", "public function createOrder($accessToken){\n $url = \"https://api.sandbox.paypal.com/v2/checkout/orders\";\n \n /* Call Headers */\n $paymentHeaders = array(\"Content-Type: application/json\", \"Authorization: Bearer \".$accessToken);\n \n\t/* Generates Random Invoice Number */\n\t$randNo= (string)rand(10000,20000);\n \n /* Fill payload with transaction info */\n\n\t\t\t$postfields = '{}';\n $postfieldsArr = json_decode($postfields, true);\n $postfieldsArr['intent'] = \"CAPTURE\";\n \t$postfieldsArr['application_context']['shipping_preference'] = \"SET_PROVIDED_ADDRESS\";\n \t$postfieldsArr['application_context']['user_action'] = \"PAY_NOW\";\n \t\n \t$postfieldsArr['purchase_units'][0]['description'] = \"PayPalPizza\";\n \t$postfieldsArr['purchase_units'][0]['invoice_id'] = \"INV-PayPalPizza-\" . $randNo;\n \t$postfieldsArr['purchase_units'][0]['amount']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['value'] = $_POST['total_amt'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['currency_code'] = $_POST['currency'];\n \t$postfieldsArr['purchase_units'][0]['amount']['breakdown']['item_total']['value'] = $_POST['total_amt'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['recipient_name']= $_POST['shipping_recipient_name'];\n\t\t\t$postfieldsArr['purchase_units'][0]['shipping']['address']['phone']= $_POST['shipping_phone'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_1']= $_POST['shipping_line1'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['address_line_2']= $_POST['shipping_line2'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_2']= $_POST['shipping_city'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['admin_area_1']= $_POST['shipping_state'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['postal_code']= $_POST['shipping_postal_code'];\n $postfieldsArr['purchase_units'][0]['shipping']['address']['country_code']= $_POST['shipping_country_code'];\n \n for($a = 0; $a < $_POST['itemnum']; $a++){\n $postfieldsArr['purchase_units'][0]['items'][$a]['name'] = $_POST[('itemname'. $a )];\n $postfieldsArr['purchase_units'][0]['items'][$a]['description'] = $_POST[('itemname'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['sku'] = $_POST[('itemsku'. $a)]; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['currency_code'] = $_POST['currency']; \n $postfieldsArr['purchase_units'][0]['items'][$a]['unit_amount']['value'] = $_POST[('itemprice'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['quantity'] = $_POST[('itemamount'. $a)];\n $postfieldsArr['purchase_units'][0]['items'][$a]['category'] = \"PHYSICAL_GOODS\";\n }\n \n $postfields = json_encode($postfieldsArr);\n \n/* Call Orders API */\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HTTPHEADER, $paymentHeaders);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_VERBOSE, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POST, true);\n $run = curl_exec($ch);\n curl_close($ch);\n/* Call Orders API */\n\n echo $run;\n }", "public function getSignature()\n {\n $input = $this->getArgs();\n\n $str = \"\";\n foreach ($input as $key => $val) {\n $str .= $key . \"=\" . $val . \"&\";\n }\n\n $str .= \"password=\" . $this->config->password;\n return $this->hashFunction($str);\n }", "function verifyPaymentDatafeed($src, $prc, $successCode, $merchantReferenceNumber, $paydollarReferenceNumber, $currencyCode, $amount, $payerAuthenticationStatus, $secureHashSecret, $secureHash) {\r\n\t$buffer = $src . '|' . $prc . '|' . $successCode . '|' . $merchantReferenceNumber . '|' . $paydollarReferenceNumber . '|' . $currencyCode . '|' . $amount . '|' . $payerAuthenticationStatus . '|' . $secureHashSecret;\r\n\t$verifyData = sha1($buffer);\r\n\tif ($secureHash == $verifyData) { return true; }\r\n\treturn false;\r\n}", "private function generate_signature( $apicall, $apiargs = NULL, $url = NULL )\n\t {\n\t\t$this->oauth_timestamp = time();\n\t\t$this->oauth_nonce = md5(time() . mt_rand());\n\n\t\tif ( !is_null( $apicall ) && $apicall != 'Upload' ) {\n\t\t\tif ( substr( $apicall,0,8 ) != 'smugmug.' ) {\n\t\t\t\t$apicall = 'smugmug.' . $apicall;\n\t\t\t}\n\t\t}\n\t\tif ( $this->oauth_signature_method == 'PLAINTEXT' ) {\n\t\t\treturn phpSmug::urlencodeRFC3986( $this->OAuthSecret ).'&'.phpSmug::urlencodeRFC3986( $this->oauth_token_secret );\n\t\t} else {\n\t\t\t$this->oauth_signature_method = 'HMAC-SHA1';\n\t\t\t$encKey = phpSmug::urlencodeRFC3986( $this->OAuthSecret ) . '&' . phpSmug::urlencodeRFC3986( $this->oauth_token_secret );\n\t\t\t\n\t\t\tif ( is_null( $apicall ) && !is_null( $url ) ) {\n\t\t\t\t$endpoint = $url;\n\t\t\t} else if ( strpos( $apicall, 'Token' ) || $this->secure && $apicall != 'Upload' ) {\n\t\t\t\t$endpoint = \"https://secure.smugmug.com/services/api/php/{$this->APIVer}/\";\n\t\t\t} else if ( $apicall == 'Upload' ) {\n\t\t\t\t//$proto = ( $this->oauth_signature_method == 'PLAINTEXT' || $this->secure ) ? 'https' : 'http';\n\t\t\t\t//$endpoint = $proto . '://upload.smugmug.com/'.$apiargs['FileName'];\t// No support for secure uploads yet\n\t\t\t\t$endpoint = 'http://upload.smugmug.com/'.$apiargs['FileName'];\n\t\t\t} else {\n\t\t\t\t$endpoint = \"http://api.smugmug.com/services/api/php/{$this->APIVer}/\";\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_null( $apicall ) ) {\n\t\t\t\t$method = 'GET';\n\t\t\t} else if ( $apicall == 'Upload' ) {\n\t\t\t\t$method = 'PUT';\n\t\t\t} else {\n\t\t\t\t$method = 'POST';\n\t\t\t}\n\t\t\t$params = array (\n\t\t\t\t'oauth_version' => '1.0',\n\t\t\t\t'oauth_nonce' => $this->oauth_nonce,\n\t\t\t\t'oauth_timestamp' => $this->oauth_timestamp,\n\t\t\t\t'oauth_consumer_key' => $this->APIKey,\n\t\t\t\t'oauth_signature_method' => $this->oauth_signature_method\n\t\t\t\t);\n\t\t\tif ( !is_null( $apicall ) && $apicall != 'Upload' ) $params = array_merge( $params, array('method' => $apicall ) );\n\t\t\t$params = ( !empty( $this->oauth_token ) ) ? array_merge( $params, array( 'oauth_token' => $this->oauth_token ) ) : $params;\n\t\t\tif ( $apicall != 'Upload' ) $params = ( !empty( $apiargs ) ) ? array_merge( $params, $apiargs ) : $params;\n\t\t $keys = array_map( array( 'phpSmug', 'urlencodeRFC3986' ), array_keys( $params ) );\n\t\t $values = array_map( array( 'phpSmug', 'urlencodeRFC3986' ), array_values( $params ) );\n\t\t\t$params = array_combine( $keys, $values );\n\t\t // Sort by keys (natsort)\n\t\t uksort( $params, 'strnatcmp' );\n\t\t\t// We can't use implode() here as it plays havoc with array keys with empty values.\n\t\t\t$count = count( $params );\n\t\t\t$string = '';\n\t\t\tforeach ( $params as $key => $value ) {\n\t\t\t\t$count--;\n\t\t\t\t$string .= $key . '=' . $value;\n\t\t\t\tif ( $count )\t{\n\t\t\t\t\t$string .= '&';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$base_string = $method . '&' . phpSmug::urlencodeRFC3986( $endpoint ) . '&' . phpSmug::urlencodeRFC3986( $string );\n\t\t\t$sig = base64_encode( hash_hmac( 'sha1', $base_string, $encKey, true ) );\n\t\t\treturn $sig;\n\t\t}\n\t }", "public function bluepay_void_payment($params)\n\t{\n\t\t$this->_api_method = 'VOID';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\t\n\t}", "public function signedCall(string $method, array $params = [], SessionInterface $session = null, $requestMethod = 'GET'): array;", "public function call() {\n\t\t$cart_order_id=$_GET['order_id'];\n\t\tif ($this->_module['sk_live']==$_GET['secret']) {\n\t\t\tif ($_GET['state']=='2') {\n\t\t\t\t$order = Order::getInstance();\n\t\t\t\t$order->orderStatus(Order::PAYMENT_DECLINE, $cart_order_id);\n\t\t\t\t$order->paymentStatus(Order::ORDER_CANCELLED, $cart_order_id);\n\t\t\t\t$TestNote = $this->CreateNote($cart_order_id ,\"Gateway Pingback expired.\");\n\t\t\t} else if ($_GET['state']=='5'){\n\t\t\t\t$order = Order::getInstance();\n\t\t\t\t$order->orderStatus(Order::ORDER_PROCESS, $cart_order_id);\n\t\t\t\t$order->paymentStatus(Order::PAYMENT_SUCCESS, $cart_order_id);\n\t\t\t\t$transData['notes']\t\t\t= implode(' ', $notes);\n\t\t\t\t$transData['order_id']\t\t= $cart_order_id;\n\t\t\t\t$transData['status']\t\t= \"Completed\";\n\t\t\t\t$transData['gateway']\t\t= 'Bitcoinz';\n\t\t\t\t$order->logTransaction($transData);\n\t\t\t\t$TestNote = $this->CreateNote($cart_order_id ,\"Gateway Pingback success.\");\n\t\t\t}\n\t\t}\n\t}", "function acapi_call($method, $resource, $args, $params = array(), $body = array(), $options = array()) {\n $default_options = array(\n 'display' => TRUE,\n );\n $options = array_merge($default_options, $options);\n\n $debug = drush_get_option('debug', FALSE);\n $verbose = drush_get_option('verbose', FALSE);\n $simulate = drush_get_option('simulate', FALSE);\n $format = acapi_get_option('format');\n\n // Build the API call URL.\n $url = acapi_get_option('endpoint');\n $url .= acapi_dt($resource, $args);\n $url .= '.json';\n\n foreach ($params as $k => $v) {\n if (is_array($v)) {\n unset($params[$k]);\n foreach ($v as $key => $val) {\n $params[\"$k-$key\"] = \"$k%5B%5D=\" . urlencode($val);\n }\n }\n else {\n $params[$k] = \"$k=\" . urlencode($v);\n }\n }\n\n $url .= '?' . implode('&', $params);\n\n $creds = acapi_get_creds();\n if (!$creds) {\n return FALSE;\n }\n\n // Build the body.\n $json_body = json_encode($body);\n\n $display = \"curl -X $method '$url'\";\n if ($debug) {\n $display .= \" ($creds)\";\n }\n if ($debug || $verbose || $simulate) {\n drush_print($display, 0, STDERR);\n if (!empty($body)) {\n drush_print(\" $json_body\", 0, STDERR);\n }\n }\n\n if ($simulate) {\n return;\n }\n\n $headers = array();\n $ch = curl_init($url);\n // Basic request settings\n curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);\n curl_setopt($ch, CURLOPT_USERAGENT, basename(__FILE__));\n if (!empty($options['result_stream'])) {\n curl_setopt($ch, CURLOPT_FILE, $options['result_stream']);\n }\n else {\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n }\n // User authentication\n curl_setopt($ch, CURLOPT_HTTPAUTH, TRUE);\n curl_setopt($ch, CURLOPT_USERPWD, $creds);\n // SSL\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, preg_match('@^https:@', acapi_get_option('endpoint')));\n curl_setopt($ch, CURLOPT_CAINFO, acapi_get_option('cainfo'));\n // Redirects\n if (!empty($options['redirect'])) {\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);\n curl_setopt($ch, CURLOPT_MAXREDIRS, $options['redirect']+1);\n }\n /* Body\n We need to set a Content-Length header even on empty POST requests, or the webserver\n will throw a 411 Length Required.\n */\n\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json_body);\n $headers[] = 'Content-Type: application/json;charset=utf-8';\n $headers[] = 'Content-Length: ' . strlen($json_body);\n // Headers\n if (!empty($headers)) {\n curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);\n }\n // Debugging\n curl_setopt($ch, CURLOPT_VERBOSE, $debug);\n // Go\n $content = curl_exec($ch);\n if (curl_errno($ch) > 0) {\n return drush_set_error('ACAPI_CURL_ERROR', dt('Error accessing @url: @err', array('@url' => $url, '@err' => curl_error($ch))));\n }\n\n $result = json_decode($content);\n $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);\n curl_close($ch);\n\n if (!empty($format)) {\n drush_print(drush_format($result, NULL, $format));\n }\n else if ($options['display']) {\n if (is_array($result)) {\n foreach ($result as $item) {\n if (! is_scalar($item)) {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($item)));\n }\n else {\n drush_print($item);\n }\n }\n }\n else {\n if ($method == 'POST') {\n // All POST actions return a task. Display something helpful.\n drush_log(dt('Task @taskid started.', array('@taskid' => $result->id)), 'ok');\n }\n else {\n drush_print_table(drush_key_value_to_array_table(acapi_convert_values($result)));\n }\n }\n }\n\n if ($status != 200) {\n return drush_set_error('ACAPI_HTTP_STATUS_' . $status, dt('API status code @status', array('@status' => $status)));\n }\n\n return array($status, $result);\n}", "function bankopen_link($params)\n{\n // Gateway Configuration Parameters\n\n\n $testMode = $params['testMode'];\n\n if($testMode)\n {\n $APIKey = $params['SandboxAPIKey'];\n $APISecret = $params['SandboxAPISecret'];\n $remote_script = \"https://sandbox-payments.open.money/layer\";\n $environment = 'test';\n\n }else{\n\n $APIKey = $params['LiveAPIKey'];\n $APISecret = $params['LiveAPISecret'];\n $remote_script = \"https://payments.open.money/layer\";\n $environment = 'production';\n\n }\n\n // Invoice Parameters\n $invoiceId = $params['invoiceid'];\n $description = $params[\"description\"];\n $amount = $params['amount'];\n $currencyCode = $params['currency'];\n\n // Client Parameters\n $firstname = $params['clientdetails']['firstname'];\n $lastname = $params['clientdetails']['lastname'];\n $email = $params['clientdetails']['email'];\n $address1 = $params['clientdetails']['address1'];\n $address2 = $params['clientdetails']['address2'];\n $city = $params['clientdetails']['city'];\n $state = $params['clientdetails']['state'];\n $postcode = $params['clientdetails']['postcode'];\n $country = $params['clientdetails']['country'];\n $phone = $params['clientdetails']['phonenumber'];\n\n // System Parameters\n $companyName = $params['companyname'];\n $systemUrl = $params['systemurl'];\n $returnUrl = $params['returnurl'];\n $langPayNow = $params['langpaynow'];\n $moduleDisplayName = $params['name'];\n $moduleName = $params['paymentmethod'];\n $whmcsVersion = $params['whmcsVersion'];\n\n $postfields = array();\n $postfields['username'] = $username;\n $postfields['invoice_id'] = $invoiceId;\n $postfields['description'] = $description;\n $postfields['amount'] = $amount;\n $postfields['currency'] = $currencyCode;\n $postfields['first_name'] = $firstname;\n $postfields['last_name'] = $lastname;\n $postfields['email'] = $email;\n $postfields['address1'] = $address1;\n $postfields['address2'] = $address2;\n $postfields['city'] = $city;\n $postfields['state'] = $state;\n $postfields['postcode'] = $postcode;\n $postfields['country'] = $country;\n $postfields['phone'] = $phone;\n $postfields['callback_url'] = $systemUrl . '/modules/gateways/callback/' . $moduleName . '.php';\n $postfields['return_url'] = $returnUrl;\n\n $LayeredJs = $systemUrl . 'modules/gateways/' . $moduleName.'/layer_checkout.js';\n $CallBackUrl = $systemUrl . 'modules/gateways/callback/' . $moduleName.'.php';\n\n $sample_data = [\n 'amount' => $amount,\n 'currency' => $currencyCode,\n 'name' => $firstname,\n 'email_id' => $email,\n 'contact_number' => $phone,\n 'mtx' => ''\n ];\n //main logic\n$error = '';\n$tranid = $invoiceId.'-'.date(\"ymd\").'-'.rand(1,100);\n\n$sample_data['mtx']=$tranid; //unique transaction id to be passed for each transaction \n$layer_api = new LayerApi($environment,$APIKey,$APISecret);\n$layer_payment_token_data = $layer_api->create_payment_token($sample_data);\n \nif(empty($error) && isset($layer_payment_token_data['error'])){\n\t$error = 'E55 Payment error. ' . ucfirst($layer_payment_token_data['error']); \n\tif(isset($layer_payment_token_data['error_data']))\n\t{\n\t\tforeach($layer_payment_token_data['error_data'] as $d)\n\t\t\t$error .= \" \".ucfirst($d[0]);\n\t}\n}\n\nif(empty($error) && (!isset($layer_payment_token_data[\"id\"]) || empty($layer_payment_token_data[\"id\"]))){\t\t\t\t\n $error = 'Payment error. ' . 'Layer token ID cannot be empty.'; \n} \n\nif(!empty($layer_payment_token_data[\"id\"]))\n $payment_token_data = $layer_api->get_payment_token($layer_payment_token_data[\"id\"]);\n \nif(empty($error) && !empty($payment_token_data)){\n if(isset($layer_payment_token_data['error'])){\n $error = 'E56 Payment error. ' . $payment_token_data['error']; \n }\n\n if(empty($error) && $payment_token_data['status'] == \"paid\"){\n $error = \"Layer: this order has already been paid.\"; \n }\n\n if(empty($error) && $payment_token_data['amount'] != $sample_data['amount']){\n $error = \"Layer: an amount mismatch occurred.\";\n }\n\n $jsdata['payment_token_id'] = html_entity_decode((string) $payment_token_data['id'],ENT_QUOTES,'UTF-8');\n $jsdata['accesskey'] = html_entity_decode((string) $APIKey,ENT_QUOTES,'UTF-8');\n \n\t$hash = create_hash(array(\n 'layer_pay_token_id' => $payment_token_data['id'],\n 'layer_order_amount' => $payment_token_data['amount'],\n 'tranid' => $tranid,\n ),$APIKey,$APISecret);\n\n $html = '<script src=\"'.$remote_script.'\"></script>';\n\n $responseUrl = \n \n $html .= '<form action=\"'.$CallBackUrl.'\" method=\"post\" style=\"display: none\" name=\"layer_payment_int_form\">\n\t\t<input type=\"hidden\" name=\"layer_pay_token_id\" value=\"'.$payment_token_data['id'].'\">\n <input type=\"hidden\" name=\"tranid\" value=\"'.$tranid.'\">\n <input type=\"hidden\" name=\"layer_order_amount\" value=\"'.$payment_token_data['amount'].'\">\n <input type=\"hidden\" id=\"layer_payment_id\" name=\"layer_payment_id\" value=\"\">\n <input type=\"hidden\" id=\"fallback_url\" name=\"fallback_url\" value=\"\">\n <input type=\"hidden\" id=\"x_invoice_id\" name=\"x_invoice_id\" value=\"'.$invoiceId.'\">\n <input type=\"hidden\" name=\"hash\" value=\"'.$hash.'\">\n </form>';\n $html .= \"<script>\";\n $html .= \"var layer_params = \" . json_encode( $jsdata ) . ';'; \n $html .=\"</script>\";\n\n $html .= '<script type=\"text/javascript\" src=\"'.$LayeredJs.'\"></script>';\n}\n\n\n if(!empty($error))\n {\n $htmlOutput .= $error;\n }\n\n if (isset($html)) {\n\n $htmlOutput .= '<button id=\"submit\" name=\"submit\" type=\"button\" class=\"btn btn-info\" onclick=\"triggerLayer();\">Pay Now</button>';\n\n $htmlOutput .= $html;\n \n }\n\n return $htmlOutput;\n}", "public function bluepay_authorize_payment($params)\n\t{\n\t\t$this->_api_method = 'AUTH';\n\t\t$this->_request = $this->_build_request($params);\t\t\t\n\t\treturn $this->_handle_query();\n\t}", "public function callback(){\n $data = Rave::verifyTransaction(request()->txref);\n dd($data); // view the data response\n if ($data->status == 'success') {\n if(session()->get($this->requestVar)['']['page_type'] == 'cart'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n } \n \n \n \n //Payment from basket checkout page\n \n if(session()->get($this->requestVar)['']['page_type'] == 'basket'){\n $cartCollection = Cart::getContent();\n $payer = new Payer();\n $payer->setPaymentMethod('flutterwave');\n \n $item_1 = new Item();\n \n $item_1->setName(__('messages.site_name')) \n ->setCurrency('USD')\n ->setQuantity(1)\n ->setPrice($request->get('total_price_pal')); \n \n $item_list = new ItemList();\n $item_list->setItems(array($item_1));\n \n $amount = new Amount();\n $amount->setCurrency('USD')\n ->setTotal($request->get('total_price_pal'));\n \n $transaction = new Transaction();\n $transaction->setAmount($amount)\n ->setItemList($item_list)\n ->setDescription('Your transaction description');\n \n $redirect_urls = new RedirectUrls();\n $redirect_urls->setReturnUrl(URL::route('status')) \n ->setCancelUrl(URL::route('status'));\n \n $payment = new Payment();\n $payment->setIntent('Sale')\n ->setPayer($payer)\n ->setRedirectUrls($redirect_urls)\n ->setTransactions(array($transaction));\n try {\n $payment->create($this->_api_context);\n } catch (\\PayPal\\Exception\\PPConnectionException $ex) {\n if (\\Config::get('app.debug')) {\n \\Session::put('error',__('successerr.connection_timeout'));\n return Redirect::route('paywithpaypal');\n \n } else {\n \\Session::put('error',__('successerr.error1'));\n return Redirect::route('paywithpaypal');\n \n }\n }\n \n foreach($payment->getLinks() as $link) {\n if($link->getRel() == 'approval_url') {\n $redirect_url = $link->getHref();\n $data=array();\n $finalresult=array();\n $result=array();\n $input = $request->input();\n $cartCollection = Cart::getContent();\n $setting=Setting::find(1);\n $gettimezone=$this->gettimezonename($setting->timezone);\n date_default_timezone_set($gettimezone);\n $date = date('d-m-Y H:i');\n $getuser=AppUser::find(Session::get('login_user'));\n $store=new Order();\n $store->user_id=$getuser->id;\n \n $store->total_price=number_format($request->get(\"total_price_pal\"), 2, '.', '');\n $store->order_placed_date=$date;\n $store->order_status=0;\n \n $store->latlong= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"lat_long_or\")));\n $store->name=$getuser->name;\n \n $store->address=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"address_pal\")));\n $store->email=$getuser->email;\n \n $store->payment_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"payment_type_pal\")));\n \n $store->notes=strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"note_or\")));\n \n $store->city= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"city_or\")));\n \n $store->shipping_type= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"shipping_type_pal\")));\n \n $store->subtotal=number_format($request->get(\"subtotal_pal\"), 2, '.', '');\n \n $store->delivery_charges=number_format($request->get(\"charage_pal\"), 2, '.', '');\n \n $store->phone_no= strip_tags(preg_replace('#<script(.*?)>(.*?)</script>#is', '',$request->get(\"phone_pal\")));\n $store->pay_pal_paymentId=$payment->getId();\n $store->delivery_mode=$store->shipping_type;\n $store->notify=1;\n $store->save();\n foreach ($cartCollection as $ke) {\n $getmenu=itemli::where(\"menu_name\",$ke->name)->first();\n $result['ItemId']=(string)isset($getmenu->id)?$getmenu->id:0;\n $result['ItemName']=(string)$ke->name;\n $result['ItemQty']=(string)$ke->quantity;\n $result['ItemAmt']=number_format($ke->price, 2, '.', '');\n $totalamount=(float)$ke->quantity*(float)$ke->price;\n $result['ItemTotalPrice']=number_format($totalamount, 2, '.', '');\n $ingredient=array();\n $inter_ids=array();\n foreach ($ke->attributes[0] as $val) {\n $ls=array();\n $inter=Ingredient::find($val);\n $ls['id']=(string)$inter->id;\n $inter_ids[]=$inter->id;\n $ls['category']=(string)$inter->category;\n $ls['item_name']=(string)$inter->item_name;\n $ls['type']=(string)$inter->type;\n $ls['price']=(string)$inter->price;\n $ls['menu_id']=(string)$inter->menu_id;\n $ingredient[]=$ls;\n }\n \n $result['Ingredients']=$ingredient;\n $finalresult[]=$result;\n $adddesc=new OrderResponse();\n $adddesc->set_order_id=$store->id;\n $adddesc->item_id=$result[\"ItemId\"];\n $adddesc->item_qty=$result[\"ItemQty\"];\n $adddesc->ItemTotalPrice=number_format($result[\"ItemTotalPrice\"], 2, '.', '');\n $adddesc->item_amt=$result[\"ItemAmt\"];\n $adddesc->ingredients_id=implode(\",\",$inter_ids);\n $adddesc->save();\n }\n $data=array(\"Order\"=>$finalresult);\n $addresponse=new FoodOrder();\n $addresponse->order_id=$store->id;\n $addresponse->desc=json_encode($data);\n $addresponse->save();\n \n break;\n }\n }\n \n \n }\n \n }\n }", "function MyFatoorah($api, $userData)\n{\n // dd($userData);\n $token = $api;\n $basURL = \"https://apitest.myfatoorah.com\";\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_URL => \"$basURL/v2/ExecutePayment\",\n CURLOPT_CUSTOMREQUEST => \"POST\",\n CURLOPT_POSTFIELDS => $userData,\n CURLOPT_HTTPHEADER => array(\"Authorization: Bearer $token\", \"Content-Type: application/json\"),\n ));\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);\n $response = curl_exec($curl);\n $err = curl_error($curl);\n curl_close($curl);\n if ($err) {\n return $err;\n } else {\n return $response;\n }\n}", "public function sign()\n {\n }", "function pay_fields() {\n\t\t// define(APPKEY ,\"2Wozy2aksie1puXUBpWD8oZxiD1DfQuEaiC7KcRATv1Ino3mdopKaPGQQ7TtkNySuAmCaDCrw4xhPY5qKTBl7Fzm0RgR3c0WaVYIXZARsxzHV2x7iwPPzOz94dnwPWSn\"); //paysign key\n\t\t// define(SIGNTYPE, \"sha1\"); //method\n\t\t// define(PARTNERKEY,\"8934e7d15453e97507ef794cf7b0519d\");//通加密串\n\t\t// define(APPSERCERT, \"09cb46090e586c724d52f7ec9e60c9f8\");\n\t\treturn array (\n\t\t\t\t'APPID' => array (\n\t\t\t\t\t\t'title' => 'APPID:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '微信公众号身份的唯一标识。审核通过后,在微信发送的邮件中查看' \n\t\t\t\t),\n\t\t\t\t'MCHID' => array (\n\t\t\t\t\t\t'title' => 'MCHID:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '受理商ID,身份标识' \n\t\t\t\t),\n\t\t\t\t'KEY' => array (\n\t\t\t\t\t\t'title' => 'KEY:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '商户支付密钥Key。审核通过后,在微信发送的邮件中查看' \n\t\t\t\t),\n\t\t\t\t'APPSECRET' => array (\n\t\t\t\t\t\t'title' => 'APPSECRET:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => 'JSAPI接口中获取openid,审核后在公众平台开启开发模式后可查看' \n\t\t\t\t),\n\t\t\t\t'NOTIFY_URL' => array (\n\t\t\t\t\t\t'title' => 'NOTIFY_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '异步通知url,商户根据实际开发过程设定' \n\t\t\t\t),\n\t\t\t\t'JS_API_CALL_URL' => array (\n\t\t\t\t\t\t'title' => 'JS_API_CALL_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '获取access_token过程中的跳转uri,通过跳转将code传入jsapi支付页面' \n\t\t\t\t),\n\t\t\t\t'WEIXIN_PAY_UNIT' => array (\n\t\t\t\t\t\t'title' => 'WEIXIN_PAY_UNIT:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '微信支付单位,100为元 ,10为角,1为分' \n\t\t\t\t),\n\t\t\t\t'SUCCESS_URL' => array (\n\t\t\t\t\t\t'title' => 'SUCCESS_URL:',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'value' => '',\n\t\t\t\t\t\t'tip' => '支付成功跳转页面' \n\t\t\t\t),\n\t\t);\n\t}", "function submit() {\n\n require_once(dirname(__FILE__) . \"/paycoingateway-php/paycoingateway.php\");\n\n $api_key = get_option(\"paycoingateway_wpe_api_key\");\n $api_secret = get_option(\"paycoingateway_wpe_api_secret\");\n $paycoingateway = PaycoinGateway::withApiKey($api_key, $api_secret);\n\n $callback_secret = get_option(\"paycoingateway_wpe_callbacksecret\");\n if($callback_secret == false) {\n $callback_secret = sha1(openssl_random_pseudo_bytes(20));\n update_option(\"paycoingateway_wpe_callbacksecret\", $callback_secret);\n }\n $callback_url = $this->cart_data['notification_url'];\n $callback_url = add_query_arg('gateway', 'wpsc_merchant_paycoingateway', $callback_url);\n $callback_url = add_query_arg('callback_secret', $callback_secret, $callback_url);\n\n $return_url = add_query_arg( 'sessionid', $this->cart_data['session_id'], $this->cart_data['transaction_results_url'] );\n $return_url = add_query_arg( 'wpsc_paycoingateway_return', true, $return_url );\n $cancel_url = add_query_arg( 'cancelled', true, $return_url );\n\n $params = array (\n 'name' => 'Your Order',\n 'price_string' => $this->cart_data['total_price'],\n 'price_currency_iso' => $this->cart_data['store_currency'],\n 'callback_url' => $callback_url,\n 'custom' => $this->cart_data['session_id'],\n 'success_url' => $return_url,\n 'cancel_url' => $cancel_url\n );\n\n try {\n $code = $paycoingateway->createButtonWithOptions($params)->button->code;\n } catch (Exception $e) {\n $msg = $e->getMessage();\n error_log (\"There was an error creating a PaycoinGateway checkout page: $msg. Make sure you've connected a merchant account in paycoingateway settings.\");\n exit();\n }\n\n wp_redirect(\"https://www.paycoingateway.com/checkouts/$code\");\n exit();\n\n }", "public function verify() {\n\t\t$this->getBasics();\n\t\t$this->getParams();\n\t\t$this->getLanguage();\n\n\t\t$this->load->model( 'checkout/order' );\n\t\t$this->load->library( 'encryption' );\n\n\t\t$encryption = new Encryption( $this->config->get( 'config_encryption' ) );\n\n\t\t$forbidden\t\t\t= array( 'route', 'hash', 'email_sender', 'email_recipient' );\n\t\t$retData\t\t\t= array();\n\t\t$securityCriteria\t= 0; // integer!\n\t\t$project_id\t\t\t= '0';\n\t\t$err\t\t\t\t= false;\n\n\t\t// filter variables\n\t\tforeach( $this->request->post as $key => $value) {\n\t\t\tif( !in_array( $key, $forbidden ) ) {\n\t\t\t\t$retData[$key] = html_entity_decode( $value, ENT_QUOTES, 'UTF-8' );\n\t\t\t}\n\n\t\t\t// get value of security_criteria\n\t\t\tif( $key == 'security_criteria' ) {\n\t\t\t\t$securityCriteria = $value;\n\t\t\t}\n\n\t\t\t// decrypt order_id\n\t\t\tif( $key == 'user_variable_3' ) {\n\t\t\t\t$order_id = $encryption->decrypt( $value );\n\t\t\t}\n\n\t\t\t// get hash value\n\t\t\tif( $key == 'hash' ) {\n\t\t\t\t$this->hashValue = $value;\n\t\t\t}\n\n\t\t\t// get project id\n\t\t\tif( $key == 'project_id' ) {\n\t\t\t\t$project_id = $value;\n\t\t\t}\n\t\t}\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo '## FUNCTION verify' . \"\\n\";\n\t\t\techo '## calling getNotifyHash:' . \"\\n\";\n\t\t}\n\n\t\t// calculate hash value\n\t\t$hash = $this->getNotifyHash( $retData );\n\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo \"\\n\" . '## $_POST data from directebanking:' . \"\\n\";\n\t\t\tprint_r( $_POST ) . \"\\n\";\n\t\t\techo 'retData (cleaned POST for calculating hash):' . \"\\n\";\n\t\t\tprint_r( $retData );\n\t\t\techo \"\\n\";\n\n\t\t\techo '--> submitted hash [' . $this->hashValue . ']' . \"\\n\";\n\t\t\techo '--> calculated hash [' . $hash . ']' . \"\\n\";\n\t\t\techo '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']' . \"\\n\";\n\n\t\t\t// write also log entry\n\t\t\t$msg = '## $_POST data from directebanking:<br />'\n\t\t\t. print_r( $_POST, true )\n\t\t\t. '<br />retData (cleaned POST for calculating hash):<br />'\n\t\t\t. print_r( $retData, true )\n\t\t\t. '<br />--> submitted hash [' . $this->hashValue . ']<br />'\n\t\t\t. '--> calculated hash [' . $hash . ']<br />'\n\t\t\t. '--> securityCriteria [' . ( $securityCriteria ? 'true' : 'false' ) . ']<br />'\n\t\t\t. '~~~~~~~~~~~~~~~~~~~~~~';\n\n\t\t\t$this->writeLog( $msg );\n\t\t}\n\n\t\t$comment = $this->_param['testMode'] ? $this->language->get( 'text_testOrder') : '';\n\n\t\t// check generated and submitted hash values\n\t\tif( $hash === $this->hashValue ) {\n\t\t\tif( $securityCriteria == 1 && $order_id ) {\n\t\t\t\t// order is okay, set order to predefined directebanking status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'directebanking_order_status_id'),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_okay'), $project_id );\n\t\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_valid'), $project_id, $order_id );\n\t\t\t\t$type\t= 2;\n\t\t\t}else{\n\t\t\t\t// order is not okay, set order to predefined config status\n\t\t\t\t$this->model_checkout_order->confirm(\n\t\t\t\t\t$order_id,\n\t\t\t\t\t$this->config->get( 'config_order_status_id' ),\n\t\t\t\t\t$comment\n\t\t\t\t);\n\n\t\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_security_invalid'), $project_id, $order_id );\n\t\t\t\t$msg\t= $msgDb;\n\t\t\t\t$type\t= 3;\n\t\t\t}\n\t\t}else{\n\t\t\t// order is not okay, set order to predefined config status\n\t\t\t$this->model_checkout_order->confirm( $order_id, $this->config->get( 'config_order_status_id' ), $comment );\n\n\t\t\t$msgDb\t= sprintf( $this->language->get( 'text_log_hash_notokay'), $project_id );\n\t\t\t$msg\t= sprintf( $this->language->get( 'text_log_hash_dif'), $project_id, $order_id );\n\t\t\t$type\t= 3;\n\t\t}\n\n\t\t// write log\n\t\t$this->writeLog( $msg, $type );\n\t\t// echo message at directebanking\n\t\tif( $this->_debug == 1 ) {\n\t\t\techo $msgDb . \"\\n\";\n\t\t}\n\t}", "public function handleGatewayCallback()\n {\n $paymentDetails = Paystack::getPaymentData();\n\n//dd($paymentDetails);\n //dd($paymentDetails['data']['metadata']['Amount']);\n // dd($paymentDetails['data']['customer']['email']);\n // Now you have the payment details,\n // you can store the authorization_code in your db to allow for recurrent subscriptions\n // you can then redirect or do whatever you want\n$amount=$paymentDetails['data']['metadata']['Amount'];\n$satus=$paymentDetails['data']['status'];\n$reference=$paymentDetails['data']['reference'];\n$gateway_response=$paymentDetails['data']['gateway_response'];\n$useremail=$paymentDetails['data']['customer']['email'];\n$check=$paymentDetails['data']['metadata']['fod'];\n\n\n//dd($check);\n\n if($check!==\"food\"){\n\n $number=$paymentDetails['data']['metadata']['phone'];\n $email=$useremail;\n $name=$paymentDetails['data']['metadata']['name'];\n $rand=rand(100,9999);\n\n $getid2=Tickets::where('email', $useremail)->first();\n $getid12=User_tickets::where('user_id', $getid2->user_id)->first();\n\n\n DB::table('user_tickets')\n ->where('user_id', $getid2->user_id)\n ->update([\n 'amount' =>$amount,\n 'payment_status' => $satus\n ]);\n DB::table('tickets')\n ->where('user_id', $getid2->user_id)\n ->update([\n 'ticket_id' => $getid12->id\n ]);\n\n // $rand=rand(100,9999);\n $qrCode=\\QrCode::size(500)\n ->format('png')\n ->generate($number.'_'.$rand, public_path('qrcode/'.$rand.'_qrcode.png'));\n $img =public_path().'/qrcode/'.$rand.'_qrcode.png';\n //dd($img);\n // $message = \"hello '.$name.' '.$email.' '.$number.' your pick up token is '.$qrCode.' \";\n\n //send token via email\n\n $data = array('orderID'=>$getid2->user_id,'images'=>$img,'number'=>$number,'ran'=>$rand, 'email' => $email,'fname' => $name,'app_name' => config('app.name'), 'from' => '[email protected]', 'from_name' => 'afrochella');\n Mail::send( 'mails.member_token', $data, function($message) use ($data)\n {\n $message->to( $data['email'] )->from( $data['from'], $data['fname'] )->subject( 'Welcome!' );\n\n });\n\n }else {\n $order_id=$paymentDetails['data']['metadata']['order_id'];\n $number=$paymentDetails['data']['metadata']['phone'];\n $email=$useremail;\n $name=$paymentDetails['data']['metadata']['name'];\n $rand=rand(100,9999);\n\n DB::table('foods')\n ->where('order_id', $order_id)\n ->update([\n 'amount' =>$amount,\n 'payment_status' => $satus\n ]);\n\n // $rand=rand(100,9999);\n $qrCode=\\QrCode::size(500)\n ->format('png')\n ->generate($number.'_'.$rand, public_path('qrcode/'.$rand.'_qrcode.png'));\n $img =public_path().'/qrcode/'.$rand.'_qrcode.png';\n //dd($img);\n // $message = \"hello $name.''.$email.' '.$number.' your pick up token is '.$qrCode.' \";\n\n //send token via email\n $data = array('orderID'=>$order_id,'images'=>$img,'number'=>$number,'ran'=>$rand, 'email' => $email,'fname' => $name,'app_name' => config('app.name'), 'from' => '[email protected]', 'from_name' => 'afrochella');\n\n Mail::send( 'mails.member_token', $data, function($message) use ($data)\n {\n $message->to( $data['email'] )->from( $data['from'], $data['fname'] )->subject( 'Welcome!' );\n\n });\n\n }\n\n\n\n\n\n\n return view('pages.tickets.qrCode')->with('ran',$rand);\n }", "public function buy(){\n\n $id=89025555; //id di connessione\n $password=\"test\"; //password di connessione\n\n //è necessario foramttare il totale in NNNNNN.NN\n $importo= number_format(StadiumCart::total(),2,'.','');//importo da pagare\n\n $trackid=\"STDRX\".time(); //id transazione\n\n $urlpositivo=\"http://stadium.reexon.net/cart/receipt\";\n $urlnegativo=\"http://stadium.reexon.net/cart/error\";\n $codicemoneta=\"978\"; //euro\n //prelevo i dati inseriti durante la fase acquisto\n $user = (object)Session::get('user');\n\n $data=\"id=$id\n &password=$password\n &action=4\n &langid=ITA\n &currencycode=$codicemoneta\n &amt=$importo\n &responseURL=$urlpositivo\n &errorURL=$urlnegativo\n &trackid=$trackid\n &udf1=\".$user->email.\"\n &udf2=\".$user->mobile.\"\n &udf3=\".$user->firstname.\"\n &udf4=\".$user->lastname.\"\n &udf5=EE\";\n $curl_handle=curl_init();\n //curl_setopt($curl_handle,CURLOPT_URL,'https://www.constriv.com:443/cg/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle,CURLOPT_URL,'https://test4.constriv.com/cg301/servlet/PaymentInitHTTPServlet');\n curl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n curl_setopt($curl_handle,CURLOPT_CONNECTTIMEOUT,5);\n curl_setopt($curl_handle,CURLOPT_RETURNTRANSFER,1);\n curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($curl_handle, CURLOPT_POST, 1);\n curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $data);\n $buffer = curl_exec($curl_handle);\n\n if (empty($buffer))\n {\n return curl_error($curl_handle);\n }\n else\n {\n //print $buffer;\n $url=explode(\":\",$buffer);\n $transaction_id=$url[0];\n curl_close($curl_handle);\n //prepara il link per il pagamento\n if(strlen($transaction_id)>0){\n $redirectURL = $url[1].\":\".$url[2].\"?PaymentID=$transaction_id\";\n echo \"<meta http-equiv=\\\"refresh\\\" content=\\\"0;URL=$redirectURL\\\">\";\n }\n }\n\n }", "function revSPORTapiRequest(string $api, string $endpoint, int $id = null, array $parameters = [])\n{\n date_default_timezone_set('Australia/Sydney');\n\n //Replace these with\n //revdemoclub\n $apiKey = '';\n $secretKey = '';\n $method = 'GET';\n //$url = 'https://lz-1.revolutionise.com.au/' . $api . '/' . $endpoint . '/';\n $url = 'https://lz-1-staging.revolutionise.com.au/' . $api . '/' . $endpoint . '/';\n //$url = 'https://lz-1.rev.local/' . $api . '/' . $endpoint . '/';\n\n if (empty($id) === false)\n {\n $url .= $id;\n }\n\n $now = time();\n $date = date('d M Y H:i:s', $now);\n $URLFriendlyDate = str_replace(' ', '', $date);\n $nonce = rand(100000, 999999); // generated randomly\n\n // Build the digest to send\n $digest = base64_encode(hash_hmac('sha256', $method . \"+/\" . $endpoint . \"/\" . (empty($id) ? '' : $id) . \"+$URLFriendlyDate+$nonce\", $secretKey));\n $x = array(\n 'api_key' => $apiKey,\n 'date' => $date,\n 'nonce' => $nonce,\n 'digest' => $digest\n );\n\n $postfields = array_merge($x, $parameters);\n\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); //make sure it returns a response\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); // allow https verification if true\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // allow https verification if true\n curl_setopt($ch, CURLOPT_POST, true); //tell it we are posting\n curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query_for_curl($postfields)); //tell it what to post\n //curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: application/json')); //response comes back as json\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: multipart/form-data')); //response comes back as json\n $response = curl_exec($ch);\n\n\n // Check if any error occurred\n if (!curl_errno($ch))\n {\n $info = curl_getinfo($ch);\n }\n // Close handle\n curl_close($ch);\n\n //$response = json_decode($response, true);\n\n return $response;\n}", "public function checkOut($params = array())\r\n {\r\n $actionType = $params['actionType'];;\r\n $cancelUrl = $params['cancelUrl'];//\"http://localhost\"; \r\n $returnUrl = $params['returnUrl']; \r\n $startingDate = \"\"; \r\n \r\n $currencyCode = $params['currencyCode'];\r\n $receiverEmailArray = array();\r\n $receiverAmountArray = array();\r\n $receiverInvoiceIdArray = array();\r\n foreach($params['receivers'] as $rc)\r\n {\r\n $receiverEmailArray[] = $rc['email'];\r\n $receiverAmountArray[] = $rc['amount'];\r\n $receiverInvoiceIdArray[] = $rc['invoice'];\r\n }\r\n \r\n $receiverPrimaryArray = array();\r\n $senderEmail = $params['sender']; \r\n /**\r\n * feesPayer value {SENDER, PRIMARYRECEIVER, EACHRECEIVER}\r\n * \r\n * @var mixed\r\n */\r\n $feesPayer = $params['feesPayer']; \r\n $ipnNotificationUrl = $params['ipnNotificationUrl'];\r\n $memo = $params['memo']; \r\n $pin = $params['pin']; \r\n $preapprovalKey = $params['preapprovalKey'];\r\n //echo $preapprovalKey;\r\n $reverseAllParallelPaymentsOnError = $params['reverseAllParallelPaymentsOnError']; \r\n $trackingId = $this->generateTrackingID(); \r\n $resArray = $this->CallPay ($actionType, $cancelUrl, $returnUrl, $currencyCode, $receiverEmailArray,\r\n $receiverAmountArray, $receiverPrimaryArray, $receiverInvoiceIdArray,\r\n $feesPayer, $ipnNotificationUrl, $memo, $pin, $preapprovalKey,\r\n $reverseAllParallelPaymentsOnError, $senderEmail, $trackingId,$startingDate\r\n );\r\n \r\n\r\n \r\n $ack = strtoupper($resArray[\"responseEnvelope.ack\"]);\r\n \r\n if($ack==\"SUCCESS\")\r\n {\r\n if (\"\" == $preapprovalKey)\r\n {\r\n // redirect for web approval flow\r\n $cmd = \"cmd=_ap-payment&paykey=\" . urldecode($resArray[\"payKey\"]);\r\n //$cmd = \"cmd=_notify-validate&paykey=\" . urldecode($resArray[\"payKey\"]);\r\n \r\n $this->Redirect($cmd);\r\n }\r\n else\r\n {\r\n \r\n // payKey is the key that you can use to identify the result from this Pay call\r\n $payKey = urldecode($resArray[\"payKey\"]);\r\n // paymentExecStatus is the status of the payment\r\n $paymentExecStatus = urldecode($resArray[\"paymentExecStatus\"]);\r\n } \r\n \r\n }\r\n else\r\n {\r\n $ErrorCode = urldecode($resArray[\"error(0).errorId\"]);\r\n $ErrorMsg = urldecode($resArray[\"error(0).message\"]);\r\n $ErrorDomain = urldecode($resArray[\"error(0).domain\"]);\r\n $ErrorSeverity = urldecode($resArray[\"error(0).severity\"]);\r\n $ErrorCategory = urldecode($resArray[\"error(0).category\"]);\r\n $this->errors = $ErrorCode.':'.$ErrorMsg.' '.$ErrorDomain.' '.$ErrorSeverity.' '.$ErrorCategory;\r\n $this->logging('checkOut Error : '. $this->errors); \r\n return false;\r\n } \r\n \r\n }", "function check_signature(){\n $nonce = $_GET['nonce'];\n $token = 'hello';\n $timestamp = $_GET['timestamp'];\n $signature = $_GET['signature'];\n $echostr = $_GET['echostr'];\n $arr = array($nonce,$token,$timestamp);\n sort($arr);\n $str = sha1(implode($arr));\n if($str == $signature && $echostr){\n echo $echostr;\n }else{\n response();\n }\n}", "function sample(){\n\t\t$price = 10;\n\t\t$tax = number_format($price * .095,2); // Set tax\n\t\t$amount = number_format($price + $tax,2); // Set total amount\n\n\n \t$this->authorizenet->setFields(\n\t\tarray(\n\t\t'amount' => '10.00',\n\t\t'card_num' => '370000000000002',\n\t\t'exp_date' => '04/17',\n\t\t'first_name' => 'James',\n\t\t'last_name' => 'Angub',\n\t\t'address' => '123 Main Street',\n\t\t'city' => 'Boston',\n\t\t'state' => 'MA',\n\t\t'country' => 'USA',\n\t\t'zip' => '02142',\n\t\t'email' => '[email protected]',\n\t\t'card_code' => '782',\n\t\t)\n\t\t);\n\t\t$response = $this->authorizenet->authorizeAndCapture();\n\n\t\t/*print_r($response);*/\n\n\t\tif ($response->approved) {\n\t\techo \"approved\";\n /*echo \"APPROVED\";*/\n\t\t} else {\n echo FALSE;\n\t\t/*echo \"DENIED \".AUTHORIZENET_API_LOGIN_ID.\" \".AUTHORIZENET_TRANSACTION_KEY;*/\n\t\t}\n\n }", "function create_payment( $access_token, $c_transactions ) {\n\n global $host;\n\n $postdata = get_json_payment( $c_transactions );\n\n $url = $host.'/v1/payments/payment';\n $curl = curl_init($url);\n curl_setopt($curl, CURLOPT_POST, true); // TRUE to do a regular HTTP POST.\n curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // FALSE to stop cURL from verifying the peer's certificate.\n curl_setopt($curl, CURLOPT_HEADER, false); // TRUE to include the header in the output.\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); // TRUE to return the transfer as a string of the return value of curl_exec() instead of outputting it out directly.\n curl_setopt($curl, CURLOPT_HTTPHEADER, array(\n 'Authorization: Bearer '.$access_token,\n 'Accept: application/json',\n 'Content-Type: application/json'\n )); // An array of HTTP header fields to set, in the format array('Content-type: text/plain', 'Content-length: 100')\n curl_setopt($curl, CURLOPT_POSTFIELDS, $postdata);\n #curl_setopt($curl, CURLOPT_VERBOSE, TRUE);\n\n $response = curl_exec( $curl );\n\n if (empty($response)) {\n // Some kind of an error happened\n die(curl_error($curl));\n curl_close($curl);\n } else {\n\n $info = curl_getinfo($curl);\n curl_close($curl); // close cURL handler\n \n if($info['http_code'] != 200 && $info['http_code'] != 201 ) {\n echo \"Received error: \" . $info['http_code']. \"\\n\";\n echo \"Raw response:\".$response.\"\\n\";\n die();\n }\n\n }\n\n // Convert the result from JSON format to a PHP array\n $jsonResponse = json_decode($response, TRUE);\n return $jsonResponse;\n\n}", "public function paypal_payouts($data=false)\n {\n global $environment;\n $paypal_credentials = PaymentGateway::where('site','PayPal')->get();\n $api_user = $paypal_credentials[1]->value;\n $api_pwd = $paypal_credentials[2]->value;\n $api_key = $paypal_credentials[3]->value;\n $paymode = $paypal_credentials[4]->value;\n \n $client = $paypal_credentials[6]->value;\n $secret = $paypal_credentials[7]->value;\n \n if($paymode == 'sandbox')\n $environment = 'sandbox';\n else\n $environment = '';\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/oauth2/token\");\n curl_setopt($ch, CURLOPT_HEADER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); \n curl_setopt($ch, CURLOPT_USERPWD, $client.\":\".$secret);\n curl_setopt($ch, CURLOPT_POSTFIELDS, \"grant_type=client_credentials\");\n\n $result = curl_exec($ch);\n $json = json_decode($result);\n if(!isset($json->error))\n {\n curl_setopt($ch, CURLOPT_FRESH_CONNECT, TRUE);\n curl_setopt($ch, CURLOPT_URL, \"https://api.$environment.paypal.com/v1/payments/payouts?sync_mode=true\");\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data); \n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\",\"Authorization: Bearer \".$json->access_token,\"\"));\n\n $result = curl_exec($ch);\n\n if(empty($result))\n {\n $json =\"error\";\n }\n else\n {\n $json = json_decode($result);\n }\n curl_close($ch);\n \n }\n else\n {\n $json =\"error\";\n \n }\n\n $payout_response = $json;\n $data = array();\n\n if($payout_response != \"error\") {\n if($payout_response->batch_header->batch_status==\"SUCCESS\") {\n if($payout_response->items[0]->transaction_status == 'SUCCESS') {\n $correlation_id = $payout_response->items[0]->transaction_id;\n $data['success'] = true;\n $data['transaction_id'] = $correlation_id;\n } \n else {\n $data['success'] = false;\n $data['message'] = $payout_response->items[0]->errors->name;\n }\n \n }\n else {\n $data['success'] = false;\n $data['message'] = $payout_response->name;\n }\n }\n else {\n $data['success'] = false;\n $data['message'] = 'Unknown error';\n }\n\n return $data;\n }", "public function actionCallback() {\n\n $request = Yii::$app->request->get();\n\n $booking_id = $request['trackid'];\n\n $booking = Booking::findOne($booking_id);\n\n if(!$booking) {\n throw new \\yii\\web\\NotFoundHttpException('The requested page does not exist.');\n }\n\n $error = '';\n \n $key = $this->tap_merchantid;\n $refid = $request['ref'];\n \n $str = 'x_account_id'.$key.'x_ref'.$refid.'x_resultSUCCESSx_referenceid'.$booking_id.'';\n $hashstring = hash_hmac('sha256', $str, $this->tap_api_key);//'1tap7'\n $responsehashstring = $request['hash'];\n \n if ($hashstring != $responsehashstring) {\n $error = Yii::t('api', 'Unable to locate or update your booking status');\n } else if ($request['result'] != 'SUCCESS') {\n $error = Yii::t('api', 'Payment was declined by Tap');\n }\n \n if ($error) \n {\n return $this->redirect(['error']); \n } \n else \n { \n //gateway info \n $gateway = PaymentGateway::find()->where(['code' => 'tap', 'status' => 1])->one();\n\n if($request['crdtype'] == 'KNET') {\n $booking->payment_method = 'Tap - Paid with KNET';\n $booking->gateway_fees = $gateway->fees;\n $booking->gateway_percentage = 0;\n $booking->gateway_total = $gateway->fees;//fixed price fee \n } else {\n $booking->payment_method = 'Tap - Paid with Creditcard/Debitcard';\n $booking->gateway_fees = 0;\n $booking->gateway_percentage = $gateway->percentage;\n $booking->gateway_total = $gateway->percentage * ($booking->total_with_delivery / 100);\n }\n\n //update status \n $booking->transaction_id = $request['ref'];\n $booking->save(false);\n\n //add payment to vendor wallet \n Booking::addPayment($booking);\n \n //send order emails\n Booking::sendBookingPaidEmails($booking_id);\n\n //redirect to order success \n return $this->redirect(['success']); \n }\n }", "abstract public function build_signature($request, $consumer, $token);", "abstract public function build_signature($request, $consumer, $token);", "public function index(){\n\n $token_is = $_POST['accessToken'];\n $paymentIDis = $_POST['paymentId'];\n $token_is;\n $paymentIDis;\n $executeURL= \"https://checkout.sandbox.bka.sh/v1.2.0-beta/checkout/payment/execute/\";\n $proxy = \"1vggbqd4hqk9g96o9rrrp2jftvek578v7d2bnerim12a87dbrrka\";\n //echo $proxy;\n $url22 = curl_init($executeURL.$paymentIDis);\n\n $header=array(\n 'Content-Type:application/json',\n 'authorization:'.$token_is, \n 'x-app-key:5tunt4masn6pv2hnvte1sb5n3j' \n ); \n \n curl_setopt($url22,CURLOPT_HTTPHEADER, $header);\n curl_setopt($url22, CURLOPT_TIMEOUT, 30);\n curl_setopt($url22, CURLOPT_CONNECTTIMEOUT, 30);\n curl_setopt($url22, CURLOPT_POST, 1 );\n curl_setopt($url22,CURLOPT_CUSTOMREQUEST, \"POST\");\n curl_setopt($url22,CURLOPT_RETURNTRANSFER, true);\n curl_setopt($url22, CURLOPT_VERBOSE, true);\n curl_setopt($url22,CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($url22, CURLOPT_SSL_VERIFYPEER, true); # KEEP IT FALSE IF YOU RUN FROM LOCAL PC\n // curl_setopt($url22, CURLOPT_PROXY, $proxy);\n\n $resultdatax=curl_exec($url22);\n\n\n $code = curl_getinfo($url22, CURLINFO_HTTP_CODE);\n $info = curl_getinfo($url22);\n var_dump($info);\n\n\n curl_close($url22);\n $data2 = json_decode($resultdatax);\n // print_r($code);\n \n\n }", "public function return_url(Request $request){\n\t\t // Get the payment ID before session clear\n //echo 'pppp'.$payment_id = Session::get('paypal_payment_id');\n\t\t//echo '<br><pre>'; print_r($request['PayerID']); echo '</pre>'; die;\n // clear the session payment ID\n //Session::forget('paypal_payment_id');\n\n\t\tif (empty($request['PayerID']) || empty($request['token'])) {\n\t\t\treturn redirect('service/payment/status')->with('error', 'Payment failed');\n }\n\t\t$payment_id = $request['paymentId'];\n\t\t$payment = Payment::get($payment_id, $this->_api_context);\n\t\t// PaymentExecution object includes information necessary\n // to execute a PayPal account payment.\n // The payer_id is added to the request query parameters\n // when the user is redirected from paypal back to your site\n\t\t$execution = new PaymentExecution();\n $execution->setPayerId($request['PayerID']);\n //Execute the payment\n $result = $payment->execute($execution, $this->_api_context);\n //echo '<pre>';print_r($result);echo '</pre>';exit; // DEBUG RESULT, remove it later\n if ($result->getState() == 'approved') { // payment made\n //update database\n\t\t\t$user=Auth::user();\n\t\t\t$user_id=$user->id;\n\t\t\t$service_id=$request['service_id'];\n\t\t\t$service=Service::find($service_id,['name','price']);\n\t\t\t$user_order_data=[\n\t\t\t\t\t\t\t'user_id'=>$user_id,\n\t\t\t\t\t\t\t'item_id'=>$service_id,\n\t\t\t\t\t\t\t'item_name'=>$service->name,\n\t\t\t\t\t\t\t'item_type'=>'service',\n\t\t\t\t\t\t\t'item_amount'=> $service->price,\n\t\t\t\t\t\t\t'approved'=>1\n\t\t\t\t\t\t\t];\n\t\t\t$order_obj=Order::create($user_order_data);\n\t\t\t$order_id=$order_obj->id;\n\t\t\t$transaction_data=[\n\t\t\t\t\t\t\t 'order_id'=>$order_id,\n\t\t\t\t\t\t\t 'transaction_id'=>$result->getId(),\n\t\t\t\t\t\t\t 'amount'=>$service->price,\n\t\t\t\t\t\t\t 'transaction_type'=>'credit',\n\t\t\t\t\t\t\t 'payment_gateway_id' => 1,\n\t\t\t\t\t\t\t 'payment_method_id' => 2,\n\t\t\t\t\t\t\t 'order_status'=>1\n\t\t\t\t\t\t\t ];\n\t\t\tOrderTransaction::create($transaction_data);\n\t\t\t// forget the session of the service used to get service info for payment\n\t\t\tSession::forget('payment_service_id');\n\t\t\treturn redirect('service/payment/status')->with('success', 'Payment has been completed successfully!');\n }\n\n\t}", "public function setCurlCall($data, $address, $method = 'POST'){\n\n $apiUrl=Mage::getStoreConfig('paynovapayment/settings/api_live_url');\n $apiTest=Mage::getStoreConfig('paynovapayment/settings/api_test_url');\n $apiMode=Mage::getStoreConfig('paynovapayment/settings/api_mode');\n $password=Mage::helper('core')->decrypt(Mage::getStoreConfig('paynovapayment/settings/password'));\n $username=Mage::getStoreConfig('paynovapayment/settings/merchant_id');\n\n $paynova_url = $apiUrl;\n if($apiMode!='1') {\n $paynova_url = $apiTest;\n }\n\n //check if https:// or http:// exist in URL.\n $prot_sec = \"https://\";\n $prot_uns = \"http://\";\n\n $pos = stripos($paynova_url, $prot_sec);\n if ($pos === false) {\n $pos = stripos($paynova_url, $prot_uns);\n if ($pos === false) {\n $paynova_url = $prot_sec.$paynova_url;\n } else if ($pos>0){\n $paynova_url = $prot_sec.$paynova_url;\n }\n } else if ($pos>0){\n $paynova_url = $prot_sec.$paynova_url;\n }\n\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, \"$paynova_url$address\");\n curl_setopt($ch, CURLOPT_USERPWD, \"$username:$password\");\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n if($method == 'POST') {\n curl_setopt($ch, CURLOPT_POST, 1);\n if ($data) {\n $data = json_encode($data);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n }\n\n }\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); //\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n $output = curl_exec($ch);\n curl_close($ch);\n\n Mage::helper('paynovapayment')->log(\"Curl call to: \".$paynova_url.$address);\n Mage::helper('paynovapayment')->log($data);\n if ($address !=\"/paymentoptions/\") {\n Mage::helper('paynovapayment')->log(json_decode($output));\n }\n return json_decode($output);\n }", "public function webhook()\n {\n $this->paymentSettings = $this->getPaymentSettings();\n $payload = file_get_contents(\"php://input\");\n $signature = (isset($_SERVER['HTTP_X_PAYSTACK_SIGNATURE']) ? $_SERVER['HTTP_X_PAYSTACK_SIGNATURE'] : '');\n /* It is a good idea to log all events received. Add code *\n * here to log the signature and body to db or file */\n if (!$signature) {\n // only a post with paystack signature header gets our attention\n exit();\n }\n // confirm the event's signature\n if ($signature !== hash_hmac('sha512', $payload, $this->paymentSettings['secret_key'])) {\n // silently forget this ever happened\n exit();\n }\n $webhook_response = json_decode($payload, true);\n if ('charge.success' != $webhook_response['event']) {\n exit;\n }\n try {\n $orderId = $this->updatePaymentStatus($webhook_response['data']['reference']);\n } catch (Exception $e) {\n // Invalid payload\n http_response_code(400);\n exit();\n }\n http_response_code(200);\n exit();\n }", "public function HandleCallback()\r\n\t{\r\n\t\t$rsField = array();\r\n\r\n\t foreach ((array)$_REQUEST as $ixField => $fieldValue)\r\n\t {\r\n $rsField[$ixField] = $fieldValue;\r\n\t }\r\n\r\n\t\t$sSignatureBase =\r\n\t\t\tsprintf(\"%03s\", $rsField['ver']) .\r\n\t\t\tsprintf(\"%-10s\", $rsField['id']) .\r\n\t\t\tsprintf(\"%012s\", $rsField['ecuno']) .\r\n\t\t\tsprintf(\"%06s\", $rsField['receipt_no']) .\r\n\t\t\tsprintf(\"%012s\", $rsField['eamount']) .\r\n\t\t\tsprintf(\"%3s\", $rsField['cur']) .\r\n\t\t\t$rsField['respcode'] .\r\n\t\t\t$rsField['datetime'] .\r\n\t\t\tsprintf(\"%-40s\", $rsField['msgdata']) .\r\n\t\t\tsprintf(\"%-40s\", $rsField['actiontext']);\r\n\r\n\t function hex2str($hex)\r\n\t {\r\n\t\t\tfor($i=0;$i<strlen($hex);$i+=2) $str.=chr(hexdec(substr($hex,$i,2)));\r\n\t\t\treturn $str;\r\n\t\t}\r\n\r\n\t\t$mac = hex2str($rsField['mac']);\r\n\t\t$sSignature = sha1($sSignatureBase);\r\n\t\t$flKey = openssl_get_publickey(file_get_contents($this->flBankCertificate));\r\n\r\n\t\tif (!openssl_verify ($sSignatureBase, $mac, $flKey))\r\n\t\t{\r\n\t\t\ttrigger_error (\"Invalid signature\", E_USER_ERROR);\r\n\t\t}\r\n\t\tif ($rsField['receipt_no'] == 000000) # Payment was cancelled\r\n\t\t{\r\n\t\t\treturn new CPayment($rsField['ecuno'], $rsField['msgdata'], null, null, False);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn new CPayment($rsField['ecuno'], $rsField['msgdata'], $rsField['eamount']/100, $rsField['cur'], True);\r\n\t\t}\r\n\t}", "public function amazonCall()\n {\n $sOperation = $this->_getOperationName();\n $allowedOperations = array('processorderreference', 'getorderreferencedetails', 'setorderreferencedetails', 'confirmorderreference', 'cancelorderreference', 'closeorderreference', 'closeauthorization', 'authorize', 'processauthorization', 'getauthorizationdetails', 'getauthorizationdetails', 'setcapturestate', 'capture', 'getcapturedetails', 'savecapture', 'refund', 'updaterefund', 'getrefunddetails', 'setorderattributes', 'processamazonlogin');\n\n if ($this->_verifySecretKey() !== true) {\n return;\n }\n\n if ($sOperation !== false && in_array(strtolower($sOperation), $allowedOperations)) {\n $oResult = $this->_getContainer()->getClient()->{$sOperation}(\n $order = $this->_getOrder(),\n $params = $this->_getParams()\n );\n\n $this->_oLogger->info(\n 'Execute specific amazon call',\n array(\n 'operation' => $sOperation,\n 'oxid' => $order ? $order->getId() : null,\n 'params' => $params\n )\n );\n\n $this->_addToMessages('<pre>'.print_r($oResult, true).'</pre>');\n return;\n }\n\n $this->setViewData(array(\n 'sError' => 'Please specify operation you want to call (&operation=) '\n .'and use &oxid= parameter to specify order ID or use &aParams[\\'key\\']=value'\n ));\n }", "public function getAuthURL(){\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t$data['title'] = 'Make Payment';\n\t\t\n $this->load->helper('form');\n $this->load->library('form_validation');\n $this->load->library('session');\n \n $this->load->library('email');\n $this->load->helper('url');\n $this->load->database();\n \n\t\t\n\n\t\t$this->form_validation->set_rules('name','Name', 'required');\n $this->form_validation->set_rules('phone','Phone', 'trim|required');\n $this->form_validation->set_rules('email','Email', 'trim|required');\n $this->form_validation->set_rules('location','Location', 'required');\n \n\n\t\t\n\t\t\n\t\t\t\n if($this->form_validation->run() == false){\n \t\t$this->load->view('templates/header', $data);\n\t\t\t\t\t$this->load->view('templates/nav');\n $this->load->view('billing');\n $this->load->view('templates/footer');\n \n }else{\n\t\t\n\t\n \n \n \n \n//get customer email\n$email = $this->input->post('email'); \n$amount = $this->input->post('location'); \n$name = $this->input->post('name');\n$phone = $this->input->post('phone');\n\n\n\n$length = 10;\n\n$order_id = substr(str_shuffle(\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\"), 0, $length);\n\n\n\t\t\t$this->Page_Model->payment($name,$phone,$email,$order_id);\n\t\t\t\t\t\n\t\t\t\t\t \n \n \n\n$amount2 = $amount * 100;\n \n\t\t\t\n //init($ref, $amount_in_kobo, $email, $metadata_arr=[], $callback_url=\"\", $return_obj=false)\n $url = $this->paystack->init($order_id, $amount2, $email, base_url('pay/callback'), FALSE);\n \n //$url ? header(\"Location: {$url}\") : \"\";\n $url ? redirect($url) : \"\"; \n \n \n}\n\t\t\n }", "public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}", "function print_result()\n{\n global $pxpay;\n \n $enc_hex = $_REQUEST[\"result\"];\n #getResponse method in PxPay object returns PxPayResponse object\n #which encapsulates all the response data\n $rsp = $pxpay->getResponse($enc_hex);\n \n \n # the following are the fields available in the PxPayResponse object\n $Success = $rsp->getSuccess(); # =1 when request succeeds\n $AmountSettlement = $rsp->getAmountSettlement();\n $AuthCode = $rsp->getAuthCode(); # from bank\n $CardName = $rsp->getCardName(); # e.g. \"Visa\"\n $CardNumber = $rsp->getCardNumber(); # Truncated card number\n $DateExpiry = $rsp->getDateExpiry(); # in mmyy format\n $DpsBillingId = $rsp->getDpsBillingId();\n $BillingId \t = $rsp->getBillingId();\n $CardHolderName = $rsp->getCardHolderName();\n $DpsTxnRef\t = $rsp->getDpsTxnRef();\n $TxnType = $rsp->getTxnType();\n $TxnData1 = $rsp->getTxnData1();\n $TxnData2 = $rsp->getTxnData2();\n $TxnData3 = $rsp->getTxnData3();\n $CurrencySettlement= $rsp->getCurrencySettlement();\n $ClientInfo = $rsp->getClientInfo(); # The IP address of the user who submitted the transaction\n $TxnId = $rsp->getTxnId();\n $CurrencyInput = $rsp->getCurrencyInput();\n $EmailAddress = $rsp->getEmailAddress();\n $MerchantReference = $rsp->getMerchantReference();\n $ResponseText\t\t = $rsp->getResponseText();\n $TxnMac = $rsp->getTxnMac(); # An indication as to the uniqueness of a card used in relation to others\n $RecurringMode = $rsp->getRecurringMode();\n \n \n if ($rsp->getSuccess() == \"1\")\n {\n $result = \"The transaction was approved.\";\n \n\t\t# Sending invoices/updating order status within database etc.\n \n if (!isProcessed($TxnId))\n {\n \n \n }\n \n }\n else\n {\n $result = \"The transaction was declined.\";\n }\n print <<<HTMLEOF\n <html>\n <head>\n <title>Payment Express PxPay transaction result</title>\n </head>\n <body>\n <h1>Payment Express PxPay transaction result</h1>\n <p>$result</p>\n <table border=1>\n\t<tr><th>Name</th>\t\t\t\t<th>Value</th> </tr>\n\t<tr><td>Success</td>\t\t\t<td>$Success</td></tr>\n\t<tr><td>TxnType</td>\t\t\t<td>$TxnType</td></tr>\n\t<tr><td>CurrencyInput</td>\t\t<td>$CurrencyInput</td></tr>\n\t<tr><td>MerchantReference</td>\t<td>$MerchantReference</td></tr>\n\t<tr><td>TxnData1</td>\t\t\t<td>$TxnData1</td></tr>\n\t<tr><td>TxnData2</td>\t\t\t<td>$TxnData2</td></tr>\n\t<tr><td>TxnData3</td>\t\t\t<td>$TxnData3</td></tr>\n\t<tr><td>AuthCode</td>\t\t\t<td>$AuthCode</td></tr>\n\t<tr><td>CardName</td>\t\t\t<td>$CardName</td></tr>\n\t<tr><td>CardHolderName</td>\t\t<td>$CardHolderName</td></tr>\n\t<tr><td>CardNumber</td>\t\t\t<td>$CardNumber</td></tr>\n\t<tr><td>DateExpiry</td>\t\t\t<td>$DateExpiry</td></tr>\n\t<tr><td>ClientInfo</td>\t\t\t<td>$ClientInfo</td></tr>\n\t<tr><td>TxnId</td>\t\t\t\t<td>$TxnId</td></tr>\n\t<tr><td>EmailAddress</td>\t\t<td>$EmailAddress</td></tr>\n\t<tr><td>DpsTxnRef</td>\t\t\t<td>$DpsTxnRef</td></tr>\n\t<tr><td>BillingId</td>\t\t\t<td>$BillingId</td></tr>\n\t<tr><td>DpsBillingId</td>\t\t<td>$DpsBillingId</td></tr>\n\t<tr><td>AmountSettlement</td>\t<td>$AmountSettlement</td></tr>\n\t<tr><td>CurrencySettlement</td>\t<td>$CurrencySettlement</td></tr>\n\t<tr><td>TxnMac</td>\t\t\t\t<td>$TxnMac</td></tr>\n <tr><td>ResponseText</td>\t\t<td>$ResponseText</td></tr>\n <tr><td>RecurringMode</td>\t\t<td>$RecurringMode</td></tr>\n </table>\n </body>\n </html>\nHTMLEOF;\n}", "function presta_paybox_call_directplus_dist($id_transaction, $transaction_hash, $refabonne, $ppps, $config = null){\n\tinclude_spip('inc/bank');\n\t\n\tif (!$config){\n\t\t$config = bank_config(\"paybox\", true);\n\t}\n\t$config['mode'] .= \"_dplus\"; // pour les logs\n\t$mode = $config['mode'];\n\n\tif (!$row = sql_fetsel(\"*\", \"spip_transactions\", \"id_transaction=\" . intval($id_transaction) . \" AND transaction_hash=\" . sql_quote($transaction_hash))){\n\t\tspip_log(\"Transaction inconnue $id_transaction/$transaction_hash\", $mode . _LOG_ERREUR);\n\t\treturn array(0, false);\n\t}\n\n\t// securite : eviter de faire payer plusieurs fois une meme transaction si bug en amont\n\tif ($row['statut']=='ok'){\n\t\tspip_log(\"Transaction $id_transaction/$transaction_hash deja reglee\", $mode . _LOG_INFO_IMPORTANTE);\n\t\treturn array($id_transaction, true);\n\t}\n\n\t// On peut maintenant connaître la devise et ses infos\n\t$devise = $row['devise'];\n\t$devise_info = bank_devise_info($devise);\n\tif (!$devise_info) {\n\t\tspip_log(\"Transaction #$id_transaction : la devise $devise n’est pas connue\", $mode . _LOG_ERREUR);\n\t\treturn array(0, false);\n\t}\n\n\tif (!$row['id_auteur']\n\t\tAND isset($GLOBALS['visiteur_session']['id_auteur'])\n\t\tAND $GLOBALS['visiteur_session']['id_auteur']){\n\t\tsql_updateq(\"spip_transactions\", array(\"id_auteur\" => $row['id_auteur'] = $GLOBALS['visiteur_session']['id_auteur']), \"id_transaction=\" . intval($id_transaction));\n\t}\n\n\t// recuperer l'email\n\t$mail = sql_getfetsel('email', \"spip_auteurs\", 'id_auteur=' . intval($row['id_auteur']));\n\n\t// passage en centimes et formattage sur 10 chiffres\n\t$montant = bank_formatter_montant_selon_fraction($row['montant'], $devise_info['fraction'], 10);\n\n\t//\t\tAffectation des parametres obligatoires\n\t$parm = array('VERSION' => '00104', 'SITE' => $config['PBX_SITE'], 'RANG' => $config['PBX_RANG'], 'IDENTIFIANT' => '');\n\n\t// cas de PBX_RANG : paybox fournit 001 mais il faut envoyer 01 au serveur\n\t$parm['RANG'] = str_pad(intval($parm['RANG']), 2, '0', STR_PAD_LEFT);\n\n\t$parm['CLE'] = $config['DIRECT_PLUS_CLE'];\n\t$parm['DATEQ'] = date('dmYHis');\n\t$parm['TYPE'] = _PAYBOX_DIRECTPLUS_AUTHDEBIT_ABONNE;\n\t$parm['DEVISE'] = (string)$devise_info['code_num'];\n\t$parm['REFERENCE'] = intval($id_transaction);\n\t$parm['ARCHIVAGE'] = intval($id_transaction);\n\t$parm['DIFFERE'] = '000';\n\t$parm['NUMAPPEL'] = '';\n\t$parm['NUMTRANS'] = '';\n\t$parm['AUTORISATION'] = '';\n\t$parm['MONTANT'] = $montant;\n\n\t$parm['REFABONNE'] = $refabonne;\n\n\t$ppps = explode(' ', $ppps);\n\t$parm['PORTEUR'] = str_pad($ppps[0], 19, ' ', STR_PAD_RIGHT); // NO CB\n\t$parm['DATEVAL'] = substr($ppps[1], 2) . substr($ppps[1], 0, 2); // VAL CB\n\t$parm['CVV'] = $ppps[2]; // CCV CB\n\n\n\tinclude_spip('inc/distant');\n\n\t// numero de question incremental\n\t// dans spip_meta\n\t// on recommence si collision par concurence...\n\t$maxtry = 5;\n\tdo {\n\t\t$num_question = intval(sql_getfetsel(\"valeur\", \"spip_meta\", \"nom=\" . sql_quote('payboxnumquestion')));\n\t\t$num_question++;\n\t\tecrire_meta('payboxnumquestion', $num_question);\n\n\t\t$parm['NUMQUESTION'] = $num_question;\n\t\t#var_dump($parm);\n\n\t\t// requete en POST sur PAYBOX DIRECT PLUS\n\t\t$url = paybox_url_directplus($config);\n\t\t$options = array(\n\t\t\t'taille_max' => 1048576,\n\t\t\t'datas' => $parm,\n\t\t);\n\t\t$res = recuperer_url($url, $options);\n\t\tif (!$res or empty($res['page'])) {\n\t\t\tspip_log(\"paybox_call_directplus: Echec appel de recuperer_url sur $url avec \".json_encode($parm), $mode . _LOG_ERREUR);\n\t\t\t$r = array();\n\t\t}\n\t\telse {\n\t\t\tparse_str($res['page'], $r);\n\t\t}\n\n\t\tif (!empty($r)) {\n\t\t\tif ($r['CODEREPONSE']=='00005'){\n\t\t\t\tspip_log(\"paybox_call_directplus: Collision Reponse : \".json_encode($res), $mode . _LOG_INFO_IMPORTANTE);\n\t\t\t\t// hum\n\t\t\t\tsleep(1);\n\t\t\t} else {\n\t\t\t\tspip_log(\"paybox_call_directplus: Reponse : \".json_encode($res), $mode . _LOG_DEBUG);\n\t\t\t}\n\t\t}\n\n\t} while ((empty($r) or $r['CODEREPONSE']=='00005') AND $maxtry-->0);\n\n\tif (empty($r)) {\n\t\treturn '';\n\t}\n\t#var_dump($r);\n\t/*\n\t * array(10) {\n [\"NUMTRANS\"]=>\n string(10) \"0000617104\"\n [\"NUMAPPEL\"]=>\n string(10) \"0000981593\"\n [\"NUMQUESTION\"]=>\n string(10) \"0000095720\"\n [\"SITE\"]=>\n string(7) \"1999888\"\n [\"RANG\"]=>\n string(2) \"99\"\n [\"AUTORISATION\"]=>\n string(6) \"XXXXXX\"\n [\"CODEREPONSE\"]=>\n string(5) \"00000\"\n [\"COMMENTAIRE\"]=>\n string(27) \"Demande trait?e avec succ?s\"\n [\"REFABONNE\"]=>\n string(5) \"95720\"\n [\"PORTEUR\"]=>\n string(19) \"SLDLrcsLMPC \"\n\t}\n\t*/\n\n\t// renommons en coherence avec Paybox System\n\t$response = array(\n\t\t'id_transaction' => $id_transaction,\n\t\t'erreur' => $r['CODEREPONSE'],\n\t\t'auth' => $r['AUTORISATION'],\n\t\t'trans' => $r['NUMTRANS'],\n\t\t'montant' => $parm['MONTANT'],\n\t\t'abo' => $r['REFABONNE'],\n\t\t'valid' => $ppps[1],\n\t);\n\n\t$call_response = charger_fonction('response', 'presta/paybox/call');\n\treturn $call_response($config, $response);\n}", "public function handleGatewayCallback($txref)\n {\n \n\n // dd($txref);\n $verified_data = Http::withToken(env('PAYSTACK_SECRET_KEY'))->get('https://api.paystack.co/transaction/verify/'.$txref);\n\n if($verified_data->successful()) {\n\n }\n\n dd(json_decode($verified_data));\n // Now you have the payment details,\n // you can store the authorization_code in your db to allow for recurrent subscriptions\n // you can then redirect or do whatever you want\n }", "function sign()\n {\n\n //Get particular key\n\n $keyResponse = $this->get('\"'.$this->id.'\"');\n\n\n if ($keyResponse){\n //Get the key version reference on Azure\n $keyID = $this->key_version;\n\n //Sign with given key\n $signResponse = $this->keyVaultKey->sign($keyID, $this->algorithm,$this->hash);\n\n\n //If success, return signature\n if ($signResponse[\"responsecode\"] == 200) {\n $signatureValue = $signResponse['data']['value'];\n $this->signature = $signatureValue;\n return true;\n }\n\n //Return signing error from Azure\n else {\n $this->keyVault_error = $signResponse[\"responseMessage\"][\"message\"];\n return false;\n }\n\n }\n\n //Return key error from Azure\n else{\n $this->keyVault_error = $keyResponse[\"responseMessage\"][\"message\"];\n return false;\n\n }\n\n }" ]
[ "0.7089446", "0.67854375", "0.67441547", "0.6549068", "0.6495124", "0.62567896", "0.6118522", "0.60313505", "0.5941127", "0.59124017", "0.5868389", "0.5843795", "0.58194005", "0.57683253", "0.57567775", "0.5699855", "0.56623477", "0.5654446", "0.5630786", "0.5586937", "0.55788136", "0.55628645", "0.5557286", "0.552869", "0.5525534", "0.5522338", "0.5518481", "0.5511691", "0.54753846", "0.54545605", "0.5406521", "0.5403886", "0.5397795", "0.53716946", "0.5367913", "0.53576636", "0.53482515", "0.53277075", "0.53197914", "0.53124356", "0.5304793", "0.53023106", "0.5300728", "0.52959365", "0.52794564", "0.5268963", "0.5268528", "0.5268011", "0.52668756", "0.5264736", "0.5263529", "0.5250447", "0.52434504", "0.52397454", "0.5233902", "0.5232514", "0.52268386", "0.52235365", "0.5221035", "0.52140903", "0.51992166", "0.5195533", "0.5193456", "0.517888", "0.51769614", "0.5170911", "0.51684594", "0.5168224", "0.5163116", "0.51630807", "0.51406264", "0.51406205", "0.5132127", "0.51314044", "0.5126338", "0.51250625", "0.5122057", "0.5117203", "0.51108617", "0.51106894", "0.5110652", "0.5110023", "0.5107591", "0.5105589", "0.51046735", "0.5100703", "0.5084195", "0.5084195", "0.50834066", "0.5081283", "0.5071326", "0.5065722", "0.50622505", "0.50589997", "0.5058821", "0.5055215", "0.5053711", "0.5049186", "0.50475776", "0.5044627" ]
0.6967719
1
/' This function will take NVPString and convert it to an Associative Array and it will decode the response. It is usefull to search for a particular key and displaying arrays.
private function deformatNVP($nvpstr) { $intial=0; $nvpArray = array(); while(strlen($nvpstr)) { //postion of Key $keypos= strpos($nvpstr,'='); //position of value $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr); /*getting the Key and Value values and storing in a Associative Array*/ $keyval=substr($nvpstr,$intial,$keypos); $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1); //decoding the respose $nvpArray[urldecode($keyval)] =urldecode( $valval); $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr)); } return $nvpArray; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function deformatNVP($nvpstr){\r\n \r\n $intial=0;\r\n $nvpArray = array(); \r\n \r\n while(strlen($nvpstr)){\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n \r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "function deformatNVP($nvpstr){\n\t\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\t\n\t\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\t\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvpArray[urldecode($keyval)] =urldecode( $valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t}\n\t\treturn $nvpArray;\n\t}", "private function deformatNVP($nvpstr) {\n\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\n\n\t\twhile(strlen($nvpstr)){\n\t\t\t//position of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr, $intial, $keypos);\n\t\t\t$valval=substr($nvpstr, $keypos+1, $valuepos-$keypos-1);\n\t\t\t//decoding the response\n\t\t\t$nvpArray[urldecode($keyval)] = urldecode($valval);\n\t\t\t$nvpstr = substr($nvpstr, $valuepos+1, strlen($nvpstr));\n\t\t}\n\t\treturn $nvpArray;\n\t}", "public function deformatNVP($nvpstr)\r\n {\r\n $intial=0;\r\n $nvpArray = array();\r\n\r\n while(strlen($nvpstr))\r\n {\r\n //postion of Key\r\n $keypos= strpos($nvpstr,'=');\r\n //position of value\r\n $valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\r\n\r\n /*getting the Key and Value values and storing in a Associative Array*/\r\n $keyval=substr($nvpstr,$intial,$keypos);\r\n $valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\r\n //decoding the respose\r\n $nvpArray[urldecode($keyval)] =urldecode( $valval);\r\n $nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\r\n }\r\n return $nvpArray;\r\n }", "function deformatNVP($nvpstr)\n\t{\n\n\t\t$intial=0;\n\t\t$nvpArray = array();\n\n\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvpArray[urldecode($keyval)] =urldecode( $valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t }\n\t\treturn $nvpArray;\n\t}", "public function deformatNVP($smsstr){ \n \n $intial=0; \n $smsArray = array(); \n \n \n while(strlen($smsstr)){ \n //postion of Key \n $keypos= strpos($smsstr,'='); \n //position of value \n $valuepos = strpos($smsstr,'&') ? strpos($smsstr,'&'): strlen($smsstr); \n \n /*getting the Key and Value values and storing in a Associative Array*/ \n $keyval=substr($smsstr,$intial,$keypos); \n $valval=substr($smsstr,$keypos+1,$valuepos-$keypos-1); \n //decoding the respose \n $smsArray[urldecode($keyval)] =urldecode( $valval); \n $smsstr=substr($smsstr,$valuepos+1,strlen($smsstr)); \n } \n return $smsArray; \n }", "public function deformatNVP($nvpstr)\n {\n $intial=0;\n $nvpArray = array();\n \n \n while (strlen($nvpstr)) {\n //postion of Key\n $keypos= strpos($nvpstr, '=');\n //position of value\n $valuepos = strpos($nvpstr, '&') ? strpos($nvpstr, '&'): strlen($nvpstr);\n \n /*getting the Key and Value values and storing in a Associative Array*/\n $keyval=substr($nvpstr, $intial, $keypos);\n $valval=substr($nvpstr, $keypos+1, $valuepos-$keypos-1);\n //decoding the respose\n $nvpArray[urldecode($keyval)] =urldecode($valval);\n $nvpstr=substr($nvpstr, $valuepos+1, strlen($nvpstr));\n }\n return $nvpArray;\n }", "function deformat_nvp($nvpstr)\n\t{\n\t\t$intial=0;\n\t\t$nvparray = array();\n\t\twhile(strlen($nvpstr)){\n\t\t\t//postion of Key\n\t\t\t$keypos= strpos($nvpstr,'=');\n\t\t\t//position of value\n\t\t\t$valuepos = strpos($nvpstr,'&') ? strpos($nvpstr,'&'): strlen($nvpstr);\n\t\t\t/*getting the Key and Value values and storing in a Associative Array*/\n\t\t\t$keyval=substr($nvpstr,$intial,$keypos);\n\t\t\t$valval=substr($nvpstr,$keypos+1,$valuepos-$keypos-1);\n\t\t\t//decoding the respose\n\t\t\t$nvparray[urldecode($keyval)] = urldecode($valval);\n\t\t\t$nvpstr=substr($nvpstr,$valuepos+1,strlen($nvpstr));\n\t\t}\n\t\treturn $nvparray;\n\t}", "function parse_response_array($string) {\n $response_string_array = explode(\"&\", $string);\n\n $proper_array = array();\n\n foreach ($response_string_array as $value) {\n list($key, $val) = explode(\"=\", $value);\n\n $val = urldecode($val);\n\n $proper_array[\"$key\"] = $val;\n }\n unset($key);\n unset($val);\n\n return $proper_array;\n }", "function oAuthParseResponse($responseString) {\n\t\t$r = array ();\n\t\tforeach ( explode ( '&', $responseString ) as $param ) {\n\t\t\t$pair = explode ( '=', $param, 2 );\n\t\t\tif (count ( $pair ) != 2)\n\t\t\t\tcontinue;\n\t\t\t$r [urldecode ( $pair [0] )] = urldecode ( $pair [1] );\n\t\t}\n\t\treturn $r;\n\t}", "private function _readNvp($string)\r\n\t{\r\n\t\twhile (strlen($string))\r\n\t\t{\r\n\t\t\t$keypos = strpos($string, '=');\r\n\t\t\t$valuepos = strpos($string, '&') ? strpos($string, '&') : strlen($string);\r\n\t\t\t$nvp_array[urldecode(substr($string, 0, $keypos))] = urldecode(substr($string, $keypos + 1, $valuepos - $keypos - 1));\r\n\t\t\t$string = substr($string, $valuepos + 1, strlen($string));\r\n\t\t}\r\n\r\n\t\treturn $nvp_array;\r\n\t}", "private static function strToArray($nvp)\r\n\t {\r\n\t\t $temp_array = array();\r\n\t\t $nvp = explode('&' , trim($nvp , '&'));\r\n\t\t foreach($nvp as $value)\r\n\t\t {\r\n if (empty($value)) continue;\r\n\t\t\t $temp_array2 = explode('=' , $value);\r\n\t\t\t if (empty($temp_array2[1])) continue;\r\n\t\t\t $temp_array[$temp_array2[0]] = $temp_array2[1];\r\n\t\t }\r\n\t\t return $temp_array;\r\n\t }", "public static function deformatNVP( $nvpstr ) {\r\n\t\t\tparse_str( $nvpstr, $nvpArray );\r\n\r\n\t\t\treturn $nvpArray;\r\n\t\t}", "abstract public static function decode($string): array;", "function parseResponse($response) {\r\n\t\t$begin = 0;\r\n\t\t$end = 0;\r\n\t\t$start = null;\r\n\t\t$value = null;\r\n\t\t$map;\r\n\t\t// responseMap = new HashMap();\r\n\t\t$response = trim ( $response );\r\n\t\t$pos = strpos ( $response, \"<\" ) == 0;\r\n\t\tif ($response == null || (strlen ( $response ) < 0) || $pos === false) {\r\n\t\t\t// // echo \"returned\";\r\n\t\t\treturn null;\r\n\t\t} else {\r\n\t\t\t// // echo \"else \";\r\n\t\t\tdo {\r\n\t\t\t\t\r\n\t\t\t\tif ((strpos ( $response, '<' ) !== false) && (strpos ( $response, '>' ) !== false)) {\r\n\t\t\t\t\t$start = substr ( $response, ($ind = strpos ( $response, \"<\" )) + 1, ((strpos ( $response, \">\" ) - 1) - $ind) );\r\n\t\t\t\t\t$mapKey = substr ( $response, ($ind = strpos ( $response, \">\" )) + 1, ((strpos ( $response, \"</\" . $start . \">\" ) - 1) - $ind) );\r\n\t\t\t\t\t// // echo \"<br/> strrsdfdpos\".(strrpos($response,\">\"));\r\n\t\t\t\t\t$response = substr ( $response, $from = strpos ( $response, \"</\" . $start . \">\" ) + strlen ( $start ) + 3, strrpos ( $response, \">\" ) - $from + 1 );\r\n\t\t\t\t\t// // echo \"<br/> from \".$from;\r\n\t\t\t\t\t// // echo \"<br/> start------- \".$start;\r\n\t\t\t\t\t// // echo \"--------\".$mapKey;\r\n\t\t\t\t\t$maps [$start] = $mapKey;\r\n\t\t\t\t\t\r\n\t\t\t\t\t// // echo \"------ response====\".htmlspecialchars($response).\"<br/>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// // echo \"here\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} while ( strlen ( $response ) > 0 );\r\n\t\t}\r\n\t\t\r\n\t\t// // echo \"<br/>MAPPPPPPPS \".var_dump($maps);\r\n\t\treturn $maps;\r\n\t}", "function icedrive_response_to_array($response)\r\n {\r\n libxml_use_internal_errors(true);\r\n $xml = simplexml_load_string(str_replace(':', '', $response));\r\n $xml = json_encode($xml);\r\n $xml = json_decode($xml, true);\r\n return $xml;\r\n }", "private function getNVP() {\n $post = '';\n foreach($this->NVP as $key=>$value) { \n $post .= \"$key=\" . urlencode($value) . \"&\";\n }\n return (string)rtrim($post, \"& \");\n }", "private function parse($body)\n {\n parse_str($body, $response_array);\n $response = array();\n foreach ($response_array as $k => $v) {\n $key = str_replace('VP', '', $k);\n $response[$key] = $v;\n }\n\n return $response;\n }", "public function FormatPDTResponseInAssociativeArray($pdtMessage)\n {\n $pdtMessage = urldecode(substr($pdtMessage, 7));\n \n // Convert text response to associative array\n $out = [];\n preg_match_all('/^([^=\\s]++)=(.*+)/m', $pdtMessage, $out, PREG_PATTERN_ORDER);\n $msgInAssocArray = array_combine($out[1], $out[2]);\n ksort($msgInAssocArray);\n\treturn $msgInAssocArray;\n }", "public function associativeStringArrayValue($key);", "public function parse2array() {\n\t\t/**\n\t\t * Thanks to Vladimir Struchkov <great_boba yahoo com> for providing the\n\t\t * code to extract base64 encoded values\n\t\t */\n\n\t\t$arr1 = explode( \"\\n\", str_replace( \"\\r\", '', $this->rawdata ) );\n\t\t$i = $j = 0;\n\t\t$arr2 = array();\n\n\t\t/* First pass, rawdata is splitted into raw blocks */\n\t\tforeach ( $arr1 as $v ) {\n\t\t\tif ( trim( $v ) == '' ) {\n\t\t\t\t++ $i;\n\t\t\t\t$j = 0;\n\t\t\t} else {\n\t\t\t\t$arr2[ $i ][ $j ++ ] = $v;\n\t\t\t}\n\t\t}\n\n\t\t/* Second pass, raw blocks are updated with their name/value pairs */\n\t\tforeach ( $arr2 as $k1 => $v1 ) {\n\t\t\t$i = 0;\n\t\t\t$decode = false;\n\t\t\tforeach ( $v1 as $v2 ) {\n\t\t\t\tif ( ereg( '::', $v2 ) ) { // base64 encoded, chunk start\n\t\t\t\t\t$decode = true;\n\t\t\t\t\t$arr = explode( ':', str_replace( '::', ':', $v2 ) );\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = base64_decode( $arr[1] );\n\t\t\t\t} elseif ( ereg( ':', $v2 ) ) {\n\t\t\t\t\t$decode = false;\n\t\t\t\t\t$arr = explode( ':', $v2 );\n\t\t\t\t\t$count = count( $arr );\n\t\t\t\t\tif ( $count != 2 ) {\n\t\t\t\t\t\tfor ( $i = $count - 1; $i > 1; -- $i ) {\n\t\t\t\t\t\t\t$arr[ $i - 1 ] .= ':' . $arr[ $i ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$i = $arr[0];\n\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $arr[1];\n\t\t\t\t} else {\n\t\t\t\t\tif ( $decode ) { // base64 encoded, next chunk\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] .= base64_decode( $v2 );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->entries[ $k1 ][ $i ] = $v2;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function parseAssoc($returnArray, $key, $haystack) { //simple parse of url style concatenations & as delimiter = as key = value;\n\t$associations = explode(\"&\", $haystack);\n\tforeach ($associations as $association) {\n\t\t$assoc = explode(\"=\", $association);\n\t\tif (isset($assoc[1])) { //was there a key/value pair\n\t\t\tif (is_array($assoc[1])) { $returnArray[$key][$assoc[0]] = implode('',$assoc[1]); } //if array (happens with textarea)\n\t\t\telse { $returnArray[$key][$assoc[0]] = $assoc[1]; }\n\t\t}\n\t}\n\treturn($returnArray);\n}", "public function parseSearchString(){\n\t\t$searchData = array();\n\t\tif($this->tblAdministratorSearchString){\n\t\t\t$obj = json_decode($this->tblAdministratorSearchString);\n\t\t\tif($obj){\n\t\t\t\tif(!empty($obj->{'search_name'})){\n\t\t\t\t\t$nameData = array();\n\t\t\t\t\t$nameData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_TYPE']] = Yii::app()->params['SEARCH_INPUT_TYPE_TEXT'];\n\t\t\t\t\t$nameData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_VALUE']] = $obj->{'search_name'};\n\t\t\t\t\t$nameData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_MODEL_NAME']] = 'name';\n\t\t\t\t\t$searchData[] = $nameData;\n }\n\t\t\t\t\n if(!empty($obj->{'search_order'})){\n\t\t\t\t\t$orderData = array();\n\t\t\t\t\t$orderData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_TYPE']] = Yii::app()->params['SEARCH_INPUT_TYPE_NUMBER'];\n\t\t\t\t\t$orderData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_VALUE']] = $obj->{'search_order'};\n\t\t\t\t\t$orderData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_MODEL_NAME']] = '`'.'order'.'`';\n\t\t\t\t\t$searchData[] = $orderData;\n }\n\t\n\t\t\t\tif(!empty($obj->{'search_status'})){\n\t\t\t\t\t$statusData = array();\n\t\t\t\t\t$statusData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_TYPE']] = Yii::app()->params['SEARCH_INPUT_TYPE_BOOL'];\n\t\t\t\t\t$statusData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_VALUE']] = $obj->{'search_status'};\n\t\t\t\t\t$statusData[Yii::app()->params['SEARCH_FORM_AJAX_ELEMENT_MODEL_NAME']] = 'active';\n\t\t\t\t\t$searchData[] = $statusData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t \n\t\treturn $searchData;\n\t}", "function decodeKeyValuePair($pair)\n{\n\t$operators = array(\"==\", \"!=\", \"<>\", \">=\", \"<=\", \"=\", \"<\", \">\");\n\n\tstatic $s_regex = null;\n\tif ($s_regex === null)\n\t{\n\t\t$s_regex = '/'.implode('|', array_map('preg_quote', $operators)).'/';\n\t}\n\n\tlist($key, $value) = preg_split($s_regex, $pair);\n\n\treturn array($key => stripQuotes($value));\n}", "private static function arrayToStr($nvp)\r\n\t {\r\n\t\t $temp_str = '';\r\n\t\t if (!is_array($nvp)) return $nvp;\r\n\t\t foreach ($nvp as $key => $value)\r\n\t\t {\r\n\t\t\t $temp_str .= $key.'='.$value.'&';\r\n\t\t }\r\n\t\t return rtrim($temp_str , '&');\r\n\t }", "function StrToArray($Qstr)\r\n\t{\r\n\t$finalArr=array();\r\n\t\t\r\n\t\t$qryArr=split(\"&\",$Qstr);\r\n\t\t\r\n\t\t\tif(!empty($Qstr))\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\tforeach($qryArr as $item)\r\n\t\t\t\t{\r\n\t\t\t\t\t$Qarr=split(\"=\",$item);\r\n\t\t\t\t\tif(count($Qarr)==2)\r\n\t\t\t\t\t$finalArr[$Qarr[0]]=$Qarr[1];\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn $finalArr;\r\n\t\t\t}\r\n\t}", "function str_to_array($str,$key){\n\t\t//remove the . from last line\n\t\t$str = trim($str,'.');\n\t\treturn explode($key,$str);\n\t}", "private static function vcard_decode($vcard)\n {\n // Perform RFC2425 line unfolding and split lines\n $vcard = preg_replace(array(\"/\\r/\", \"/\\n\\s+/\"), '', $vcard);\n $lines = explode(\"\\n\", $vcard);\n $result = array();\n\n for ($i=0; $i < count($lines); $i++) {\n if (!($pos = strpos($lines[$i], ':'))) {\n continue;\n }\n\n $prefix = substr($lines[$i], 0, $pos);\n $data = substr($lines[$i], $pos+1);\n\n if (preg_match('/^(BEGIN|END)$/i', $prefix)) {\n continue;\n }\n\n // convert 2.1-style \"EMAIL;internet;home:\" to 3.0-style \"EMAIL;TYPE=internet;TYPE=home:\"\n if ($result['VERSION'][0] == \"2.1\"\n && preg_match('/^([^;]+);([^:]+)/', $prefix, $regs2)\n && !preg_match('/^TYPE=/i', $regs2[2])\n ) {\n $prefix = $regs2[1];\n foreach (explode(';', $regs2[2]) as $prop) {\n $prefix .= ';' . (strpos($prop, '=') ? $prop : 'TYPE='.$prop);\n }\n }\n\n if (preg_match_all('/([^\\\\;]+);?/', $prefix, $regs2)) {\n $entry = array();\n $field = strtoupper($regs2[1][0]);\n $enc = null;\n\n foreach($regs2[1] as $attrid => $attr) {\n $attr = preg_replace('/[\\s\\t\\n\\r\\0\\x0B]/', '', $attr);\n if ((list($key, $value) = explode('=', $attr)) && $value) {\n if ($key == 'ENCODING') {\n $value = strtoupper($value);\n // add next line(s) to value string if QP line end detected\n if ($value == 'QUOTED-PRINTABLE') {\n while (preg_match('/=$/', $lines[$i])) {\n $data .= \"\\n\" . $lines[++$i];\n }\n }\n $enc = $value == 'BASE64' ? 'B' : $value;\n }\n else {\n $lc_key = strtolower($key);\n $entry[$lc_key] = array_merge((array)$entry[$lc_key], (array)self::vcard_unquote($value, ','));\n }\n }\n else if ($attrid > 0) {\n $entry[strtolower($key)] = true; // true means attr without =value\n }\n }\n\n // decode value\n if ($enc || !empty($entry['base64'])) {\n // save encoding type (#1488432)\n if ($enc == 'B') {\n $entry['encoding'] = 'B';\n // should we use vCard 3.0 instead?\n // $entry['base64'] = true;\n }\n\n $data = self::decode_value($data, $enc ?: 'base64');\n }\n else if ($field == 'PHOTO') {\n // vCard 4.0 data URI, \"PHOTO:data:image/jpeg;base64,...\"\n if (preg_match('/^data:[a-z\\/_-]+;base64,/i', $data, $m)) {\n $entry['encoding'] = $enc = 'B';\n $data = substr($data, strlen($m[0]));\n $data = self::decode_value($data, 'base64');\n }\n }\n\n if ($enc != 'B' && empty($entry['base64'])) {\n $data = self::vcard_unquote($data);\n }\n\n $entry = array_merge($entry, (array) $data);\n $result[$field][] = $entry;\n }\n }\n\n unset($result['VERSION']);\n\n return $result;\n }", "function parse_oid2($string)\n{\n $result = array();\n $matches = array();\n\n // Match OID - If wrapped in double-quotes ('\"'), must escape '\"', else must escape ' ' (space) or '[' - Other escaping is optional\n $match_count = preg_match('/^(?:((?!\")(?:[^\\\\\\\\\\\\[ ]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n\n // Match indexes (optional) - If wrapped in double-quotes ('\"'), must escape '\"', else must escape ']' - Other escaping is optional\n while (true)\n {\n $match_count = preg_match('/^\\\\[(?:((?!\")(?:[^\\\\\\\\\\\\]]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))\\\\]/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n }\n else\n {\n break;\n }\n } // while\n\n // Match value - Skips leading ' ' characters - If remainder is wrapped in double-quotes ('\"'), must escape '\"', other escaping is optional\n $match_count = preg_match('/^\\\\s+(?:((?!\")(?:[^\\\\\\\\]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))$/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n\n $result[] = stripslashes($value);\n\n if (strlen($string) != strlen($matches[0])) { echo \"Length error!\"; return null; }\n\n return $result;\n }\n }\n\n // All or nothing\n return null;\n}", "public function get_assoc()\n {\n $out = array('name' => $this->displayname);\n $typemap = $this->typemap;\n\n // copy name fields to output array\n foreach (array('firstname','surname','middlename','nickname','organization') as $col) {\n if (strlen($this->$col)) {\n $out[$col] = $this->$col;\n }\n }\n\n if ($this->raw['N'][0][3])\n $out['prefix'] = $this->raw['N'][0][3];\n if ($this->raw['N'][0][4])\n $out['suffix'] = $this->raw['N'][0][4];\n\n // convert from raw vcard data into associative data for Roundcube\n foreach (array_flip(self::$fieldmap) as $tag => $col) {\n foreach ((array)$this->raw[$tag] as $i => $raw) {\n if (is_array($raw)) {\n $k = -1;\n $key = $col;\n $subtype = '';\n\n if (!empty($raw['type'])) {\n $combined = join(',', self::array_filter((array)$raw['type'], 'internet,pref', true));\n $combined = strtoupper($combined);\n\n if ($typemap[$combined]) {\n $subtype = $typemap[$combined];\n }\n else if ($typemap[$raw['type'][++$k]]) {\n $subtype = $typemap[$raw['type'][$k]];\n }\n else {\n $subtype = strtolower($raw['type'][$k]);\n }\n\n while ($k < count($raw['type']) && ($subtype == 'internet' || $subtype == 'pref')) {\n $subtype = $typemap[$raw['type'][++$k]] ?: strtolower($raw['type'][$k]);\n }\n }\n\n // read vcard 2.1 subtype\n if (!$subtype) {\n foreach ($raw as $k => $v) {\n if (!is_numeric($k) && $v === true && ($k = strtolower($k))\n && !in_array($k, array('pref','internet','voice','base64'))\n ) {\n $k_uc = strtoupper($k);\n $subtype = $typemap[$k_uc] ?: $k;\n break;\n }\n }\n }\n\n // force subtype if none set\n if (!$subtype && preg_match('/^(email|phone|address|website)/', $key)) {\n $subtype = 'other';\n }\n\n if ($subtype) {\n $key .= ':' . $subtype;\n }\n\n // split ADR values into assoc array\n if ($tag == 'ADR') {\n list(,, $value['street'], $value['locality'], $value['region'], $value['zipcode'], $value['country']) = $raw;\n $out[$key][] = $value;\n }\n else {\n $out[$key][] = $raw[0];\n }\n }\n else {\n $out[$col][] = $raw;\n }\n }\n }\n\n // handle special IM fields as used by Apple\n foreach ($this->immap as $tag => $type) {\n foreach ((array)$this->raw[$tag] as $i => $raw) {\n $out['im:'.$type][] = $raw[0];\n }\n }\n\n // copy photo data\n if ($this->raw['PHOTO']) {\n $out['photo'] = $this->raw['PHOTO'][0][0];\n }\n\n return $out;\n }", "public function key_value_from_string( $text = '' ) {\n\t\tpreg_match( '/([^:]+)(;[^:]+)?[:]([\\w\\W]*)/', $text, $matches );\n\n\t\tif ( 0 == count( $matches ) )\n\t\t\treturn false;\n\n\t\treturn array( $matches[1], $matches[3] );\n\t}", "private function returnKeyValuePair($line) {\n\t//--\n\t$array = array();\n\t$key = '';\n\t//--\n\tif(strpos($line, ':') !== false) {\n\t\t// It's a key/value pair most likely\n\t\t// If the key is in double quotes pull it out\n\t\tif(($line[0] == '\"' || $line[0] == \"'\") && preg_match('/^([\"\\'](.*)[\"\\'](\\s)*:)/', $line, $matches)) {\n\t\t\t$value = trim(str_replace($matches[1], '', $line));\n\t\t\t$key = $matches[2];\n\t\t} else {\n\t\t\t// Do some guesswork as to the key and the value\n\t\t\t$explode = explode(':', $line);\n\t\t\t$key = trim($explode[0]);\n\t\t\tarray_shift($explode);\n\t\t\t$value = trim(implode(':', $explode));\n\t\t} //end if else\n\t\t// Set the type of the value. Int, string, etc\n\t\t$value = $this->_toType($value);\n\t\tif($key === '0') {\n\t\t\t$key = '__!YAMLZero';\n\t\t} //end if\n\t\t$array[$key] = $value;\n\t} else {\n\t\t$array = array ($line);\n\t} //end if else\n\t//--\n\treturn $array;\n\t//--\n}", "function decode($value,$key){\n \techo \"$key : $value\".\"\\n\";\n }", "static function VocabDataFromXML($rawResponse)\n {\n $xml = simplexml_load_string($rawResponse);\n $xml->registerXPathNamespace('wc', 'urn:com.microsoft.wc.methods.response.SearchVocabulary');\n $codeItemsXMLObjects = $xml->xpath('//code-item');\n\n $vocabData = [];\n\n foreach ($codeItemsXMLObjects as $item) {\n $newEntry['name'] = (string)$item->{'display-text'};\n $newEntry['code-value'] = (string)$item->{'code-value'};\n $vocabData[] = $newEntry;\n }\n\n return $vocabData;\n }", "function to_json_array($stg){\n $result = str_replace(\"[\",\"\",$stg);\n $result = str_replace(\"]\",\"\",$result);\n $details_array = json_decode($result, true);\n return $details_array;\n}", "protected function parseAdlibResponse() {\n $xml = new SimpleXMLElement($this->raw);\n $results = $xml->xpath('//record');\n $docs = array();\n foreach ($results as $result) {\n $doc = array();\n foreach ($this->fields as $field) {\n // check if we have multiple values\n $children = $this->getGroupedFieldByXpath($result, $field);\n // $children = $result->{$field}->children();\n if(empty($children)) {\n continue;\n }\n if (count($children) > 1) {\n $field_array = array();\n // get all values\n foreach ($children as $value) {\n if ((string) $value != '' && (string) $value != 'Array') {\n $field_array[] = $this->replaceTokenCharacters((string) $value);\n }\n else {\n $field_array[] = $this->replaceTokenCharacters((string) $value->value);\n }\n }\n // and put the resulting array in $doc[$field]\n $doc[$field] = $field_array;\n }\n else {\n // single value\n // First try if there is a result without value.\n if ((string) $children[0] !== '' && (string) $children[0] !== 'Array') {\n $doc[$field] = $this->replaceTokenCharacters((string) $children[0]);\n }\n else {\n $doc[$field] = $this->replaceTokenCharacters((string) $children[0]->value);\n }\n }\n }\n $doc['priref'] = (string) $xml->record->attributes()->priref;\n $doc['raw_xml'] = $result->asXML();\n $docs[] = $doc;\n }\n return $docs;\n }", "function s2o( $str, $assoc = false ) {\n\t\treturn json_decode( $str, $assoc );\n\t}", "private function decode($str) {\n if ($this->return_assoc) {\n return json_decode($str, true);\n }\n\n return json_decode($str);\n }", "abstract function parse_api_response();", "function toArray($str)\n\t{\n\t\t$tmpItemArr = array_filter(explode('-dlm-',$str));\n\t\tforeach ($tmpItemArr as &$value) {\n \t\t$ItemArr = explode('-spl-', $value);\n\t\t\t$arr[$ItemArr[0]]['id'] = &$ItemArr[0]; // Item ID\n\t\t\t$arr[$ItemArr[0]]['qty'] = &$ItemArr[1]; // Item Quantity\n\t\t\t$arr[$ItemArr[0]]['cp'] = &$ItemArr[2]; // Item custom price\n\t\t\t$arr[$ItemArr[0]]['order'] = &$ItemArr[3]; // Item order\n\t\t}\n\t\treturn $arr;\n\t}", "function answersArray($strInput)\t{\n\t\t$strLine=explode(chr(10),$strInput);\n\t\tforeach($strLine as $intKey => $strLineValue)\t{\n\t\t\t$strValue = explode('|',$strLineValue);\n\t\t\t$arrOutput[$intKey+1]=trim($strValue[0]);\n\t\t}\n\t\treturn $arrOutput;\n\t}", "public function getResponse() : array;", "private function retun_key_value($text)\n\t{\n\tpreg_match(\"/([^:]+)[:]([\\w\\W]+)/\", $text, $matches);\n\n\tif (empty($matches))\n\t{\n\t\treturn [false, $text];\n\t}\n\telse\n\t{\n\t\t$matches = array_splice($matches, 1, 2);\n\t\treturn $matches;\n\t}\n\t}", "protected function translateIpnData($ipnData)\n {\n if (empty($ipnData)) {\n $ipnData = array();\n } elseif (is_string($ipnData) && strpos($ipnData, '{') !== false) {\n $ipnData = Zend_Json::decode($ipnData);\n } elseif (is_string($ipnData)) {\n $ipnData = array($ipnData);\n }\n\n return $ipnData;\n }", "function _ra_decode ($value)\n {\n //_ra_decode supports decoding entire Arrays\n\n if (is_array($value)) {\n $temp_array = array();\n foreach ($value as $key => $val) {\n if ($this->sess_encryption) {\n $temp_array[$key] = $this->_ra_decode($val);\n } else {\n $temp_array[$key] = $val;\n }\n }\n return $temp_array;\n }\n if ($this->sess_encryption && is_string($value)) {\n $value = $this->CI->encrypt->decode($value);\n return $value;\n }\n return $value;\n }", "function unpack_SNAC($raw) {\r\n $snac = array(\r\n 'raw' => array(\r\n 'header' => substr($raw, 0, 10),\r\n 'body' => substr($raw, 10)\r\n ),\r\n 'header' => array()\r\n );\r\n $snac['header'] = unpack('n1family/n1id/n1flags/N1req_id', $snac['raw']['header']);\r\n return $snac;\r\n }", "function search_pk($string, $keyserver = '')\n\t{\n\t\t// matches limit\n\t\t$max = 50;\n\n\t\t// defining keyserver\n\t\tif (!$keyserver = $this->prepare_input($keyserver))\n\t\t{\n\t\t\t$keyserver = $this->engine->db->gpg_server;\n\t\t}\n\n\t\t// correcting search string\n\t\tif (str_starts_with($string = trim($string), '0x'))\n\t\t{\n\t\t\t$string = '=' . $string;\n\t\t}\n\n\t\t// requesting key search\n\t\tif ($list = $this->call(\"--keyserver $keyserver --search-key $string\"))\n\t\t{\n\t\t\t$n = 0;\n\t\t\t$results = [];\n\n\t\t\t// filling results array\n\t\t\tif ($rows = explode(\"\\n\", $list)) foreach ($rows as $row)\n\t\t\t{\n\t\t\t\t$cells = explode(':', $row);\n\n\t\t\t\t// new pubkey element\n\t\t\t\tif ($cells[0] == 'pub')\n\t\t\t\t{\n\t\t\t\t\tif (++$n > $max) break;\t\t// break flooding searches\n\n\t\t\t\t\t$type = match ($cells[2])\n\t\t\t\t\t{\n\t\t\t\t\t\t'1'\t\t=> 'RSA',\n\t\t\t\t\t\t'3'\t\t=> 'RSA-S',\n\t\t\t\t\t\t'17'\t\t=> 'DSA',\n\t\t\t\t\t\tdefault\t=> 'Undefined',\n\t\t\t\t\t};\n\n\t\t\t\t\t$results[$key_id = $cells[1]] = [\n\t\t\t\t\t\t0 => $type,\n\t\t\t\t\t\t1 => (int) $cells[3],\n\t\t\t\t\t\t2 => (int) $cells[4],\n\t\t\t\t\t\t3 => trim($cells[6]),\n\t\t\t\t\t\t4 => []\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t\t// uid for the current pubkey element\n\t\t\t\telse if ($cells[0] == 'uid')\n\t\t\t\t{\n\t\t\t\t\t$results[$key_id][4][$cells[1]] = (int) $cells[2];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $results;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "function MesiboParseResponse($response) {\n\t$result = json_decode($response, true);\n\tif(is_null($result)) \n\t\treturn false;\n\treturn $result;\n}", "public function lookup($string){\r\n $url = \"https://maps.googleapis.com/maps/api/geocode/json?address=\".urlencode($string).\"&key=AIzaSyBCltWRQRrRFBsRh9WUQ53KVbj3Nm6xc6s\";//we are getting the response in json &key=AIzaSyBCltWRQRrRFBsRh9WUQ53KVbj3Nm6xc6s\r\n // get the json response\r\n $resp_json = file_get_contents($url);\r\n // decode the json\r\n $resp = json_decode($resp_json, true);\r\n //the response status would be 'OK', if are able to geocode the given address\r\n if($resp['status']=='OK') {\r\n // get the longtitude and latitude data\r\n $array = array(\r\n 'lat' => $resp['results'][0]['geometry']['location']['lat'],\r\n 'long' => $resp['results'][0]['geometry']['location']['lng'],\r\n );\r\n\r\n return $array;\r\n }else{\r\n $val = 'Geocode API failure';\r\n return $val;\r\n }\r\n }", "function print_response($response) {\n foreach($response as $value) {\n if (is_array($value)) {\n print_response($value);\n }\n else {\n print sm_encode_html_special_chars($value).\"<br />\\n\";\n }\n }\n}", "function _xmlToArray($rootTag, $sXml)\n\t{\n\t\t$aArray = array();\n\t\t$sXml = str_replace(\"<$rootTag>\",\"<$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</$rootTag>\",\"</$rootTag>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<e>\",\"<e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</e>\",\"</e>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<k>\",\"<k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</k>\",\"|~|</k>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<v>\",\"<v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</v>\",\"|~|</v>|~|\",$sXml);\n\t\t$sXml = str_replace(\"<q>\",\"<q>|~|\",$sXml);\n\t\t$sXml = str_replace(\"</q>\",\"|~|</q>|~|\",$sXml);\n\n\t\t$this->aObjArray = explode(\"|~|\",$sXml);\n\n\t\t$this->iPos = 0;\n\t\t$aArray = $this->_parseObjXml($rootTag);\n\n\t\tif ($this->bDecodeUTF8Input)\n\t\t{\n\t\t\tforeach ($aArray as $sKey => $sValue)\n\t\t\t{\n\t\t\t\t$aArray[$sKey] = $this->_decodeUTF8Data($sValue);\n\t\t\t}\n\t\t}\n\n\t\treturn $aArray;\n\t}", "private function parse_result(){\n return json_decode($this->result);\n }", "private function parserString($producString){\n $arrayProduc = preg_split(\"/[\\t]/\", $producString);\n \n $initDate = $this->createDataTime($arrayProduc[3]);\n $expiryDate = $this->createDataTime($arrayProduc[4]);\n \n $producData = array(\n \"title\" => $arrayProduc[0],\n \"description\" => $arrayProduc[1],\n \"price\" => $arrayProduc[2],\n \"init\" => $initDate,\n \"expiry\" => $expiryDate,\n \"address\" => $arrayProduc[5],\n \"name\" => $arrayProduc[6],\n \"textOrigiin\" => $producString\n );\n \n return $producData;\n }", "function translate_parse($dataStr)\n\t\t{\n\t\t if($dataStr)\n\t\t {\n\t\t\t $arr = json_decode($dataStr,true); \n\t\t\t\t return $arr['responseData']['translatedText'];\n\t\t }\n\t\t return \"\";\n\t\t}", "public function decode($array = null)\n {\n foreach($array as $name => $value) {\n if(is_array($value)) {\n $value = Mage::helper('vm2mage')->decode($value);\n } elseif(!empty($value) && preg_match('/^V2M___/', $value)) {\n $value = preg_replace('/^V2M___/', '', $value);\n $value = base64_decode($value);\n }\n\n if(!empty($value)) {\n $array[$name] = $value;\n }\n }\n return $array;\n }", "public function getUbicNv(){\n\t\t\n\t\t$nv1 = $this->input->post('id_nv1');\n\t\t$jsonNv1 = array();\n\n\t\tif($nv1 == NULL || $nv1 == \"\"){\n\t\t\t$jsonNv1['response_code'] = \"201\";\n\t\t\t$jsonNv1['response_msg'] = \"El nv 1 no puede estar boorado\";\n\t\t}else{\n\t\t\t$jsonNv1['response_code'] = \"200\";\n\t\t\t$jsonNv1['response_msg'] = \"Exito!\";\n\t\t\t$jsonNv1['nvlUbic'] = $this->CatalogoAlmacen_model->getCatalogoAlmacen('A');\n\t\t}\n\t\techo json_encode($jsonNv1);\n\t}", "public function parse_str_raw($str, &$array=array()) {\n\t\t$str = rawurldecode($str);\n\t\t$str = trim($str, $sep1.' ');\n\t\t$arr = explode($sep1, $str);\n\t\t\n\t\t$result = array();\n\t\tif (count($arr)) {\n\t\t\tforeach ($arr AS $_str) {\n\t\t\t\t$_arr = explode($sep2, $_str);\n\t\t\t\t$_arr[0] = trim($_arr[0]);\n\t\t\t\tif ($_arr[0] !== '') {\n\t\t\t\t\t$result[$_arr[0]] = isset($_arr[1])?trim($_arr[1]):'';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$array = $result;\n\t}", "public function getIntroducer()\n {\n $term = Input::get('term');\n $associate = array();\n $search = DB::select(\n \"\n select id , rank_id ,associate_no as value ,CONCAT(name ,' ID ',associate_no) as label\n from associates\n where match (name, associate_no )\n against ('+{$term}*' IN BOOLEAN MODE)\n \"\n );\n\n foreach ($search as $result) {\n $associate[] = $result;\n\n }\n\n return json_encode($associate);\n\n }", "function searchPinNum($search){\n \n $queryString =\"\";\n $i = 0;\n $len = count($search);\n foreach ($search as $key => $value) {\n if ($i == $len - 1) {\n // last\n $queryString .= \" \" . $key . \"= '\" . $value . \"'\";\n } else {\n $queryString .= \" \" . $key . \"= '\" . $value . \"' AND\";\n $i++;\n }\n }\n\n // Database connection \n $conn = database_connection();\n \n $sql = \"SELECT CHANNEL_MAP_ID,SECTOR,CONN_PIN FROM CMS_GEM_MUON_COND.GEM_VFAT_CHANNELS WHERE\". $queryString . \"ORDER BY CONN_PIN ASC\" ;\n// echo $sql;\n $query = oci_parse($conn, $sql);\n //Oci_bind_by_name($query,':bind_name',$bind_para); //if needed\n $arr = oci_execute($query);\n\n $result = array();\n $itr = array();\n// CHANNEL_MAP_ID\n//SUBDET\n//SECTOR\n//TYPE\n//ZPOSN\n//IETA\n//IPHI\n//DEPTH\n//VFAT_POSN\n//DET_STRIP\n//VFAT_CHAN\n//CONN_PIN\n while ($row = oci_fetch_array($query, OCI_ASSOC + OCI_RETURN_NULLS)) {\n $itr['CONN_PIN'] = $row['CONN_PIN'];\n $itr['SECTOR'] = $row['SECTOR'];\n $result [$row['CHANNEL_MAP_ID']] = $itr;\n \n \n }\n \n return $result;\n}", "public static function getResponse1013() {\n\n return '{\"indicator\":{\"name\":\"Término de facturación de energía activa del PVPC peaje por defecto\",\"short_name\":\"PVPC T. Defecto\",\"id\":1013,\"composited\":false,\"step_type\":\"linear\",\"disaggregated\":false,\"magnitud\":[{\"name\":\"Precio\",\"id\":23}],\"tiempo\":[{\"name\":\"Hora\",\"id\":4}],\"geos\":[{\"geo_id\":3,\"geo_name\":\"España\"}],\"values_updated_at\":\"2017-03-01T21:01:30.000+01:00\",\"values\":[{\"value\":116.62,\"datetime\":\"2017-03-01T00:00:00.000+01:00\",\"datetime_utc\":\"2017-02-28T23:00:00Z\",\"tz_time\":\"2017-02-28T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.32,\"datetime\":\"2017-03-01T01:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T00:00:00Z\",\"tz_time\":\"2017-03-01T00:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.17,\"datetime\":\"2017-03-01T02:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T01:00:00Z\",\"tz_time\":\"2017-03-01T01:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.71,\"datetime\":\"2017-03-01T03:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T02:00:00Z\",\"tz_time\":\"2017-03-01T02:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.73,\"datetime\":\"2017-03-01T04:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T03:00:00Z\",\"tz_time\":\"2017-03-01T03:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":108.94,\"datetime\":\"2017-03-01T05:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T04:00:00Z\",\"tz_time\":\"2017-03-01T04:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.5,\"datetime\":\"2017-03-01T06:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T05:00:00Z\",\"tz_time\":\"2017-03-01T05:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.41,\"datetime\":\"2017-03-01T07:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T06:00:00Z\",\"tz_time\":\"2017-03-01T06:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.35,\"datetime\":\"2017-03-01T08:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T07:00:00Z\",\"tz_time\":\"2017-03-01T07:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":119.0,\"datetime\":\"2017-03-01T09:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T08:00:00Z\",\"tz_time\":\"2017-03-01T08:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":118.97,\"datetime\":\"2017-03-01T10:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T09:00:00Z\",\"tz_time\":\"2017-03-01T09:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":117.2,\"datetime\":\"2017-03-01T11:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T10:00:00Z\",\"tz_time\":\"2017-03-01T10:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.84,\"datetime\":\"2017-03-01T12:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T11:00:00Z\",\"tz_time\":\"2017-03-01T11:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":114.1,\"datetime\":\"2017-03-01T13:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T12:00:00Z\",\"tz_time\":\"2017-03-01T12:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":113.76,\"datetime\":\"2017-03-01T14:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T13:00:00Z\",\"tz_time\":\"2017-03-01T13:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":111.74,\"datetime\":\"2017-03-01T15:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T14:00:00Z\",\"tz_time\":\"2017-03-01T14:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":107.47,\"datetime\":\"2017-03-01T16:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T15:00:00Z\",\"tz_time\":\"2017-03-01T15:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":110.25,\"datetime\":\"2017-03-01T17:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T16:00:00Z\",\"tz_time\":\"2017-03-01T16:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":116.76,\"datetime\":\"2017-03-01T18:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T17:00:00Z\",\"tz_time\":\"2017-03-01T17:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.51,\"datetime\":\"2017-03-01T19:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T18:00:00Z\",\"tz_time\":\"2017-03-01T18:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.13,\"datetime\":\"2017-03-01T20:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T19:00:00Z\",\"tz_time\":\"2017-03-01T19:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.15,\"datetime\":\"2017-03-01T21:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T20:00:00Z\",\"tz_time\":\"2017-03-01T20:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":121.9,\"datetime\":\"2017-03-01T22:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T21:00:00Z\",\"tz_time\":\"2017-03-01T21:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":120.44,\"datetime\":\"2017-03-01T23:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T22:00:00Z\",\"tz_time\":\"2017-03-01T22:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"},{\"value\":123.3,\"datetime\":\"2017-03-02T00:00:00.000+01:00\",\"datetime_utc\":\"2017-03-01T23:00:00Z\",\"tz_time\":\"2017-03-01T23:00:00.000Z\",\"geo_id\":3,\"geo_name\":\"España\"}]}}';\n }", "function fusion_string_to_array( $string ) {\n\n\t// If already an array, return early.\n\tif ( is_array( $string ) ) {\n\t\treturn $string;\n\t}\n\n\t$string = stripslashes( $string );\n\n\tif ( empty( $string ) ) {\n\t\treturn false;\n\t}\n\n\t$result = [];\n\t$pairs = explode( '&', $string );\n\n\tforeach ( $pairs as $key => $pair ) {\n\t\t// Use the original parse_str() on each element.\n\t\tparse_str( $pair, $params );\n\n\t\t$k = key( $params );\n\n\t\tif ( ! isset( $result[ $k ] ) ) {\n\t\t\t$result += $params;\n\t\t} else {\n\t\t\t$result[ $k ] = fusion_array_merge_recursive( $result[ $k ], $params[ $k ] );\n\t\t}\n\t}\n\n\treturn $result;\n}", "function pl_array($input)\n{\n if(!empty($input) && is_array($input)) {\n foreach($input as $key => $value) {\n pl(\"[\" .$key. \"] => \" . $value);\n }\n }\n}", "public function getAuthDataFromResponse(): array;", "function alr_clima_provincias()\n{\n\t$response=array();\n\t$feed_url = \"http://api.tiempo.com/index.php?api_lang=ar&pais=67&affiliate_id=jcp8s666brbh\";\n\t$curl = curl_init();\n\tcurl_setopt($curl, CURLOPT_URL,$feed_url);\n\tcurl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\tcurl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 0);\n\t$xmlProv = curl_exec($curl);\n\tif(curl_errno($curl)==0) \n\t{\n\t\t$xml = simplexml_load_string($xmlProv);\n\t\tif(isset($xml->location->data[0]->name)) \n\t\t{\n\t\t\t$x=0;\n\t\t\tforeach ($xml->location->data as $prov) \n\t\t\t{\n\t\t\t\t$pid=intval($prov->name->attributes()->id);\n\t\t\t\t$response[$pid]=(string) $prov->name;\n\t\t\t\t$x++;\t \t\n \t }\n\t\t}\n\t}\n\tcurl_close($curl);\t\t\t\n\treturn $response;\n}", "public function debugNVP($type = 'array') {\n if($type == 'array') {\n return $this->NVP; \n }\n else {\n return $this->getNVP();\n }\n }", "abstract public function toAssoc(): array;", "public function parseDataForKey($fullKey)\n {\n $arrayOfStrings = $this->appListStrings;\n $keys = explode('.', $fullKey);\n foreach ($keys as $key) {\n if (isset($arrayOfStrings[$key])) {\n $arrayOfStrings = $arrayOfStrings[$key];\n } else {\n throw new \\SugarRestHarness\\RandomDataKeyIsInvalid($fullKey, $key);\n }\n }\n \n if (!empty($arrayOfStrings)) {\n if (is_array($arrayOfStrings)) {\n return $arrayOfStrings;\n } else {\n return array($arrayOfStrings);\n }\n } else {\n return array();\n }\n }", "private function unserializeInvoices($str) {\n\t\t$invoices = array();\n\t\t$temp = explode(\"|\", $str);\n\t\tforeach ($temp as $pair) {\n\t\t\t$pairs = explode(\"=\", $pair, 2);\n\t\t\tif (count($pairs) != 2)\n\t\t\t\tcontinue;\n\t\t\t$invoices[] = array('id' => $pairs[0], 'amount' => $pairs[1]);\n\t\t}\n\t\treturn $invoices;\n\t}", "function _parseObjXml($rootTag)\n\t{\n\t\t$aArray = array();\n\n\t\tif ($rootTag == \"xjxobj\")\n\t\t{\n\t\t\twhile(!stristr($this->aObjArray[$this->iPos],\"</xjxobj>\"))\n\t\t\t{\n\t\t\t\t$this->iPos++;\n\t\t\t\tif(stristr($this->aObjArray[$this->iPos],\"<e>\"))\n\t\t\t\t{\n\t\t\t\t\t$key = \"\";\n\t\t\t\t\t$value = null;\n\n\t\t\t\t\t$this->iPos++;\n\t\t\t\t\twhile(!stristr($this->aObjArray[$this->iPos],\"</e>\"))\n\t\t\t\t\t{\n\t\t\t\t\t\tif(stristr($this->aObjArray[$this->iPos],\"<k>\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->iPos++;\n\t\t\t\t\t\t\twhile(!stristr($this->aObjArray[$this->iPos],\"</k>\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$key .= $this->aObjArray[$this->iPos];\n\t\t\t\t\t\t\t\t$this->iPos++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(stristr($this->aObjArray[$this->iPos],\"<v>\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->iPos++;\n\t\t\t\t\t\t\twhile(!stristr($this->aObjArray[$this->iPos],\"</v>\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(stristr($this->aObjArray[$this->iPos],\"<xjxobj>\"))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$value = $this->_parseObjXml(\"xjxobj\");\n\t\t\t\t\t\t\t\t\t$this->iPos++;\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{\n\t\t\t\t\t\t\t\t\t$value .= $this->aObjArray[$this->iPos];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$this->iPos++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this->iPos++;\n\t\t\t\t\t}\n\n\t\t\t\t\t$aArray[$key]=$value;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ($rootTag == \"xjxquery\")\n\t\t{\n\t\t\t$sQuery = \"\";\n\t\t\t$this->iPos++;\n\t\t\twhile(!stristr($this->aObjArray[$this->iPos],\"</xjxquery>\"))\n\t\t\t{\n\t\t\t\tif (stristr($this->aObjArray[$this->iPos],\"<q>\") || stristr($this->aObjArray[$this->iPos],\"</q>\"))\n\t\t\t\t{\n\t\t\t\t\t$this->iPos++;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$sQuery\t.= $this->aObjArray[$this->iPos];\n\t\t\t\t$this->iPos++;\n\t\t\t}\n\n\t\t\tparse_str($sQuery, $aArray);\n\t\t\t// If magic quotes is on, then we need to strip the slashes from the\n\t\t\t// array values because of the parse_str pass which adds slashes\n\t\t\tif (get_magic_quotes_gpc() == 1) {\n\t\t\t\t$newArray = array();\n\t\t\t\tforeach ($aArray as $sKey => $sValue) {\n\t\t\t\t\tif (is_string($sValue))\n\t\t\t\t\t\t$newArray[$sKey] = stripslashes($sValue);\n\t\t\t\t\telse\n\t\t\t\t\t\t$newArray[$sKey] = $sValue;\n\t\t\t\t}\n\t\t\t\t$aArray = $newArray;\n\t\t\t}\n\t\t}\n\n\t\treturn $aArray;\n\t}", "private function parseCert($pemCertificateFileName){\n if (empty($pemCertificateFileName)){\n throw new Exception(\"Given param PEMCERTIFICATEFILENAME can not be empty.\");\n }\n\n $r = array(\n \"serial\" => \"\",\n \"version\" => \"\",\n \"valid_from\" => \"\",\n \"valid_to\" => \"\",\n \"subject\" => array(\n \"serial\" => \"\",\n \"ou\" => \"\",\n \"o\" => \"\",\n \"cn\" => \"\",\n \"c\" => \"\",\n \"st\" => \"\",\n \"l\" => \"\",\n ),\n \"issuer\" => array(\n \"ou\" => \"\",\n \"o\" => \"\",\n \"cn\" => \"\",\n \"c\" => \"\",\n )\n );\n\n $cmd = sprintf(\"openssl asn1parse -inform PEM -in %s\", $pemCertificateFileName);\n $output = exec($cmd, $fullOutput);\n\n $patternOrganizationName= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:organizationName\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countOrganizationName = preg_match_all($patternOrganizationName, implode(\"<>\", $fullOutput), $matches);\n if($countOrganizationName == 1){\n $r[\"subject\"][\"o\"] = $matches[2][0];\n } else if($countOrganizationName == 2){\n $r[\"issuer\"][\"o\"] = $matches[2][0];\n $r[\"subject\"][\"o\"] = $matches[2][1];\n }\n\n $patternCountryName= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:countryName\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countCountryName = preg_match_all($patternCountryName, implode(\"<>\", $fullOutput), $matches);\n if($countCountryName == 1){\n $r[\"subject\"][\"c\"] = $matches[2][0];\n } else if($countCountryName == 2){\n $r[\"issuer\"][\"c\"] = $matches[2][0];\n $r[\"subject\"][\"c\"] = $matches[2][1];\n }\n\n $patternCommonName= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:commonName\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countCommonName = preg_match_all($patternCommonName, implode(\"<>\", $fullOutput), $matches);\n if($countCommonName == 1){\n $r[\"subject\"][\"cn\"] = $matches[2][0];\n } else if($countCommonName == 2){\n $r[\"issuer\"][\"cn\"] = $matches[2][0];\n $r[\"subject\"][\"cn\"] = $matches[2][1];\n }\n\n $patternSerial= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*OBJECT\\s*:serialNumber\\s*<>\\s*\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*(UTF8STRING|PRINTABLESTRING)\\s*:([^<>]*)\\s*<>/\";\n $countSerial = preg_match_all($patternSerial, implode(\"<>\", $fullOutput), $matches);\n if($countSerial == 1){\n $r[\"subject\"][\"serial\"] = $matches[2][0];\n }\n\n $patternVersion= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*INTEGER\\s*:([^<>]*)\\s*<>/\";\n $countVersion = preg_match_all($patternVersion, implode(\"<>\", $fullOutput), $matches);\n if($countVersion == 1){\n $r[\"version\"] = $matches[1][0];\n }\n if($countVersion == 2){\n $r[\"version\"] = $matches[1][0];\n $r[\"serial\"] = $matches[1][1];\n }\n\n $patternTime= \"/\\d+:d=\\d+\\s*hl=\\d+\\s*l=\\s*\\d+\\s*prim:\\s*UTCTIME\\s*:([^<>]*)\\s*<>/\";\n $countTime = preg_match_all($patternTime, implode(\"<>\", $fullOutput), $matches);\n if($countTime == 2){\n $r[\"valid_from\"] = $this->parseUTCTime($matches[1][0]);\n $r[\"valid_to\"] = $this->parseUTCTime($matches[1][1]);\n }\n\n return $r;\n }", "#[ArrayShape([\"bits\" => \"int\", \"key\" => \"string\", \"rsa\" => \"array\", \"dsa\" => \"array\", \"dh\" => \"array\", \"type\" => \"int\"])]\nfunction openssl_pkey_get_details(#[LanguageLevelTypeAware([\"8.0\" => \"OpenSSLAsymmetricKey\"], default: \"resource\")] $key): array|false {}", "function ussd_string_to_array($ussd_string){\n return explode(\"*\",$ussd_string);\n}", "function processResponse($strResponse) {\n\t\tlist($theHeaders, $theBody) = explode(\"\\r\\n\\r\\n\", $strResponse, 2);\n\t\treturn array('headers' => $theHeaders, 'body' => $theBody);\n\t}", "function parseNotes($response){\n\t$notes = json_decode($response);\n\tif (is_array($notes)){\n\t\treturn $notes;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function system_get_all_unames()\n{\n\t$retv[id1]=100;\n\t$retv[uname1]=\"tt\";\n\treturn($retv);\n}", "public function toAssociativeArray() {\n // TODO\n }", "public function toAssociativeArray() {\n // TODO\n }", "function prli_json_decode(&$json_str,$type='array',$index = 0)\n {\n $json_array = array();\n $index_str = '';\n $value_str = '';\n $in_string = false;\n $in_index = ($type=='hash'); //first char in hash is an index\n $in_value = ($type=='array'); //first char in array is a value\n\n $json_special_chars_array = array('{','[','}',']','\"',',',':');\n\n // On the first pass we need to do some special stuff\n if($index == 0)\n {\n if($json_str[$index] == '{')\n {\n $type = 'hash';\n $in_index = true;\n $in_value = false;\n }\n else if($json_str[$index]=='[')\n {\n $type = 'array';\n $in_index = false;\n $in_value = true;\n }\n else\n return false; // not valid json\n\n // skip to next index\n $index++;\n }\n\n for($i = $index; $i < strlen($json_str); $i++)\n {\n if($in_string and in_array($json_str[$i],$json_special_chars_array))\n {\n if($json_str[$i] == '\"')\n $in_string = false;\n else\n {\n if($in_value)\n $value_str .= $json_str[$i];\n else if($in_index)\n $index_str .= $json_str[$i];\n }\n }\n else\n {\n switch($json_str[$i])\n {\n case '{':\n $array_vals = $this->prli_json_decode($json_str,'hash',$i + 1);\n\n if($type=='hash')\n $json_array[$index_str] = $array_vals[1]; // We'll never get an array as an index\n else if($type=='array')\n $json_array[] = $array_vals[1];\n\n $i = $array_vals[0]; // Skip ahead to the new index\n break;\n\n case '[':\n $array_vals = $this->prli_json_decode($json_str,'array',$i + 1);\n\n if($type=='hash')\n $json_array[$index_str] = $array_vals[1];\n else if($type=='array')\n $json_array[] = $array_vals[1];\n\n $i = $array_vals[0]; // Skip ahead to the new index\n break;\n\n case '}':\n if(!empty($index_str) and !empty($value_str))\n {\n $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);\n $index_str = '';\n $value_str = '';\n }\n return array($i,$json_array);\n\n case ']':\n if(!empty($value_str))\n {\n $json_array[] = $this->prli_decode_json_unicode($value_str);\n $value_str = '';\n }\n return array($i,$json_array);\n\n // skip the null character\n case '\\0':\n break;\n\n // Handle Escapes\n case '\\\\':\n if($in_string)\n {\n if(in_array($json_str[$i + 1],$json_special_chars_array))\n {\n if($in_value)\n $value_str .= '\\\\'.$json_str[$i + 1];\n else if($in_index)\n $index_str .= '\\\\'.$json_str[$i + 1];\n\n $i++; // skip the escaped char now that its been recorded\n }\n else\n {\n if($in_value)\n $value_str .= $json_str[$i];\n else if($in_index)\n $index_str .= $json_str[$i];\n }\n }\n break;\n\n case '\"':\n $in_string = !$in_string; // just tells us if we're in a string\n break;\n\n case ':':\n if($type == 'hash')\n {\n $in_value = true;\n $in_index = false;\n }\n break;\n\n case ',':\n if($type == 'hash')\n {\n if(!empty($index_str) and !empty($value_str))\n {\n $json_array[$index_str] = $this->prli_decode_json_unicode($value_str);\n $index_str = '';\n $value_str = '';\n }\n\n $in_index = true;\n $in_value = false;\n }\n else if($type == 'array')\n {\n if(!empty($value_str))\n {\n $json_array[] = $this->prli_decode_json_unicode($value_str);\n $value_str = '';\n }\n\n $in_value = true;\n $in_index = false; // always false in an array\n }\n break;\n\n // record index and value\n default:\n if($in_value)\n $value_str .= $json_str[$i];\n else if($in_index)\n $index_str .= $json_str[$i];\n }\n }\n }\n\n return array(-1,$json_array);\n }", "function decode($string);", "abstract function getPairsFromAPI();", "private function retrieveData($method, $response)\n {\n if ($method === 'verifyipn') {\n return $response;\n }\n\n parse_str($response, $output);\n\n return $output;\n }", "function protx_vsp_get_associative_array($separator, $input)\n\t{\n\t\tfor ($i=0; $i < count($input); $i++) {\n\t\t\t$splitAt = strpos($input[$i], $separator);\n\t\t\t$output[trim(substr($input[$i], 0, $splitAt))] = trim(substr($input[$i], ($splitAt+1)));\n\t\t}\n\t\treturn $output;\n\t}", "function parse_oid($string)\n{\n $result = array();\n while (true)\n {\n $matches = array();\n $match_count = preg_match('/^(?:((?:[^\\\\\\\\\\\\. \"]|(?:\\\\\\\\.))+)|(?:\"((?:[^\\\\\\\\\"]|(?:\\\\\\\\.))+)\"))((?:[\\\\. ])|$)/', $string, $matches);\n if (null !== $match_count && $match_count > 0)\n {\n // [1] = unquoted, [2] = quoted\n $value = strlen($matches[1]) > 0 ? $matches[1] : $matches[2];\n $result[] = stripslashes($value);\n\n // Are we expecting any more parts?\n if (strlen($matches[3]) > 0)\n {\n // I do this (vs keeping track of offset) to use ^ in regex\n $string = substr($string, strlen($matches[0]));\n }\n else\n {\n $ret['value'] = array_pop($result);\n $ret['oid'] = $result;\n return $ret;\n }\n }\n else\n {\n // All or nothing\n return null;\n }\n } // while\n}", "function parse_query($str) {\n \n $str = html_entity_decode($str);\n\n $arr = array();\n \n $pairs = explode('&', $str);\n \n foreach ($pairs as $i) {\n list($name,$value) = explode('=', $i, 2);\n\n if (isset($arr[$name])) {\n if (is_array($arr[$name])) {\n $arr[$name][] = $value;\n }\n else {\n $arr[$name] = array($arr[$name], $value);\n }\n }\n else {\n $arr[$name] = $value;\n }\n }\n return $arr;\n }", "function get_country_by_rdap($query, $real_time_data = false) {\n // Make sure given query is ip address\n if(filter_var($query, FILTER_VALIDATE_IP)) {\n $ip = $query;\n\n // Perform request depending on whether ip address is ipv4 or ipv6\n if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {\n $iana_ipv4 = [\"description\"=>\"RDAP bootstrap file for IPv4 address allocations\",\"publication\"=>\"2019-06-07T19:00:02Z\",\"services\"=>[[[\"41.0.0.0/8\",\"102.0.0.0/8\",\"105.0.0.0/8\",\"154.0.0.0/8\",\"196.0.0.0/8\",\"197.0.0.0/8\"],[\"https://rdap.afrinic.net/rdap/\",\"http://rdap.afrinic.net/rdap/\"]],[[\"1.0.0.0/8\", \"14.0.0.0/8\", \"27.0.0.0/8\", \"36.0.0.0/8\", \"39.0.0.0/8\", \"42.0.0.0/8\", \"43.0.0.0/8\", \"49.0.0.0/8\", \"58.0.0.0/8\", \"59.0.0.0/8\", \"60.0.0.0/8\", \"61.0.0.0/8\", \"101.0.0.0/8\", \"103.0.0.0/8\", \"106.0.0.0/8\", \"110.0.0.0/8\", \"111.0.0.0/8\", \"112.0.0.0/8\", \"113.0.0.0/8\", \"114.0.0.0/8\", \"115.0.0.0/8\", \"116.0.0.0/8\", \"117.0.0.0/8\", \"118.0.0.0/8\", \"119.0.0.0/8\", \"120.0.0.0/8\", \"121.0.0.0/8\", \"122.0.0.0/8\", \"123.0.0.0/8\", \"124.0.0.0/8\", \"125.0.0.0/8\", \"126.0.0.0/8\", \"133.0.0.0/8\", \"150.0.0.0/8\", \"153.0.0.0/8\", \"163.0.0.0/8\", \"171.0.0.0/8\", \"175.0.0.0/8\", \"180.0.0.0/8\", \"182.0.0.0/8\", \"183.0.0.0/8\", \"202.0.0.0/8\", \"203.0.0.0/8\", \"210.0.0.0/8\", \"211.0.0.0/8\", \"218.0.0.0/8\", \"219.0.0.0/8\", \"220.0.0.0/8\", \"221.0.0.0/8\", \"222.0.0.0/8\", \"223.0.0.0/8\"], [\"https://rdap.apnic.net/\"]], [[\"3.0.0.0/8\", \"4.0.0.0/8\", \"6.0.0.0/8\", \"7.0.0.0/8\", \"8.0.0.0/8\", \"9.0.0.0/8\", \"11.0.0.0/8\", \"12.0.0.0/8\", \"13.0.0.0/8\", \"15.0.0.0/8\", \"16.0.0.0/8\", \"17.0.0.0/8\", \"18.0.0.0/8\", \"19.0.0.0/8\", \"20.0.0.0/8\", \"21.0.0.0/8\", \"22.0.0.0/8\", \"23.0.0.0/8\", \"24.0.0.0/8\", \"26.0.0.0/8\", \"28.0.0.0/8\", \"29.0.0.0/8\", \"30.0.0.0/8\", \"32.0.0.0/8\", \"33.0.0.0/8\", \"34.0.0.0/8\", \"35.0.0.0/8\", \"38.0.0.0/8\", \"40.0.0.0/8\", \"44.0.0.0/8\", \"45.0.0.0/8\", \"47.0.0.0/8\", \"48.0.0.0/8\", \"50.0.0.0/8\", \"52.0.0.0/8\", \"54.0.0.0/8\", \"55.0.0.0/8\", \"56.0.0.0/8\", \"63.0.0.0/8\", \"64.0.0.0/8\", \"65.0.0.0/8\", \"66.0.0.0/8\", \"67.0.0.0/8\", \"68.0.0.0/8\", \"69.0.0.0/8\", \"70.0.0.0/8\", \"71.0.0.0/8\", \"72.0.0.0/8\", \"73.0.0.0/8\", \"74.0.0.0/8\", \"75.0.0.0/8\", \"76.0.0.0/8\", \"96.0.0.0/8\", \"97.0.0.0/8\", \"98.0.0.0/8\", \"99.0.0.0/8\", \"100.0.0.0/8\", \"104.0.0.0/8\", \"107.0.0.0/8\", \"108.0.0.0/8\", \"128.0.0.0/8\", \"129.0.0.0/8\", \"130.0.0.0/8\", \"131.0.0.0/8\", \"132.0.0.0/8\", \"134.0.0.0/8\", \"135.0.0.0/8\", \"136.0.0.0/8\", \"137.0.0.0/8\", \"138.0.0.0/8\", \"139.0.0.0/8\", \"140.0.0.0/8\", \"142.0.0.0/8\", \"143.0.0.0/8\", \"144.0.0.0/8\", \"146.0.0.0/8\", \"147.0.0.0/8\", \"148.0.0.0/8\", \"149.0.0.0/8\", \"152.0.0.0/8\", \"155.0.0.0/8\", \"156.0.0.0/8\", \"157.0.0.0/8\", \"158.0.0.0/8\", \"159.0.0.0/8\", \"160.0.0.0/8\", \"161.0.0.0/8\", \"162.0.0.0/8\", \"164.0.0.0/8\", \"165.0.0.0/8\", \"166.0.0.0/8\", \"167.0.0.0/8\", \"168.0.0.0/8\", \"169.0.0.0/8\", \"170.0.0.0/8\", \"172.0.0.0/8\", \"173.0.0.0/8\", \"174.0.0.0/8\", \"184.0.0.0/8\", \"192.0.0.0/8\", \"198.0.0.0/8\", \"199.0.0.0/8\", \"204.0.0.0/8\", \"205.0.0.0/8\", \"206.0.0.0/8\", \"207.0.0.0/8\", \"208.0.0.0/8\", \"209.0.0.0/8\", \"214.0.0.0/8\", \"215.0.0.0/8\", \"216.0.0.0/8\"], [\"https://rdap.arin.net/registry/\", \"http://rdap.arin.net/registry/\"]], [[\"2.0.0.0/8\", \"5.0.0.0/8\", \"25.0.0.0/8\", \"31.0.0.0/8\", \"37.0.0.0/8\", \"46.0.0.0/8\", \"51.0.0.0/8\", \"53.0.0.0/8\", \"57.0.0.0/8\", \"62.0.0.0/8\", \"77.0.0.0/8\", \"78.0.0.0/8\", \"79.0.0.0/8\", \"80.0.0.0/8\", \"81.0.0.0/8\", \"82.0.0.0/8\", \"83.0.0.0/8\", \"84.0.0.0/8\", \"85.0.0.0/8\", \"86.0.0.0/8\", \"87.0.0.0/8\", \"88.0.0.0/8\", \"89.0.0.0/8\", \"90.0.0.0/8\", \"91.0.0.0/8\", \"92.0.0.0/8\", \"93.0.0.0/8\", \"94.0.0.0/8\", \"95.0.0.0/8\", \"109.0.0.0/8\", \"141.0.0.0/8\", \"145.0.0.0/8\", \"151.0.0.0/8\", \"176.0.0.0/8\", \"178.0.0.0/8\", \"185.0.0.0/8\", \"188.0.0.0/8\", \"193.0.0.0/8\", \"194.0.0.0/8\", \"195.0.0.0/8\", \"212.0.0.0/8\", \"213.0.0.0/8\", \"217.0.0.0/8\"], [\"https://rdap.db.ripe.net/\"]], [[\"177.0.0.0/8\", \"179.0.0.0/8\", \"181.0.0.0/8\", \"186.0.0.0/8\", \"187.0.0.0/8\", \"189.0.0.0/8\", \"190.0.0.0/8\", \"191.0.0.0/8\", \"200.0.0.0/8\", \"201.0.0.0/8\"], [\"https://rdap.lacnic.net/rdap/\"]]], \"version\"=> \"1.0\"];\n if($real_time_data) {\n $iana_ipv4 = file_get_contents(\"http://data.iana.org/rdap/ipv4.json\");\n if(is_bool($iana_ipv4)) {\n return null;\n }\n $iana_ipv4 = json_decode($iana_ipv4, true);\n }\n $ip_parts = explode(\".\", $ip);\n foreach ($iana_ipv4[\"services\"] as $service) {\n foreach ($service[0] as $ip_range) {\n if($ip_range == $ip_parts[0].\".0.0.0/8\") {\n $service_rdap = file_get_contents(preg_replace(\"/https/i\", \"http\", $service[1][0]).\"ip/\".$ip);\n if($service_rdap == FALSE) {\n return null;\n }\n $service_rdap = json_decode($service_rdap, true);\n if(isset($service_rdap[\"country\"])) {\n return strtoupper($service_rdap[\"country\"]);\n } else {\n return null;\n }\n }\n }\n }\n } else if(filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {\n $iana_ipv6 = [\"description\"=> \"RDAP bootstrap file for IPv6 address allocations\", \"publication\"=> \"2019-11-06T19:00:04Z\", \"services\"=> [[[\"2001:4200::/23\", \"2c00::/12\"], [\"https://rdap.afrinic.net/rdap/\", \"http://rdap.afrinic.net/rdap/\"]], [[\"2001:200::/23\", \"2001:4400::/23\", \"2001:8000::/19\", \"2001:a000::/20\", \"2001:b000::/20\", \"2001:c00::/23\", \"2001:e00::/23\", \"2400::/12\"], [\"https://rdap.apnic.net/\"]], [[\"2001:1800::/23\", \"2001:400::/23\", \"2001:4800::/23\", \"2600::/12\", \"2610::/23\", \"2620::/23\", \"2630::/12\"], [\"https://rdap.arin.net/registry/\", \"http://rdap.arin.net/registry/\"]], [[\"2001:1400::/22\", \"2001:1a00::/23\", \"2001:1c00::/22\", \"2001:2000::/19\", \"2001:4000::/23\", \"2001:4600::/23\", \"2001:4a00::/23\", \"2001:4c00::/23\", \"2001:5000::/20\", \"2001:600::/23\", \"2001:800::/22\", \"2003::/18\", \"2a00::/12\", \"2a10::/12\"], [\"https://rdap.db.ripe.net/\"]], [[\"2001:1200::/23\", \"2800::/12\"], [\"https://rdap.lacnic.net/rdap/\"]]], \"version\"=>\"1.0\"];\n if($real_time_data) {\n $iana_ipv6 = file_get_contents(\"http://data.iana.org/rdap/ipv6.json\");\n if (is_bool($iana_ipv6)) {\n return null;\n }\n $iana_ipv6 = json_decode($iana_ipv6, true);\n }\n $ip_parts = explode(\":\", $ip);\n foreach ($iana_ipv6[\"services\"] as $service) {\n foreach ($service[0] as $ip_range) {\n if(preg_match(\"/\".$ip_parts[0].\":\".$ip_parts[1].\"::\\/\\d[\\d]*/\", $ip_range) || preg_match(\"/\".$ip_parts[0].\"::\\/\\d[\\d]*/\", $ip_range)) {\n $service_rdap = file_get_contents(preg_replace(\"/https/i\", \"http\", $service[1][0]).\"ip/\".$ip);\n if($service_rdap == FALSE) {\n return null;\n }\n $service_rdap = json_decode($service_rdap, true);\n if(isset($service_rdap[\"country\"])) {\n return strtoupper($service_rdap[\"country\"]);\n } else {\n return null;\n }\n }\n }\n }\n }\n }\n return null;\n}", "private function extract($String) {\n $string = DB::quote($String);\n $numbers = [];\n\n $updatedString = dictionary($string);\n preg_match_all('!\\d+!', $updatedString, $matches);\n (isset($matches[0][0])) ? $numbers['RSVP']=$matches[0][0] : $numbers['RSVP']='NULL'; // TODO: this returns only the 1st number in the string after dict\n (isset($matches[0][1])) ? $numbers['Uncertin']=$matches[0][1] : $numbers['Uncertin']='NULL'; // TODO: this returns only the 2nd number in the string after dict\n (isset($matches[0][2])) ? $numbers['Ride']=$matches[0][2] : $numbers['Ride']=0; // TODO: this returns only the 3rd number in the string after dict\n ($numbers['Ride'] !=0 ) ? $numbers['Ride']=1 : $numbers['Ride']=0;\n\n (strlen($updatedString)>11) ? $numbers['Complex']=1 : $numbers['Complex']=0; // TODO: this relays on string being longer than 3 seperate dnumbers after dictionary\n\n return $numbers;\n }", "function _gaiabb_autocompresp($string) {\n\n $matches = array();\n $result = db_select('gbb_gresp', 'c')\n ->fields('c', array('nomu'))\n ->condition('nomu', '%' . db_like($string) . '%', 'LIKE')\n ->distinct()\n ->range(0, 10)\n ->execute();\n foreach ($result as $r) {\n $matches[$r->nomu] = $r->nomu;\n }\n $count = $result->rowCount();\n if ($count > 9) $matches[' '] = '..... Et bien d\\'autres .....';\n drupal_json_output($matches);\n}", "public function getABdata($key) {\n $ans=\"\";\n #$table = \"{$this->getParms->dict}ab\";\n $table = $this->dal_ab->tabname;\n $result = $this->dal_ab->getgeneral($key,$table);\n $dbg=false;\n dbgprint($dbg,\"getABdata: length of result=\" . count($result) . \"\\n\");\n if (count($result) == 1) {\n list($key1,$data) = $result[0];\n if (preg_match('/<disp>(.*?)<\\/disp>/',$data,$matches)) {\n $ans = $matches[1];\n /* This taken from mw code; but is probably obsolete.\n It permitted <s>X</s> coding within the abbreviation expansion\n and conversion to the user's choice of 'filter'\n global $dispfilter;\n $temp = strtolower($dispfilter);\n $filterflag = (preg_match('/deva/',$temp) || preg_match('/roman/',$temp));\n if ($filterflag) {\n\t$ans = preg_replace('/<s>/','<SA>',$ans);\n\t$ans = preg_replace('/<\\/s>/','</SA>',$ans);\n }\n */\n }\n }\n return $ans;\n}", "function http_spreaker_parse($txt)\n{\n $needed_parts = array('nonce'=>1, 'username'=>1, 'timestamp'=>1, 'response'=>1);\n $data = array();\n $data = explode(\":\",$txt);\n $arrayReturn = array();\n if(count($needed_parts) != count($data)){\n \treturn false;\n }\n $i = 0;\n foreach($needed_parts as $key => $val){\n \t$arrayReturn[$key] = $data[$i];\n \t$i++;\n }\n return $arrayReturn;\n}", "public function provinsi()\n\t{\n $term =$this->input->get('term',TRUE);\n\t\t$query = \"SELECT nama FROM provinsi WHERE nama LIKE '%\".$term.\"%'\";\n\t\t$row=$this->db->query($query)->result();\n\t\t$provinsi = array();\n\t\tforeach($row as $p)\n\t\t{\n\t\t\t$provinsi[] = array(\n\t\t\t\t'label'=>$p->nama,\n\t\t\t);\n\t\t}\n\t\techo json_encode($provinsi);\n\t\t\n }", "function bdec_dict($s) {\n\tif ($s[0] != \"d\")\n\treturn;\n\t$sl = strlen($s);\n\t$i = 1;\n\t$v = array();\n\t$ss = \"d\";\n\tfor (;;) {\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\tif ($s[$i] == \"e\")\n\t\tbreak;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret) || $ret[\"type\"] != \"string\")\n\t\treturn;\n\t\t$k = $ret[\"value\"];\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t\tif ($i >= $sl)\n\t\treturn;\n\t\t$ret = bdec(substr($s, $i));\n\t\tif (!isset($ret) || !is_array($ret))\n\t\treturn;\n\t\t$v[$k] = $ret;\n\t\t$i += $ret[\"strlen\"];\n\t\t$ss .= $ret[\"string\"];\n\t}\n\t$ss .= \"e\";\n\treturn array('type' => \"dictionary\", 'value' => $v, 'strlen' => strlen($ss), 'string' => $ss);\n}", "function phpkd_vblvb_fetch_phrase_from_key($phrase_key)\n{\n\tglobal $vbphrase;\n\n\treturn (isset($vbphrase[\"$phrase_key\"])) ? $vbphrase[\"$phrase_key\"] : $phrase_key;\n}", "public function getResponse(): array;", "public function parse(string $string): array;", "function array_iconv(&$val, $key, $userdata)\n{\n\t$val = mb_convert_encoding($val,$userdata[1],$userdata[0]);\n\t//audit(serialize($userdata),'error');\n}", "private function getArrayKeyFromReplyProperty($strProperty) {\n switch ($strProperty) {\n default:\n case PubChemFinder::IUPAC_NAME:\n return Front::CANVAS_INPUT_NAME;\n case PubChemFinder::IDENTIFIER:\n return Front::CANVAS_INPUT_IDENTIFIER;\n case PubChemFinder::FORMULA:\n return Front::CANVAS_INPUT_FORMULA;\n case PubChemFinder::MASS:\n return Front::CANVAS_INPUT_MASS;\n case PubChemFinder::SMILE:\n return Front::CANVAS_INPUT_SMILE;\n }\n }", "function vcard_get($info, $array){\n\t$base = $info;\n\tforeach($array as $item){\n\t\tif ($base[$item]){\n\t\t\t$base = $base[$item];\n\t\t}else{\n\t\t\treturn null;\n\t\t}\n\t}\n\treturn $base;\n}", "function pkeyGet($kv)\n {\n return Memcached_DataObject::pkeyGet('QnA_Answer', $kv);\n }", "function get_availability_restelements_fromavfield( $availability_field ){\n\n $restrction_elmts=array();\n if($availability_field==null or $availability_field==\"NULL\"){\n return $restrction_elmts;\n }else{\n foreach (json_decode($availability_field)->c as $key => $value) {\n if( array_key_exists('c', $value) ){\n $restrction_elmts = array_merge($restrction_elmts, get_availability_restelements_fromavfield( json_encode($value) ));\n }else {\n $restrction_elmts[] = $value;\n }\n }\n\n }\n\n return $restrction_elmts;\n }", "function hash_call($methodName,$nvpStr){\n\t\t//declaring of global variables\n\n\t\t//setting the curl parameters.\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL,$this->PAYPAL_API_ENDPOINT);\n\t\tcurl_setopt($ch, CURLOPT_VERBOSE, 1);\n\t\n\t\t//turning off the server and peer verification(TrustManager Concept).\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);\n\t\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.\n\t\t//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php \n\t\tif($this->PAYPAL_USE_PROXY)\n\t\tcurl_setopt ($ch, CURLOPT_PROXY, $this->PAYPAL_PROXY_HOST.\":\".$this->PAYPAL_PROXY_PORT); \n\t\n\t\t//check if version is included in $nvpStr else include the version.\n\t\tif(strlen(str_replace('VERSION=', '', strtoupper($nvpStr))) == strlen($nvpStr)) {\n\t\t\t$nvpStr = \"&VERSION=\" . urlencode($this->PAYPAL_VERSION) . $nvpStr;\t\n\t\t}\n\t\t\n\t\t$nvpreq=\"METHOD=\".urlencode($methodName).$nvpStr;\n\t\t\n\t\t//setting the nvpreq as POST FIELD to curl\n\t\tcurl_setopt($ch,CURLOPT_POSTFIELDS,$nvpreq);\n\t\n\t\t//getting response from server\n\t\t$response = curl_exec($ch);\n\t\n\t\t//convrting NVPResponse to an Associative Array\n\t\t$nvpResArray = $this->deformatNVP($response);\n\t\t$nvpReqArray = $this->deformatNVP($nvpreq);\n\t\t$_SESSION['nvpReqArray']=$nvpReqArray;\n\t\n\t\tif (curl_errno($ch)) {\n\t\t\t// moving to display page to display curl errors\n\t\t\t$_SESSION['curl_error_no']=curl_errno($ch) ;\n\t\t\t$_SESSION['curl_error_msg']=curl_error($ch);\n\t\t\t$location = \"APIError.php\";\n\t\t\theader(\"Location: $location\");\n\t\t} else {\n\t\t\t//closing the curl\n\t\t\t\tcurl_close($ch);\n\t\t}\n\t\n\treturn $nvpResArray;\n\t}" ]
[ "0.67974657", "0.6726708", "0.6707824", "0.6676692", "0.66165745", "0.66136616", "0.6536397", "0.62488645", "0.5874914", "0.5635918", "0.558448", "0.5502825", "0.5114392", "0.50820124", "0.50568646", "0.5027101", "0.5020332", "0.49985197", "0.49813187", "0.49770144", "0.4968928", "0.49318677", "0.48720312", "0.4833564", "0.4748633", "0.47112066", "0.47099063", "0.46844986", "0.46777523", "0.4665941", "0.46301514", "0.45776403", "0.45734575", "0.4553052", "0.45459872", "0.45260257", "0.44878674", "0.4483266", "0.44723767", "0.44517508", "0.44403875", "0.4433986", "0.44323346", "0.44209942", "0.44146547", "0.44108555", "0.43890348", "0.43840343", "0.43824646", "0.43815568", "0.4356107", "0.4353218", "0.43459293", "0.43424153", "0.43421465", "0.4337963", "0.4331387", "0.43286592", "0.43220243", "0.43150502", "0.43079337", "0.43070513", "0.43025884", "0.43000102", "0.4293934", "0.4292268", "0.4290596", "0.42857698", "0.42853865", "0.42844316", "0.428053", "0.42795768", "0.42774296", "0.42753148", "0.42731795", "0.42725793", "0.42725793", "0.42695117", "0.42676315", "0.426359", "0.42516068", "0.4242896", "0.4242241", "0.42395815", "0.42395335", "0.42337194", "0.42261863", "0.42255285", "0.42225417", "0.42221844", "0.42215672", "0.42117915", "0.42091554", "0.4203396", "0.41927558", "0.4191224", "0.41904524", "0.4182221", "0.4181646", "0.41786906" ]
0.65382123
6
Description This function will return the list of modules available in the system, and which modules the requested station has access to. Arguments api_key: auth_token: station_id: The ID of the station to get the module list for.
function qruqsp_core_stationModuleList($q) { // // Find all the required and optional arguments // qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'prepareArgs'); $rc = qruqsp_core_prepareArgs($q, 'no', array( 'station_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Station'), 'plans'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Plans'), )); if( $rc['stat'] != 'ok' ) { return $rc; } $args = $rc['args']; // // Check access to station_id as owner, or sys admin. // qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'checkAccess'); $rc = qruqsp_core_checkAccess($q, $args['station_id'], 'qruqsp.core.stationModuleList'); if( $rc['stat'] != 'ok' ) { return $rc; } qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbHashIDQuery'); $strsql = "SELECT CONCAT_WS('.', package, module) AS name, package, module, status " . "FROM qruqsp_core_station_modules " . "WHERE station_id = '" . qruqsp_core_dbQuote($q, $args['station_id']) . "' " . "ORDER BY name " . ""; $rc = qruqsp_core_dbHashIDQuery($q, $strsql, 'qruqsp.core', 'modules', 'name'); if( $rc['stat'] != 'ok' ) { return $rc; } if( !isset($rc['modules']) ) { return array('stat'=>'fail', 'err'=>array('code'=>'qruqsp.core.139', 'msg'=>'No station found')); } $station_modules = $rc['modules']; // // Get the list of available modules // qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'getModuleList'); $rc = qruqsp_core_getModuleList($q); if( $rc['stat'] != 'ok' ) { return $rc; } $mod_list = $rc['modules']; $modules = array(); $count = 0; foreach($mod_list as $module) { if( $module['label'] != '' && $module['installed'] == 'Yes' && (!isset($module['optional']) || $module['optional'] == 'yes') ) { $modules[$count] = array('label'=>$module['label'], 'package'=>$module['package'], 'name'=>$module['name'], 'status'=>'0'); if( isset($station_modules[$module['package'] . '.' . $module['name']]) && $station_modules[$module['package'] . '.' . $module['name']]['status'] == 1 ) { $modules[$count]['status'] = '1'; } $count++; } } $rsp = array('stat'=>'ok', 'modules'=>$modules); /* // // Get the list of available plans for the station // if( isset($args['plans']) && $args['plans'] == 'yes' ) { if( $args['station_id'] == '0' ) { $args['station_id'] = $q['config']['qruqsp.core']['master_station_id']; } // // Query the database for the plan // $strsql = "SELECT id, name, monthly, trial_days " . "FROM qruqsp_core_station_plans " . "WHERE station_id = '" . qruqsp_core_dbQuote($q, $args['station_id']) . "' " . "ORDER BY sequence " . ""; qruqsp_core_loadMethod($q, 'qruqsp', 'core', 'private', 'dbHashQueryTree'); $rc = qruqsp_core_dbHashQueryTree($q, $strsql, 'qruqsp.stations', array( array('container'=>'plans', 'fname'=>'id', 'name'=>'plan', 'fields'=>array('id', 'name', 'monthly')), )); if( $rc['stat'] != 'ok' ) { return $rc; } if( isset($rc['plans']) ) { $rsp['plans'] = $rc['plans']; } } */ return $rsp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getModulesList();", "public static function getModules(){ \n $db = new db();\n $db->connect();\n $modules = $db->selectAll('modules');\n return self::getModulesInfo($modules);\n }", "public function getModules()\n {\n\n if ($this->_modules !== null) {\n return $this->_modules;\n }\n\n $url = Yii::app()->getModule('admin')->marketplaceApiUrl . \"list?version=\" . urlencode(HVersion::VERSION) . \"&installId=\" . HSetting::Get('installationId', 'admin');\n\n try {\n\n $this->_modules = Yii::app()->cache->get('onlineModuleManager_modules');\n if ($this->_modules === null || !is_array($this->_modules)) {\n\n $http = new Zend_Http_Client($url, array(\n 'adapter' => 'Zend_Http_Client_Adapter_Curl',\n 'curloptions' => $this->getCurlOptions(),\n 'timeout' => 30\n ));\n\n $response = $http->request();\n $json = $response->getBody();\n\n $this->_modules = CJSON::decode($json);\n Yii::app()->cache->set('onlineModuleManager_modules', $this->_modules, HSetting::Get('expireTime', 'cache'));\n }\n } catch (Exception $ex) {\n throw new CHttpException('500', Yii::t('AdminModule.libs_OnlineModuleManager', 'Could not fetch module list online! (%error%)', array('%error%' => $ex->getMessage())));\n }\n return $this->_modules;\n }", "public function getModules();", "public function getModules();", "public function getModules(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelist');\n return $this->execute($qb);\n }", "public function get_modules( $status = 'all' );", "public function modules(){\n $userID = Auth::user()->USER_ID;\n $users = USER::where('USER_ID',$userID)->with('authModules')->first();\n $res['USERNAME'] = $users->USERNAME;\n $userModules = $users->authModules;\n foreach($userModules as $userModule){\n $userModuleID = $userModule->MODULE_ID;\n $modules = SystemModule::where('MODULE_ID', $userModuleID)->get();\n foreach($modules as $module){\n array_push($res,$module->MODULE_NAME);\n }\n }\n return $res;\n }", "function get_all_modules_by_center(){\n\t\t\t$sql=\"SELECT module_id,center_exam_part,subject_name FROM $this->table WHERE center_id=:centerId\";\n\t\t\t$stmt = $this->dbConn->prepare($sql);\n\t\t\t$stmt->bindParam(\":centerId\",$this->centerId);\n\t\t\tif ($stmt->execute()) {\n\t\t\t\t$results= $stmt->fetchAll(PDO::FETCH_ASSOC);\n\t\t\t\treturn json_encode($results);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdie();\n\t\t\t\t}\n\t\t\t}", "public function getModules() {\n }", "public function refreshModules ()\n\t{\n\n\t\t$modules = array();\n\n\t\tif ( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'account' ][ 'allSet' ] && $this->hasAuthorised() )\n\t\t{\n\t\t\tif ( isset( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'allowance' ][ 'discoversLimit' ] ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'discover';\n\t\t\t}\n\t\t\tif ( isset( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'allowance' ][ 'campaignsLimit' ] ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'campaign';\n\t\t\t}\n\t\t\tglobal $freeCompanyModules;\n\t\t\tforeach ( $freeCompanyModules as $mod )\n\t\t\t{\n\t\t\t\t$modules[] = $mod;\n\t\t\t}\n\t\t\t$companyModules = $this->company->getModules();\n\t\t\tforeach ( $companyModules as $mod => $status )\n\t\t\t{\n\t\t\t\tif ( in_array( $mod, array(\n\t\t\t\t\t\t'admin',\n\t\t\t\t\t\t'reseller' ) ) )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$modules[] = $mod;\n\t\t\t}\n\t\t}\n\t\tif ( $_SESSION[ __oSESSION_USER_PARAM__ ][ 'representative' ] )\n\t\t{\n\t\t\tif ( $this->company->hasAccessTo( 'admin' ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'admin';\n\t\t\t}\n\t\t\tif ( $this->company->hasAccessTo( 'reseller' ) )\n\t\t\t{\n\t\t\t\t$modules[] = 'reseller';\n\t\t\t}\n\t\t}\n\n\t\t$this->userInfo[ 'modules' ] = $modules;\n\n\t\treturn $modules;\n\t}", "public static function getAllModules()\n\t\t{\n\n\t\t\t$modules = array();\n\n\t\t\treturn apply_filters( 'studiorum_modules', $modules );\n\n\t\t}", "public function getDataListModule()\n {\n $this->db->select('*');\n $this->db->from('xi_sa_module');\n $this->db->order_by('id_module', 'ASC');\n $query = $this->db->get();\n\n return $query->result();\n }", "function qa_list_modules_info()\n{\n\tglobal $qa_modules;\n\treturn $qa_modules;\n}", "public function getModuleList(){\n $qb = $this->createQueryBuilder();\n $qb->module('system')->query('modulelistnames');\n return $this->execute($qb);\n }", "public function getAvailableModules(string $module): array;", "function getModules()\n\t{\n\t\t $this->loadModel('Module'); \n\n\t\t $sections = $this->Module->query(\"SELECT * FROM modules WHERE enable = '1'\");\n\t\t return $sections;\n\t}", "public function getModules()\n {\n return $this['module.list'];\n }", "public function getModules()\n {\n $orgid = isset($_REQUEST['orgid']) ? decode5t($_REQUEST['orgid']) : '0';\n $data = array();\n try {\n $query = $this->db->query(\"SELECT ModuleId AS module,ViewPermission as permission FROM OrgPermission WHERE OrgId= ? and ModuleId in (5,31,66,171,186,187,2)\", array(\n $orgid\n ));\n $data['permission'] = $query->result();\n }\n catch (Exception $a) {\n $data['permission'] = '0';\n }\n return $data;\n \n }", "public function availableAction()\n {\n $modules = array();\n //$modulesInstalled = $this->installedModules();\n $iterator = new \\DirectoryIterator(Pi::path('module'));\n foreach ($iterator as $fileinfo) {\n if (!$fileinfo->isDir() || $fileinfo->isDot()) {\n continue;\n }\n $directory = $fileinfo->getFilename();\n if (preg_match('/[^a-z0-9_]/i', $directory)) {\n continue;\n }\n $meta = Pi::service('module')->loadMeta($directory, 'meta');\n if (empty($meta)) {\n continue;\n }\n $author = Pi::service('module')->loadMeta($directory, 'author');\n //$clonable = isset($meta['clonable']) ? $meta['clonable'] : false;\n //$meta['installed'] = in_array($directory, $modulesInstalled);\n $meta['installed'] = Pi::registry('module')\n ->read($directory) ? true : false;\n if (empty($meta['clonable']) && $meta['installed']) {\n continue;\n }\n $meta['logo'] = !empty($meta['logo'])\n ? Pi::url('script/browse.php') . '?'\n . sprintf('module/%s/asset/%s', $directory, $meta['logo'])\n : Pi::url('static/image/module.png');\n $modules[$directory] = array(\n 'meta' => $meta,\n 'author' => $author,\n );\n }\n\n $this->view()->assign('modules', $modules);\n $this->view()->assign('title', __('Modules ready for installation'));\n }", "protected function getUserModules()\n {\n $accessType = Auth::user()->user_access;\n\n $modules = User::where('id', Auth::user()->id)\n ->with('UserAccess.Module.subModules')\n ->get();\n\n return Response::json(array('data' => $modules));\n }", "public function list_server_modules()\n\t{\n\t\tthrow new steam_exception( $this->get_login_user_name(), \"Error: list_server_modules is not available using steam_connector_lite\", 980 );\n\t}", "static function get_all_available_modules()\n {\n $result = array();\n\n $categories = self::get_all_available_categories();\n\n foreach ($categories as $nome_categoria)\n {\n $names = self::get_all_available_by_category($nome_categoria);\n\n if (is_array($names))\n foreach ($names as $nome_modulo)\n {\n $def = self::get_available_module_definition($nome_categoria,$nome_modulo);\n \n $mod = array();\n $mod[\"show\"] = $def->get_show();\n $mod[\"nome_categoria\"] = $nome_categoria;\n $mod[\"nome_modulo\"] = $nome_modulo;\n $version = $def->get_current_version();\n $mod[\"properties\"] = $version;\n $result[] = $mod;\n \n }\n else echo \"Errore per la categoria : \".$nome_categoria;\n\n }\n\n return $result;\n }", "public function index()\n {\n return $this->module_service->all();\n }", "public function\n\tgetAvailableModules() : array\n\t{\n\t\t$moduleList_core \t= [];\n\t\t$moduleList_mantle \t= [];\n\n\t\t$procPath = CMS_SERVER_ROOT . DIR_CORE . DIR_MODULES;\n\n\t\tif(file_exists($procPath))\n\t\t{ \n\t\t\t$_dirIterator \t= new DirectoryIterator($procPath);\n\t\t\tforeach($_dirIterator as $_dirItem)\n\t\t\t{\n\t\t\t\tif($_dirItem -> isDot() || $_dirItem -> getType() !== 'dir')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$directory = $_dirItem -> getFilename();\n\n\t\t\t\tif($directory[0] === '.')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleFilepath = $procPath . $directory .'/module.json'; \n\n\t\t\t\t$moduleConfig\t= file_get_contents($moduleFilepath);\n\n\t\t\t\tif($moduleConfig === false)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleConfig = json_decode($moduleConfig);\n\n\t\t\t\t// Determine Scheme\n\n\t\t\t\t$pModulesInstall = new CModulesInstall;\n\n\t\t\t\t$moduleData = $pModulesInstall -> getModuleData($moduleConfig, $directory, 'core');\n\n\t\t\t\tif($moduleData === false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$moduleData = json_decode(json_encode($moduleData));\n\n\t\t\t\t$moduleData -> module -> module_location = $directory;\n\n\t\t\t\t$moduleList_core[]\t= $moduleData;\n\t\t\t}\n\t\t}\n\n\t\t$procPath = CMS_SERVER_ROOT . DIR_MANTLE . DIR_MODULES;\n\n\t\tif(file_exists($procPath))\n\t\t{ \n\t\t\t$_dirIterator \t= new DirectoryIterator($procPath);\n\t\t\tforeach($_dirIterator as $_dirItem)\n\t\t\t{\n\t\t\t\tif($_dirItem -> isDot() || $_dirItem -> getType() !== 'dir')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$directory = $_dirItem -> getFilename();\n\n\t\t\t\tif($directory[0] === '.')\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleFilepath = $procPath . $directory .'/module.json'; \n\n\t\t\t\t$moduleConfig\t= file_get_contents($moduleFilepath);\n\n\t\t\t\tif($moduleConfig === false)\n\t\t\t\t\tcontinue;\n\n\t\t\t\t$moduleConfig = json_decode($moduleConfig);\n\n\t\t\t\t// Determine Scheme\n\n\t\t\t\t$pModulesInstall = new CModulesInstall;\n\n\t\t\t\t$moduleData = $pModulesInstall -> getModuleData($moduleConfig, $directory, 'mantle');\n\n\t\t\t\tif($moduleData === false)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$moduleData = json_decode(json_encode($moduleData));\n\n\t\t\t\t$moduleData -> module -> module_location = $directory;\n\n\t\t\t\t$moduleList_mantle[]\t= $moduleData;\n\t\t\t}\n\t\t}\n\n\t\t$availableList = [];\n\n\t\tforeach($moduleList_core as $dirModuleKey => $dirModuleItem)\n\t\t{\n\t\t\t$moduleInstalled = false;\n\n\n\t\t\tif(!isset($dirModuleItem -> module -> module_controller))\n\t\t\t{\n\t\t\t\t#tk::dbug($dirModuleItem);\n\n\t\t\t\t// aaaooohhh well ... this should not be\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach($this -> modulesList as $listItem)\n\t\t\t{\n\t\t\t\tif($listItem -> module_controller === $dirModuleItem -> module -> module_controller)\n\t\t\t\t{\n\t\t\t\t\t$moduleInstalled = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif($moduleInstalled)\n\t\t\t\tcontinue;\n\n\t\t#\t$dirModuleItem -> module_type = \"core\";\n\n\t\t\t$availableList[] = $dirModuleItem;\n\t\t}\n\n\t\tforeach($moduleList_mantle as $dirModuleKey => $dirModuleItem)\n\t\t{\n\t\t\t$moduleInstalled = false;\n\n\t\t\tforeach($this -> modulesList as $listItem)\n\t\t\t{\n\t\t\t\tif($listItem -> module_controller === $dirModuleItem -> module -> module_controller)\n\t\t\t\t{\n\t\t\t\t\t$moduleInstalled = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($moduleInstalled)\n\t\t\t\tcontinue;\n\n\t\t#\t$dirModuleItem -> module_type \t\t= \"mantle\";\n\n\t\t\t$availableList[] = $dirModuleItem;\n\t\t}\n\n\n\t\treturn $availableList;\n\t}", "private function listModules() {\n\t\t\n\t\t$tabModules = array ();\n\t\t\n\t\t# search for modules in {appPath}/lib/modules/{module_name}/{module_name}.class.php\n\t\t$res = opendir(LIB_MOD);\n\t\t$i = 0;\n\t\twhile (false !== ($fModule = readdir($res))) {\n\t\t\tif (is_dir(LIB_MOD . $fModule) && $fModule != '.' && $fModule != '..') {\n\t\t\t\tif (is_file(LIB_MOD . $fModule .'/'. $fModule .'.class.php')) {\n\t\t\t\t\t$tabModules[$i]['name'] = $fModule;\n\t\t\t\t\t$tabModules[$i]['link'] = $this->conf['general']['appURL'] .'?action='. $fModule .'.show';\n\t\t\t\t\t++$i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tclosedir($res);\n\t\t$ret = array (\n\t\t\t'modules'\t=> $tabModules\n\t\t);\n\t\t\n\t\treturn $ret;\n\t}", "function ciniki_tenants_getModules($ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'), \n 'plans'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Plans'), \n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n \n //\n // Check access to tnid as owner, or sys admin. \n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'checkAccess');\n $ac = ciniki_tenants_checkAccess($ciniki, $args['tnid'], 'ciniki.tenants.getModules');\n if( $ac['stat'] != 'ok' ) {\n return $ac;\n }\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashIDQuery');\n $strsql = \"SELECT CONCAT_WS('.', package, module) AS name, package, module, status, ruleset \"\n . \"FROM ciniki_tenant_modules \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY name \"\n . \"\"; \n $rc = ciniki_core_dbHashIDQuery($ciniki, $strsql, 'ciniki.tenants', 'modules', 'name');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( !isset($rc['modules']) ) {\n return array('stat'=>'fail', 'err'=>array('code'=>'ciniki.tenants.49', 'msg'=>'No tenant found'));\n }\n $tenant_modules = $rc['modules'];\n\n //\n // Get the list of available modules\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'getModuleList');\n $rc = ciniki_core_getModuleList($ciniki);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $mod_list = $rc['modules'];\n\n $modules = array();\n $count = 0;\n foreach($mod_list as $module) {\n if( $module['label'] != '' && $module['installed'] == 'Yes' && (!isset($module['optional']) || $module['optional'] == 'yes') ) {\n $modules[$count] = array('label'=>$module['label'], 'package'=>$module['package'], 'name'=>$module['name'], 'status'=>'0');\n if( isset($tenant_modules[$module['package'] . '.' . $module['name']]) ) {\n if( $tenant_modules[$module['package'] . '.' . $module['name']]['status'] == 1 ) {\n $modules[$count]['status'] = '1';\n } elseif( $tenant_modules[$module['package'] . '.' . $module['name']]['status'] == 90 ) {\n $modules[$count]['status'] = '90';\n } \n }\n $count++;\n }\n }\n\n $rsp = array('stat'=>'ok', 'modules'=>$modules);\n \n //\n // Get the list of available plans for the tenant\n // \n if( isset($args['plans']) && $args['plans'] == 'yes' ) {\n if( $args['tnid'] == '0' ) {\n $args['tnid'] = $ciniki['config']['ciniki.core']['master_tnid'];\n }\n //\n // Query the database for the plan\n //\n $strsql = \"SELECT id, name, monthly, trial_days \"\n . \"FROM ciniki_tenant_plans \"\n . \"WHERE tnid = '\" . ciniki_core_dbQuote($ciniki, $args['tnid']) . \"' \"\n . \"ORDER BY sequence \"\n . \"\";\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbHashQueryTree');\n $rc = ciniki_core_dbHashQueryTree($ciniki, $strsql, 'ciniki.tenants', array(\n array('container'=>'plans', 'fname'=>'id', 'name'=>'plan', 'fields'=>array('id', 'name', 'monthly')),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n if( isset($rc['plans']) ) {\n $rsp['plans'] = $rc['plans'];\n }\n }\n\n return $rsp;\n}", "function getModules($universityID){\n\n\tglobal $db;\n\tglobal $noerrors;\n\t\n\tif($noerrors <> 0)\n\t{\n\t\techo json_encode(array(\"errorcode\"=>$noerrors));\n\t\treturn;\n\t}\n\t\n\t// Find purchased tickets \n\t$findModules = $db->prepare(\"SELECT * FROM `modules` WHERE `universityID` = :universityID\");\n\t$findModules->bindParam(\"universityID\", $universityID); \n\t$findModules->execute();\n\n\t// JSON Message array\n\t$jsonArray = array();\n\n\t\n\tif ($findModules->rowCount() > 0)\n\t{\n\t\t$jsonArray[\"module_number\"]=$findModules->rowCount();\n\t\t\n\t\t$modules = $findModules->fetchAll();\n\t\tforeach($modules AS $module)\n\t\t{\n\t\t\t$jsonArray[\"modules\"][] = array(\"ID\"=>$module['moduleID'],\"module_code\"=>$module['module_code'],\"module_name\"=>$module['module_name']);\n\t\t}\n\t} \n\telse \n\t{\n\t\t$jsonArray[\"module_number\"]=$findModules->rowCount();\t\n\t}\n\n\t// Output JSON Message\n\techo json_encode($jsonArray);\n\n}", "public function index()\n {\n $modules = App\\Module::with('lessons' /*'tracks', 'quiz'*/)->get(); // I honestly have no idea if we need tracks here\n return response($modules);\n }", "public function getAllModules()\n\t{\n\t\treturn $this->modules;\n\t}", "public function queryAll(){\n\t\t$sql = 'SELECT * FROM modules';\n\t\t$sqlQuery = new SqlQuery($sql);\n\t\treturn $this->getList($sqlQuery);\n\t}", "public function getInstalledModuleList($withAvailableVersion = false)\n {\n require_once('class/Class.WIFF.php');\n require_once('class/Class.Module.php');\n\n $wiff = WIFF::getInstance();\n\n $xml = $wiff->loadContextsDOMDocument(0, false);\n if ($xml === false) {\n $this->errorMessage = sprintf(\"Error loading 'contexts.xml': %s\", $wiff->errorMessage);\n return array();\n }\n\n $xpath = new DOMXPath($xml);\n\n $moduleList = array();\n\n $moduleDom = $xpath->query(\"/contexts/context[@name='\" . $this->name . \"']/modules/module\");\n\n foreach ($moduleDom as $module) {\n $mod = new Module($this, null, $module, true);\n if ($mod->status == 'installed') {\n $moduleList[] = $mod;\n }\n }\n //Process for with available version option\n if ($withAvailableVersion) {\n $availableModuleList = $this->getAvailableModuleList();\n\n foreach ($availableModuleList as $availableModule) {\n foreach ($moduleList as $module) {\n /**\n * @var Module $module\n */\n if ($availableModule->name == $module->name) {\n $module->availableversion = $availableModule->version;\n $module->availableversionrelease = $availableModule->version;\n $module->availablechangelog = $availableModule->changelog;\n $cmp = $this->cmpModuleByVersionAsc($module, $availableModule);\n if ($cmp < 0) {\n $module->canUpdate = true;\n }\n $module->isUptodate = ($cmp === 0);\n }\n }\n }\n }\n\n return $moduleList;\n }", "function getModules(){\n global $adb;\n $query=\"select vtiger_tab.tabid,vtiger_tab.tablabel as modulename,linklabel from vtiger_tab left join vtiger_links on vtiger_tab.tabid=vtiger_links.tabid and linklabel='WYSIWYG'\nwhere isentitytype=1 and tablabel!='Comments'\";\n $result=$adb->pquery($query,array());\n while($resultrow = $adb->fetch_array($result)) {\n $modulelist[$resultrow['modulename']]=array('enabled'=>$resultrow['linklabel']==\"WYSIWYG\",'tabid'=>$resultrow['tabid']);\n }\n return $modulelist;\n }", "function getAvailableModulesOfKey($key)\n {\n $availableModules = [];\n $modules = $this->getAllModulesOfProject();\n foreach ($modules as $module)\n {\n $translations = $this->getTranslationsOfModule($module);\n foreach ($translations as $lang => $value)\n {\n if (get($value,$key) && !in_array($module->name, $availableModules))\n $availableModules[] = $module->name;\n }\n }\n return $availableModules;\n }", "public function apiList();", "public function get_phase_modules()\n {\n $project_id = $this->input->post('id', true);\n $phase_id = $this->input->post('Phase', true);\n $phase = $this->technical_user_model->get_project_phase($project_id, $phase_id);\n\n\n $modules = $this->technical_user_model->get_project_modules($project_id);\n $output1 = null;\n $output1 .= \"<option>Select Module</option>\";\n\n foreach ($modules as $row) {\n //here we build a dropdown item line for each\n // query result\n $output1 .= \"<option value='\" . $row['Project_Module_Icode'] . \"'>\" . $row['Module_Name'] . \"</option>\";\n }\n\n // echo $output1;\n $full_data = array('phase_Details' => $phase,\n 'Modules' => $output1);\n echo json_encode($full_data);\n }", "function usp_ews_get_active_monitorable_modules() {\n global $DB;\n\n\t$fields = 'name';\n\t$active_site_modules = array();\n\t\n\t// get records of modules thoses are activve in site level\n\t$active_site_modules_records = $DB->get_records('modules', array('visible'=>'1'), '', $fields);\n\t\n\tforeach ($active_site_modules_records as $usp_ews_module=>$details) {\n\t\t$active_site_modules[] = $details->name;\n\t}\n\t\n\t$monitored_modules = usp_ews_get_monitorable_modules();\n\n\tforeach ($monitored_modules as $modules=>$detail) {\n\t\tif(!in_array($modules, $active_site_modules))\t{\n\t\t\tunset($monitored_modules[$modules]);\n\t\t}\n\t}\n\n\treturn $monitored_modules;\n}", "private function getModules() {\n // @todo Only do a full rebuild of the module cache every 1 at the most\n $modules = system_rebuild_module_data();\n uasort($modules, 'system_sort_modules_by_info_name');\n\n $result = array();\n $keys_to_send = array('name', 'version', 'package', 'core', 'project');\n foreach ($modules as $module) {\n $info = array();\n $info['status'] = $module->status;\n foreach ($keys_to_send as $key) {\n $info[$key] = isset($module->info[$key]) ? $module->info[$key] : '';\n }\n $info['filename'] = $module->getPathname();\n if (empty($info['project']) && $module->origin == 'core') {\n $info['project'] = 'drupal';\n }\n\n // Determine which files belong to this module and hash them.\n $module_path = explode('/', $info['filename']);\n array_pop($module_path);\n\n // We really only care about this module if it is in 'sites' or in\n // 'modules' folder.\n // Otherwise it is covered by the hash of the distro's modules.\n if ($module_path[0] == 'sites' || $module_path[0] == 'modules') {\n $contrib_path = implode('/', $module_path);\n\n // Get a hash for this module's files. If we nest into another module,\n // we'll return. and that other module will be covered by it's entry in\n // the system table.\n //\n // !! At present we aren't going to do a per module hash, but rather a\n // per-project hash. The reason being that it is too hard to tell an\n // individual module apart from a project.\n list($info['module_data']['hashes'], $info['module_data']['fileinfo']) = self::generateHashesHelper($contrib_path);\n }\n else {\n $info['module_data']['hashes'] = array();\n $info['module_data']['fileinfo'] = array();\n }\n\n $result[] = $info;\n }\n return $result;\n }", "public function getModules() {\n return $this->modules;\n }", "protected function _getListModuleNeedToByPassSession()\n {\n $modules = explode(\"\\n\", Mage::getStoreConfig('japi/jmango_rest_developer_settings/exclude_modules'));\n if (!count($modules)) return false;\n $helper = Mage::helper('core');\n foreach ($modules as $module) {\n if ($helper->isModuleEnabled(trim($module))) {\n return true;\n }\n }\n }", "protected function getModulesData() {}", "public static function getModules()\n \t{\n \t\t// Define & init static variables\n \t\tstatic\t$arrModules\t\t\t= NULL;\n \t\tstatic\t$selModules;\n \t\tstatic\t$selModuleConfig;\n \t\tstatic\t$arrCustomerGroups;\n \t\tif (!isset($arrModules))\n \t\t{\n\t \t\t$selModules\t\t\t= new StatementSelect(\"billing_charge_module\", \"*\", \"active_status_id = \".ACTIVE_STATUS_ACTIVE, \"ISNULL(customer_group_id) DESC\");\n\t \t\t$selModuleConfig\t= new StatementSelect(\"billing_charge_module_config\", \"*\", \"billing_charge_module_id = <id>\");\n\t \t\t\n\t \t\t$arrModules\t= Array();\n\t \t\t\n\t \t\t// Get list of CustomerGroups\n\t \t\t$selCustomerGroups\t= new StatementSelect(\"CustomerGroup\", \"Id\", \"1\");\n\t \t\tif ($selCustomerGroups->Execute() === FALSE)\n\t \t\t{\n\t \t\t\tthrow new Exception_Database(\"DB Error: \".$selCustomerGroups->Error());\n\t \t\t}\n\t \t\twhile ($arrCustomerGroup = $selCustomerGroups->Fetch())\n\t \t\t{\n\t \t\t\t$arrModules[$arrCustomerGroup['Id']]['Billing_Charge_Account']\t= Array();\n\t \t\t\t$arrModules[$arrCustomerGroup['Id']]['Billing_Charge_Service']\t= Array();\n\t \t\t\t\n\t \t\t\t$arrCustomerGroups[]\t= $arrCustomerGroup;\n\t \t\t}\n \t\t\t\n\t \t\t// Retrieve all Billing Charge Modules\n\t \t\tif ($selModules->Execute() !== FALSE)\n\t \t\t{\n\t \t\t\twhile ($arrModule = $selModules->Fetch())\n\t \t\t\t{\n\t \t\t\t\t// Instanciate the Class\n\t \t\t\t\t$modModule\t= new $arrModule['class']($arrModule['id']);\n\t \t\t\t\t\n\t \t\t\t\t// Is this Module for All CustomerGroups, or just one?\n\t \t\t\t\tif ($arrModule['customer_group_id'] === NULL)\n\t \t\t\t\t{\n\t \t\t\t\t\t// All CustomerGroups, although this can be overridden later\n\t \t\t\t\t\tforeach ($arrCustomerGroups as $arrCustomerGroup)\n\t \t\t\t\t\t{\n\t \t\t\t\t\t\t$arrModules[$arrCustomerGroup['Id']][get_parent_class($modModule)][get_class($modModule)]\t= $modModule;\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{\n\t \t\t\t\t\t// Just One CustomerGroup. If there is already an \"All\" Module defined, then override it\n\t \t\t\t\t\t$arrModules[$arrModule['customer_group_id']][get_parent_class($modModule)][get_class($modModule)]\t= $modModule;\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\tthrow new Exception_Database(\"DB ERROR: \".$selModules->Error());\n\t \t\t}\n \t\t}\n\t \t\n\t\t// Return array of Billing Charge Modules\n\t\treturn $arrModules;\n \t}", "function actionapiModules($page=1) {\n $this->isLogin();\n\t\tYii::app()->session['current'] = 'apiFunctions';\n $adminObj = new Admin();\n $adminId = $adminObj->getAdminDetailsByEmail(Yii::app()->session['email']);\n $adminDetails = $adminObj->getAdminDetailsById($adminId);\n \n $Api_moduleObj = new ApiModule();\n $result[0] = $Api_moduleObj->getModules($page);\n\n\t\t$data=array('moduleList'=>$result[0],'adminDetails'=>$adminDetails,'advanced'=>\"Selected\",'TITLE_ADMIN'=>$this->msg['_TITLE_FJN_ADMIN_API_MODULES_']);\n\t\t$this->render('api_modules',$data);\n }", "public function getModules()\n {\n return $this->modules;\n }", "public function getModules()\n {\n return $this->modules;\n }", "public function getModules()\n {\n return $this->modules;\n }", "public function index() //Not used just for testing\n {\n \n try{\n //Get all System Modules with thier permissions\n $sysModules = SystemModule::with('permissions')->get();\n\n //build the response\n $code = 200;\n $status = 'success';\n $message = \"All system permissions\";\n $dataContent = ['sysModules'=> $sysModules->toArray()];\n \n }catch (Exception $e) {\n\n //build the response\n $code = 401;\n $status = 'Exception';\n $message = \"Something went wrong\";\n $dataContent = $e;\n }\n\n return $this->returnApiResult($code, $status, $message, $dataContent);\n }", "public function getIncludedModules ();", "public function modulesAction()\n {\n $moduleList = $this->gridModule->getList();\n\n return new \\Zend\\View\\Model\\JsonModel(\n [\n 'success' => true,\n 'modules' => $moduleList,\n 'total' => count($moduleList),\n ]\n );\n }", "public function getModules()\n {\n $oxidConfig = oxConfig::getInstance();\n $modules = $oxidConfig->getShopConfVar('aModules');\n $moduleList = array();\n foreach ($modules as $oxidClass => $module) {\n $moduleList[$oxidClass] = explode('&', $module);\n }\n\n return $moduleList;\n }", "function getModuleList($add_extravars = false)\n {\n $args->sort_index = \"module_srl\";\n $args->page = 1;\n $args->list_count = 200;\n $args->page_count = 10;\n $args->s_module_category_srl = Context::get('module_category_srl');\n\n $output = executeQueryArray('xedocs.getManualList', $args);\n ModuleModel::syncModuleToSite($output->data);\n\n if(!$add_extravars){\n return $output->data;\n }\n\n $oModuleModel = &getModel('module');\n\n foreach($output->data as $module_info){\n $extra_vars = $oModuleModel->getModuleExtraVars($module_info->module_srl);\n foreach($extra_vars[$module_info->module_srl] as $k=>$v){\n $module_info->{$k} = $v;\n }\n }\n\n return $output->data;\n }", "function enabledModules() {\n\n\t\t// get user course\n\t\t$myCourse = Course::whereHas('users', function($query) {\n\t\t\t$query->where('course_role', '1')->where('user_id',$this->id);\n\t\t})->first();\n\n\t\t// gather module list and init array\n\t\t$allModules = Module::all();\n\t\t$modulesList = array();\n\n\t\t// return array of 1s if user is not registered to a course\n\t\tif ($myCourse == null) {\n\t\t\t$modulesList = array_fill(0,count($allModules)+1,1);\n\t\t\treturn $modulesList;\n\t\t}\n\n\t\t// gather list of enabled modules for user course\n\t\t$enabledModules = Module::select(array('id'))->whereHas('courses', function($q) use ($myCourse) {\n\t\t\t$q->where('course_id',$myCourse->id)->where('enabled',1);\n\t\t})->get();\n\n\t\t// generate a full list of modules and \n\t\t$modulesList = array_fill(0,count($allModules),0);\n\t\tforeach ($allModules as $mod) {\n\t\t\t// check if current mod is present in modules\n\t\t\tforeach($enabledModules as $eMod) {\n\t\t\t\tif ($eMod->id == $mod->id) {\n\t\t\t\t\t// add to modules list as 1\n\t\t\t\t\t$modulesList[$mod->id] = 1;\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t\treturn $modulesList;\n\n\t}", "public function getDirectoryModules();", "public function listModules() {\n\t\t\t// to use languages\n\t\t\tglobal $language;\n\t\t\t$this->lang = $language[parse_lang()];\n\n\t\t\t// only open when directory really exists\n\t\t\t$handler = file_exists($this->dir) ? opendir($this->dir) : die($this->lang['nodirectory']);\n\n\t\t\twhile (false !== ($entry = readdir($handler))) {\n\t\t\t\tif(preg_match('/^[m][o][d][_][0-9][A-Za-z]{3,}[.][p][h][p]$/', $entry)) {\n\t\t\t\t\tinclude($this->dir.'/'.$entry);\n\t\t\t\t\tif($config['innav'] == true) $this->listArray[$entry] = $config;\n\t\t\t\t\t$this->listRequires[$config['name']] = $requires;\n\t\t\t\t\t$this->listAttributes[$config['name']] = $config;\n\t\t\t\t}\n\t\t\t\tksort($this->listArray);\n\t\t\t}\n\t\t}", "public function getModules() {\n if($this->_Modules === NULL) {\n $this->_Modules = array();\n $dir = opendir('modules');\n while ($cnt = readdir($dir)) {\n if ($cnt == '.' || $cnt == '..') {\n continue;\n }\n $configFile = \"modules/$cnt/module.json\";\n if (!is_file($configFile)) {\n continue;\n }\n $json_data = file_get_contents($configFile);\n $config = json_decode($json_data, true);\n $config[\"folder\"] = \"modules/$cnt\";\n $config[\"config\"] = file_exists(\"modules/$cnt/config.php\") === true;\n $this->_Modules[$config['code']] = $config;\n }\n closedir($dir); \n }\n return $this->_Modules;\n }", "function get_modules(){\n\trequire_once($_SERVER['DOCUMENT_ROOT'].\"/libs/database.php\");\n\t// consulta obtener los modulos con acceso\n\t$sql=\"select m.nombre from modulos m,permiso_modulo mp where mp.id_modulo=m.id_modulo and mp.id_permiso=(select id_permiso from personal where id_personal=?)\";\n\n\t// toma la pk del usuario y obtiene los datos\n\t$params = array($_SESSION[\"id_personal\"]);\n\t$data = Database::getRows($sql, $params);\n\t// inicia todos los modulos en false\n\t$_modules = array();\n\t// recorre los modulos a los que tiene acceso\n\tforeach($data as $row)\n\t{\n\t\t// cambia a true el elemento de array que le corresponde al modulo\n\t\t$_modules[$row[\"nombre\"]] = true;\t\n\t}\n\treturn $_modules;\n}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function all()\n {\n return $this->modules;\n }", "public static function getAccessModules() {\n global $lC_Language;\n\n $lC_DirectoryListing = new lC_DirectoryListing('includes/modules/access');\n $lC_DirectoryListing->setIncludeDirectories(false);\n\n $modules = array();\n\n foreach ( $lC_DirectoryListing->getFiles() as $file ) {\n $module = substr($file['name'], 0, strrpos($file['name'], '.'));\n if ( !class_exists('lC_Access_' . ucfirst($module)) ) {\n $lC_Language->loadIniFile('modules/access/' . $file['name']);\n include($lC_DirectoryListing->getDirectory() . '/' . $file['name']);\n }\n $module = 'lC_Access_' . ucfirst($module);\n $module = new $module();\n $modules[lC_Access::getGroupTitle( $module->getGroup() )][] = array('id' => $module->getModule(),\n 'text' => $module->getTitle());\n }\n ksort($modules);\n\n return $modules;\n }", "public function get_installed_modules()\n\t{\n\t\tif ( ! is_array($this->installed_modules))\n\t\t{\n\t\t\t$this->installed_modules = array();\n\n\t\t\tee()->db->select('LOWER(module_name) AS name');\n\t\t\tee()->db->order_by('module_name');\n\t\t\t$query = ee()->db->get('modules');\n\n\t\t\tif ($query->num_rows())\n\t\t\t{\n\t\t\t\tforeach($query->result_array() as $row)\n\t\t\t\t{\n\t\t\t\t\t$this->installed_modules[$row['name']] = $row['name'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $this->installed_modules;\n\t}", "public function getLoadedModules() {}", "public static function listAPI($module = '', $ignoreAuth = false) {\n $apiList = self::loadFullAPIList();\n\n if ( $module == '' && $ignoreAuth == true ) {\n // Simplest case, return everything.\n return($apiList);\n }\n\n $apiFinalList = array();\n\n // Not such an easy case, we need to limit to specific modules and see if we have authentication (or not)\n foreach ( $apiList as $apiName => $apiOpts ) {\n if ( $module == '' || in_array($module,$apiOpts['supportedModules']) ) {\n // This matches the module criteria\n if ( $ignoreAuth || !$apiOpts['useAuth'] || !$apiOpts['requireAuth'] ) {\n // Don't need to worry about authentication\n $apiFinalList[$apiName] = $apiOpts;\n } else {\n // We need to worry about authentication\n $eapmBean = EAPM::getLoginInfo($apiName);\n if ( isset($eapmBean->application) ) {\n // We have authentication\n $apiFinalList[$apiName] = $apiOpts;\n }\n }\n }\n }\n\n return $apiFinalList;\n }", "function loadModletList($module) {\n\n\t//find our object modules if that hasn't been done already for this object type\n\tif (!$_SESSION[\"siteModletList\"][$module] || defined(\"DEV_MODE\")) {\n\n\t \t$siteModList = $_SESSION[\"siteModList\"];\n\t \t$modletArr = array();\n \n\t \t//get the keys of all modules that are objects\n\t \tif (!is_array($siteModList[\"modlet\"])) return false;\n\n\t \t$fields = array_keys($_SESSION[\"siteModList\"]);\n\n\t \t//get all our modlet modules with entries\n\t \t$modletCheck = arrayReduce($siteModList[\"modlet\"]);\n\t \t\n\t \t$num = count($siteModList[\"link_name\"]);\n\t \tfor ($i=0;$i<$num;$i++) {\n\t \t\n\t \t $modlet = $siteModList[\"modlet\"][$i];\n $permError = null;\n \n\t \t //stop here if there is no modlet entry\n\t \t if (!is_array($modlet)) continue;\n\n //if our current module is a modlet for the passed module, store it's info\n if (in_array($module,$modlet)) {\n\n //process our module permissions\n $arr = checkModPerm($siteModList[\"link_name\"][$i],BITSET);\n\n if (is_array($arr)) extract($arr);\n if ($permError) continue;\n \n foreach ($fields AS $field) {\n $modletArr[$field][] = $siteModList[$field][$i];\n }\n }\n\t \t\n\t \t}\n\t \t\n\t\t//so they are displayed in the proper order\n\t\tif (is_array($modletArr[\"modlet_sort\"])) $modletArr = arrayMultiSort($modletArr,\"module_sort\");\n else $modletArr = arrayMultiSort($modletArr,\"module_name\");\n \n\t\t$_SESSION[\"siteModletList\"][$module] = $modletArr;\n\n\t}\n\n\treturn $_SESSION[\"siteModletList\"][$module];\n\n}", "public function stationbysystem_get(){\n\t\t$id = $this->get('id');\n\t\tif(count($this->get())>1){\n\t\t\t$response = array(\n\t\t\t\t\"status\"=>\"error\",\n\t\t\t\t\"status_code\"=>409,\n\t\t\t\t\"message\"=>\"Too many params was sent\",\n\t\t\t\t\"validations\"=>array(\n\t\t\t\t\t\"id\"=>\"Send Id (Get) to get all stations belonging to a system\"\n\t\t\t\t),\n\t\t\t\t\"data\"=>null\n\t\t\t);\n\t\t}else{\n\t\t\tif($id){\n\t\t\t\t$response = $this->DAO->entitySelection('station',array('fkSystem'=>$id),FALSE);\n\t\t\t}else{\n\t\t\t\t$response = $this->DAO->entitySelection('station');\n\t\t\t}\n\t\t}\n\t\t$this->response($response,200);\n\t}", "public function indexAction()\n {\n $active = Pi::registry('modulelist')->read('active');\n $inactive = Pi::registry('modulelist')->read('inactive');\n\n $modules = array_merge($active, $inactive);\n foreach ($modules as $name => &$data) {\n $meta = Pi::service('module')->loadMeta(\n $data['directory'],\n 'meta'\n );\n $author = Pi::service('module')->loadMeta(\n $data['directory'],\n 'author'\n );\n $data['description'] = $meta['description'];\n $data['author'] = $author;\n $data['active'] = isset($active[$name]) ? true : false;\n if (empty($meta['logo'])) {\n $data['logo'] = Pi::url('static/image/module.png');\n } elseif (empty($data['active'])) {\n $data['logo'] = Pi::url('script/browse.php') . '?' . sprintf(\n 'module/%s/asset/%s',\n $data['directory'],\n $meta['logo']\n );\n } else {\n $data['logo'] = Pi::service('asset')->getModuleAsset(\n $meta['logo'],\n $data['name']\n );\n }\n if (empty($data['update'])) {\n $data['update'] = __('Never updated.');\n } else {\n $data['update'] = _date($data['update']);\n }\n }\n $this->view()->assign('modules', $modules);\n //$this->view()->setTemplate('module-list');\n $this->view()->assign('title', __('Installed modules'));\n }", "public function getLists()\n {\n try {\n $lists = $this->aweber->getAccount($this->access_token, $this->access_token_secret);\n return $this->response($lists);\n } catch (Exception $e) {\n throw new \\Exception($e->getMessage());\n }\n }", "public function getAllModules()\n {\n $modules = array();\n $query = 'SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id';\n\n if (\\Input::get('table') == 'tl_module' && \\Input::get('act') == 'edit') {\n $query .= ' WHERE m.id != ?';\n }\n\n $query .= ' ORDER BY t.name, m.name';\n $result = \\Database::getInstance()\n ->prepare($query)\n ->execute(\\Input::get('id'));\n\n while ($result->next()) {\n $modules[$result->theme][$result->id] = $result->name . ' (ID ' . $result->id . ')';\n }\n\n return $modules;\n }", "public function getModuleInfo($moduleId)\n {\n\n // get all module informations\n $url = Yii::app()->getModule('admin')->marketplaceApiUrl . \"info?id=\" . urlencode($moduleId) . \"&version=\" . HVersion::VERSION . \"&installId=\" . HSetting::Get('installationId', 'admin');\n try {\n\n $http = new Zend_Http_Client($url, array(\n 'adapter' => 'Zend_Http_Client_Adapter_Curl',\n 'curloptions' => $this->getCurlOptions(),\n 'timeout' => 30\n ));\n\n $response = $http->request();\n $json = $response->getBody();\n\n $moduleInfo = CJSON::decode($json);\n } catch (Exception $ex) {\n throw new CHttpException('500', Yii::t('AdminModule.libs_OnlineModuleManager', 'Could not get module info online! (%error%)', array('%error%' => $ex->getMessage())));\n }\n\n return $moduleInfo;\n }", "function forminator_get_modules() {\n\t$forminator = Forminator_Core::get_instance();\n\n\treturn $forminator->modules;\n}", "public function getSuggestedModules() {\r\n\r\n// array of which modules are valid for this company\r\n\t\t$valid = array('ReduceIT' => false,\r\n\t\t\t\t\t\t\t\t\t\t'MoveIT'\t=> false,\r\n\t\t\t\t\t\t\t\t\t\t'LoseIT'\t=> false,\r\n\t\t\t\t\t\t\t\t\t\t'BreakIT'\t=> false);\r\n\r\n// get the subscribed modules and set the valid array\r\n\t\t$sql = \"SELECT m.name FROM p_modules AS m \" .\r\n\t\t\t\t\t\t\"JOIN p_company_modules AS comp ON comp.p_module_id = m.id \" .\r\n\t\t\t\t\t\t\"JOIN u_profile AS prof ON prof.company_id = comp.p_company_id \" .\r\n\t\t\t\t\t\t\"WHERE prof.z_user_id = \" . $this->dbOb->escape_string($this->id) . \" \" .\r\n\t\t\t\t\t\t\"AND m.type = 'IT'\";\r\n\t\t$list = $this->dbOb->query($sql);\r\n\t\tforeach($list as $mn) {\r\n\t\t\t$name = preg_replace(\"/ /\", \"\", $mn['name']);\r\n\t\t\t$valid[$name] = true;\r\n\t\t}\r\n\r\n// get iFOCUS scores for each valid module\r\n\t\t$modules = array();\r\n\t\tforeach($valid as $key => $value) {\r\n\t\t\tif ($value) {\r\n\t\t\t\tif ($key == 'ReduceIT') {\r\n\t\t\t\t\t$score = $this->score_stress_management();\r\n\t\t\t\t\t$modules['ReduceIT'] = $score->total;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($key == 'MoveIT') {\r\n\t\t\t\t\t$score = $this->score_physical_activity();\r\n\t\t\t\t\t$modules['MoveIT'] = $score->total;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($key == 'LoseIT') {\r\n\t\t\t\t\t$score = $this->score_weight_nutrition();\r\n\t\t\t\t\t$modules['LoseIT'] = $score->total;\r\n\t\t\t\t}\r\n\t\t\t\telse if ($key == 'BreakIT') {\r\n\t\t\t\t\t$score = $this->score_tobaco_use();\r\n\t\t\t\t\t$modules['BreakIT'] = $score->total;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tunset($valid[$key]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$sql = \"SELECT name, class_name, short_description, image FROM p_modules \" .\r\n\t\t\t\t\t\t\"WHERE name IN ('Break IT', 'Lose IT', 'Move IT', 'Reduce IT')\";\r\n\t\t$pgm_list = $this->dbOb->query($sql);\r\n\r\n// populate image and link for each module\r\n/*\r\n\t\t$dets = array('ReduceIT'\t=> array ('link'\t=> \"/ModuleReduceIT/Index\",\r\n \t\t\t\t\t\t\t\t\t\t\t'img'\t=> \"/assets/media/images/reduceit/slide_reduceit.jpg\",\r\n \t\t\t\t\t\t\t\t\t\t\t'alt'\t=> \"ReduceIT\"),\r\n \t\t\t\t\t'MoveIT'\t=> array ('link'\t=> \"/ModuleMoveIT/Index\",\r\n \t\t\t\t\t\t\t\t\t\t\t'img'\t=> \"/assets/media/images/moveit/slide_moveit.jpg\",\r\n \t\t\t\t\t\t\t\t\t\t\t'alt'\t=> \"MoveIT\"),\r\n \t\t\t\t\t'LoseIT'\t=> array ('link'\t=> \"/ModuleLoseIT/Index\",\r\n \t\t\t\t\t\t\t\t\t\t\t'img'\t=> \"/assets/media/images/loseit/slide_loseit.jpg\",\r\n \t\t\t\t\t\t\t\t\t\t\t'alt'\t=> \"LoseIT\"),\r\n \t\t\t\t\t'BreakIT'\t=> array ('link'\t=> \"/ModuleBreakIT/Index\",\r\n \t\t\t\t\t\t\t\t\t\t\t'img'\t=> \"/assets/media/images/breakit/slide_breakit.jpg\",\r\n \t\t\t\t\t\t\t\t\t\t\t'alt'\t=> \"BreakIT\")\r\n \t\t\t\t);\r\n*/\r\n\t\t$details = array();\r\n\t\t$keys = array();\r\n\t\tforeach($pgm_list as $pgm) {\r\n\t\t\t$arr = array($pgm['class_name'] => array('link' => \"/\" . $pgm['class_name'] . \"/Index\",\r\n\t\t\t 'img' => $pgm['image'],\r\n\t\t\t 'alt' => $pgm['name'],\r\n\t\t\t 'text' => $pgm['short_description']));\r\n\t\t\tarray_push($details, $arr);\r\n\t\t\tarray_push($keys, $pgm['class_name']);\r\n\t\t}\r\n\r\n\r\n// if user has already taken the module, set the score to higher than the highest (5)\r\n\t\t$detail = array();\r\n\t\tforeach ($modules as $module => $score) {\r\n\t\t\tif ($module == \"ReduceIT\") {\r\n\t\t\t\t$model = new ModuleReduceITModel(true);\r\n\t\t\t\tif ($model->getLastCompleted() == 5) {\r\n\t\t\t\t\t$modules[$module] = 100.0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($module == \"MoveIT\") {\r\n\t\t\t\t$model = new ModuleMoveITModel(true);\r\n\t\t\t\tif ($model->getLastCompleted() == 5) {\r\n\t\t\t\t\t$modules[$module] = 100.0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($module == \"LoseIT\") {\r\n\t\t\t\t$model = new ModuleLoseITModel(true);\r\n\t\t\t\tif ($model->getLastCompleted() == 5) {\r\n\t\t\t\t\t$modules[$module] = 100.0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse if ($module == \"BreakIT\") {\r\n\t\t\t\t$model = new ModuleBreakITModel(true);\r\n\t\t\t\tif ($model->getLastCompleted() == 5) {\r\n\t\t\t\t\t$modules[$module] = 100.0;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n// sort modules by score\r\n\t\t$Arr = array();\r\n\t\twhile (count($Arr) < count($modules)) {\r\n\t\t\t$low = 99.0;\r\n\t\t\t$k = \"\";\r\n\t\t\tforeach($modules as $key => $score) {\r\n\t\t\t\tif ($score < $low) {\r\n\t\t\t\t\t$low = $score;\r\n\t\t\t\t\t$k = $key;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif ($k != \"\") {\r\n\t\t\t\t$Arr[$k] = $low;\r\n\t\t\t\t$modules[$k] = 100.0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n//Return the top three (if there's three)\r\n\t\t$count = 0;\r\n\t\tforeach ($Arr as $mod => $s) {\r\n\t\t\t$count += 1;\r\n\t\t\tif ($count > 3) break;\r\n\t\t\tif ($mod == \"ReduceIT\") {\r\n\t\t\t\tfor ($i = 0; $i < 4; $i++) {\r\n\t\t\t\t\tif ($keys[$i] == \"ModuleReduceIT\")\r\n \t\t\t\tarray_push($detail, $details[$i]['ModuleReduceIT']);\r\n \t\t}\r\n \t \t}\r\n \telse if ($mod == \"MoveIT\") {\r\n \t\t\t\tfor ($i = 0; $i < 4; $i++) {\r\n\t\t\t\t\tif ($keys[$i] == \"ModuleMoveIT\")\r\n \t \tarray_push($detail, $details[$i]['ModuleMoveIT']);\r\n \t }\r\n \t\t}\r\n\t \telse if ($mod == \"LoseIT\") {\r\n \t\t\t\tfor ($i = 0; $i < 4; $i++) {\r\n\t\t\t\t\tif ($keys[$i] == \"ModuleLoseIT\")\r\n\t\t\t \t\tarray_push($detail, $details[$i]['ModuleLoseIT']);\r\n\t\t\t }\r\n \t}\r\n \telse if ($mod == \"BreakIT\") {\r\n \t\t\t\tfor ($i = 0; $i < 4; $i++) {\r\n\t\t\t\t\tif ($keys[$i] == \"ModuleBreakIT\")\r\n\t\t \t\tarray_push($detail, $details[$i]['ModuleBreakIT']);\r\n\t\t }\r\n \t}\r\n }\r\n\r\n\t\treturn $detail;\r\n\t}", "public function listing()\n {\n $moduleId = $this->input->post(\"moduleId\");\n $lessonList = $this->Lesson_Model->listing($moduleId);\n echo json_encode($lessonList);\n }", "protected function getAllModules()\n {\n return Hook::getHookModuleExecList('displayHeader');\n }", "private static function getModulesForUser($moduleFolder) {\r\n\t\t$modules = self::getModules($moduleFolder);\r\n\t\t$loadedModules = array();\r\n\t\tif ($modules !== false) {\r\n\t\t\tforeach ($modules as $key => $module) {\r\n\t\t\t\t$notAuth = (isset($module['required_permission']) && !CoreUtils::hasPermission($module['required_permission']));\r\n\t\t\t\t/**\r\n * @todo Replace with MyRadio built in location Auth\r\n */\r\n\t\t\t\t$notStudio = (isset($module['required_location']) && ($module['required_location'] === True && self::isAuthenticatedMachine() === False));\r\n\t\t\t\t\r\n\t\t\t\tif ($notAuth && $notStudio) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n $loadedModules[] = $module;\r\n\t\t\t}\r\n\t\t\treturn $loadedModules;\r\n\t\t}\r\n\t\treturn false;\r\n\t}", "public function run()\n {\n $system_modules = $system_modules = array(\n array('id' => '1','name' => 'Escritorio','url' => '/','icon' => 'dashboard','view' => 'admin.home','parent' => '0','order' => '1','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '2','name' => 'Citas','url' => '/citas','icon' => 'calendar','view' => 'admin.appointment','parent' => '0','order' => '2','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '3','name' => 'Prospectos','url' => '/prospectos','icon' => 'group','view' => 'admin.prospect','parent' => '0','order' => '3','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '4','name' => 'Pacientes','url' => '/pacientes','icon' => 'user','view' => 'admin.patient','parent' => '0','order' => '4','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '5','name' => 'Inventario','url' => '/inventario','icon' => 'barcode','view' => 'admin.inventory','parent' => '0','order' => '5','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '6','name' => 'Gastos','url' => '/gastos','icon' => '','view' => 'admin.inventory.expenses','parent' => '5','order' => '1','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '7','name' => 'Ingresos','url' => '/ingresos','icon' => '','view' => 'admin.inventory.income','parent' => '5','order' => '2','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '8','name' => 'Categoría de gastos','url' => '/categoria_de_gastos','icon' => '','view' => 'admin.inventory.category_expenses','parent' => '5','order' => '3','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '9','name' => 'Categoría de ingresos','url' => '/categoria_de_ingresos','icon' => '','view' => 'admin.inventory.category_incomes','parent' => '5','order' => '4','created_at' => '2018-12-13 02:13:23','updated_at' => '2018-12-13 02:13:23'),\n array('id' => '10','name' => 'Contabilidad','url' => '/contabilidad','icon' => 'money','view' => 'admin.accounting','parent' => '0','order' => '6','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '11','name' => 'Impuestos','url' => '/impuestos','icon' => '','view' => 'admin.accounting.tax','parent' => '10','order' => '1','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '12','name' => 'Cuentas','url' => '/cuentas','icon' => '','view' => 'admin.accounting.account','parent' => '10','order' => '2','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '13','name' => 'Ejercicios','url' => '/ejercicios','icon' => '','view' => 'admin.accounting.exercise','parent' => '10','order' => '3','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '14','name' => 'Asientos','url' => '/asientos','icon' => '','view' => 'admin.accounting.entry','parent' => '10','order' => '4','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '15','name' => 'Grupos y Epígrafes','url' => '/grupos','icon' => '','view' => 'admin.accounting.groups','parent' => '10','order' => '5','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '16','name' => 'Formas de Pago','url' => '/formas_de_pago','icon' => '','view' => 'admin.accounting.payment','parent' => '10','order' => '6','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '17','name' => 'Series','url' => '/series','icon' => '','view' => 'admin.accounting.series','parent' => '10','order' => '7','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '18','name' => 'Remesas','url' => '/remesas','icon' => '','view' => 'admin.accounting.remittance','parent' => '10','order' => '8','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '19','name' => 'Compras','url' => '/compras','icon' => 'credit-card','view' => 'admin.purchase','parent' => '0','order' => '7','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '20','name' => 'Pedidos','url' => '/ordenes','icon' => '','view' => 'admin.purchase.orders','parent' => '19','order' => '1','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '21','name' => 'Proveedores','url' => '/proveedores','icon' => '','view' => 'admin.purchase.providers','parent' => '19','order' => '2','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '22','name' => 'Facturas','url' => '/facturas','icon' => '','view' => 'admin.purchase.invoices','parent' => '19','order' => '3','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '23','name' => 'Recibos','url' => '/recibos','icon' => '','view' => 'admin.purchase.receipts','parent' => '19','order' => '4','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '24','name' => 'Configuración','url' => '/configuracion','icon' => 'cog','view' => 'admin.configuration','parent' => '0','order' => '8','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '25','name' => 'Perfiles de Usuarios','url' => '/perfiles_de_usuarios','icon' => '','view' => 'admin.configuration.user_profiles','parent' => '24','order' => '1','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '26','name' => 'Usuarios','url' => '/usuarios','icon' => '','view' => 'admin.configuration.users','parent' => '24','order' => '2','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '27','name' => 'Empresa','url' => '/empresa','icon' => '','view' => 'admin.configuration.company','parent' => '24','order' => '3','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '28','name' => 'Servicios','url' => '/servicios','icon' => '','view' => 'admin.configuration.services','parent' => '24','order' => '4','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '29','name' => 'Especialidades','url' => '/especialidades','icon' => '','view' => 'admin.configuration.specialties','parent' => '24','order' => '5','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '30','name' => 'Doctores','url' => '/doctores','icon' => '','view' => 'admin.configuration.doctors','parent' => '24','order' => '6','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '31','name' => 'Reportes','url' => '/reportes','icon' => 'bar-chart','view' => 'admin.report','parent' => '0','order' => '9','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '32','name' => 'Clientes','url' => '/clientes','icon' => '','view' => 'admin.report.clients','parent' => '31','order' => '1','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '33','name' => 'Prospectos','url' => '/prospectos','icon' => '','view' => 'admin.report.prospects','parent' => '31','order' => '2','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '34','name' => 'Gastos','url' => ' /gastos','icon' => '','view' => 'admin.report.expenses','parent' => '31','order' => '3','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '35','name' => 'Ingresos','url' => '/ingresos','icon' => '','view' => 'admin.report.incomes','parent' => '31','order' => '4','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '36','name' => 'Facturas','url' => '/facturas','icon' => '','view' => 'admin.report.invoices','parent' => '31','order' => '5','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24'),\n array('id' => '37','name' => 'Pedidos','url' => '/pedidos','icon' => '','view' => 'admin.report.orders','parent' => '31','order' => '6','created_at' => '2018-12-13 02:13:24','updated_at' => '2018-12-13 02:13:24')\n);\n\n\n\t\tforeach ($system_modules as $item) {\n\t\t\tSystemModule::create($item);\n\t\t}\n }", "public static function getListStatic() {\n\n\t\t$list = array();\n\t\t$d = dir(CGN_MODULE_PATH);\n\t\twhile ($entry = $d->read()){\n\t\t\tif (substr($entry,0,1) == '.' || substr($entry, -1) == '~') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$mod = new Cgn_Module_Info($entry, NULL, CGN_MODULE_PATH.'/'.$entry);\n\t\t\t$list[] = $mod;\n\t\t}\n\n\t\tif (defined('CGN_MODULE_LOCAL_PATH') && file_exists(CGN_MODULE_LOCAL_PATH)) {\n\t\t\t$d = dir(CGN_MODULE_LOCAL_PATH);\n\t\t\twhile ($entry = $d->read()){\n\t\t\t\tif (substr($entry,0,1) == '.' || substr($entry, -1) == '~') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$mod = new Cgn_Module_Info($entry, NULL, CGN_MODULE_LOCAL_PATH.'/'.$entry);\n\t\t\t\t$list[] = $mod;\n\t\t\t}\n\t\t}\n\n\t\t$d = dir(CGN_ADMIN_PATH);\n\t\twhile ($entry = $d->read()){\n\t\t\tif (substr($entry,0,1) == '.' || substr($entry, -1) == '~') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$mod = new Cgn_Module_Info($entry, TRUE, CGN_ADMIN_PATH.'/'.$entry);\n\t\t\t$list[] = $mod;\n\t\t}\n\n\t\tif (defined('CGN_ADMIN_LOCAL_PATH') && file_exists(CGN_ADMIN_LOCAL_PATH)) {\n\t\t\t$d = dir(CGN_ADMIN_LOCAL_PATH);\n\t\t\twhile ($entry = $d->read()){\n\t\t\t\tif (substr($entry,0,1) == '.' || substr($entry, -1) == '~') {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t$mod = new Cgn_Module_Info($entry, TRUE, CGN_ADMIN_LOCAL_PATH.'/'.$entry);\n\t\t\t\t$list[] = $mod;\n\t\t\t}\n\t\t}\n\t\treturn $list;\n\t}", "public static function get_modules(){\n $parent_modules = self::where('parent','=',0)->get();\n\n $modules = array();\n\n foreach($parent_modules as $p) {\n\n $modules[] = array(\n 'id' => $p->id,\n 'name' => $p->name,\n 'kids' => self::where('parent','=',$p->id)->get()\n );\n\n }//endforeach\n\n \n return $modules;\n \n }", "public function uultra_get_modules_for_membership($package_id)\r\n\t{\r\n\t\tif(!get_option('userultra_default_user_features_package_'.$package_id.'') || $package_id=='')\r\n\t\t{\r\n\t\t\t$modules =get_option('userultra_default_user_features');\t\t\r\n\t\t\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\t$modules =get_option('userultra_default_user_features_package_'.$package_id.'');\t\t\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn $modules ;\r\n\t\t\r\n\t}", "public static function getModules()\n\t{\n\t\treturn (new \\App\\Db\\Query())->select(['vtiger_tab.tabid', 'vtiger_tab.tablabel', 'tabname' => 'vtiger_tab.name'])->from('vtiger_field')\n\t\t\t->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')->where(['uitype' => [15, 16, 33, 115], 'vtiger_field.presence' => [0, 2], 'vtiger_tab.presence' => 0])\n\t\t\t->distinct('vtiger_tab.tabid')->orderBy(['vtiger_tab.tabid' => SORT_ASC])->createCommand()->queryAllByGroup(1);\n\t}", "public static function modules() {\n\t\tif (!isset(self::$_modules)) {\n//\t\t\tif(\\GO::user()){\n//\t\t\t\n//\t\t\tCaching caused more problems than benefits\n//\t\t\t\n//\t\t\t\tif(isset(\\GO::session()->values['modulesObject']) && !isset($GLOBALS['GO_CONFIG'])){\n//\t\t\t\t\tself::$_modules=\\GO::session()->values['modulesObject'];\n//\t\t\t\t}else{\n//\t\t\t\t\tself::$_modules=\\GO::session()->values['modulesObject']=new \\GO\\Base\\ModuleCollection();\n//\t\t\t\t}\n//\t\t\t}else\n//\t\t\t{\n//\t\t\t\tself::$_modules=new \\GO\\Base\\ModuleCollection();\n//\t\t\t}\n\t\t\t\n\t\t\tself::$_modules=new \\GO\\Base\\ModuleCollection();\n\t\t}\n\t\treturn self::$_modules;\n\t}", "public function getRequestableModule();", "function getModulesBasic($conn){\n\t$sql = \"SELECT levelfour.name AS 'levelFourName', levelfour.LevelFourId AS 'levelFourID', levelthree.name AS 'levelThreeName', levelthree.LevelThreeId AS 'levelThreeID',leveltwo.name AS 'levelTwoName', leveltwo.LevelTwoId AS 'levelTwoID', levelone.name AS 'levelOneName', levelone.LevelOneId AS 'levelOneID' FROM `levelfour` JOIN levelthree ON levelfour.LevelThreeId = levelthree.LevelThreeId\n\tJOIN leveltwo ON levelthree.LevelTwoId = leveltwo.LevelTwoId\n\tJOIN levelone ON leveltwo.LevelOneId = levelone.LevelOneId\";\n\n\t$sth = $conn->prepare($sql);\n\t$sth->execute();\n\t\n\t$rows = array();\n\t\n\twhile($r = $sth->fetch(PDO::FETCH_ASSOC)) {\n\t\t$rows[] = $r;\n\t}\n\treturn $rows;\n}", "function check_module_visibilityANDavailability_standalone($moduleid){\n\n $DB=$GLOBALS['GLBMDL_DB'];\n\n //Controlled in Moodle Gui: under 'availability (under \"Common module settings\")'\n $module_infos=new stdClass();\n $module_restrictions= new stdClass();\n try {\n\n $module_infos= $DB->get_record('course_modules', array('id' =>$moduleid));\n $resource_course_infos=new stdClass();\n $resource_course_infos=get_course_infos($module_infos->course, $DB);\n\n $module_infos=$resource_course_infos->course_modules[$moduleid];\n\n $module_section_infos= $DB->get_record('course_sections', array('id' =>$module_infos->section));\n $module_section_availability = $module_section_infos->availability;\n\n //Get all module/section availability restrictions in array format: including those on complexe set of restrictions.\n $module_section_access_restrictions= get_availability_restelements_fromavfield( $module_section_availability);\n $module_access_restrictions= get_availability_restelements_fromavfield( $module_infos->availability );\n\n //Module visisbility: \"module visibility\" AND \"section visibility\"\n $module_restrictions->mod_visibility = $module_infos->visible;\n $module_restrictions->mod_accrestrictions = $module_access_restrictions;\n $module_restrictions->mod_section_accrestrictions = $module_section_access_restrictions;\n\n\n } catch (\\Exception $e) {\n //$module_infos->course_gen_infos = 'Resource not existant. Verify your request or contact Univ-Nantes Admin.';\n return $e;\n echo \"Exception occurred\";\n }\n\n return array($module_restrictions,decide_about_modVisibilityANDAvailability( $module_restrictions, 0, 0 ));\n\n }", "private function get_mods_information($search) {\n global $COURSE;\n $modnames = get_module_types_names(); //get all the names avaliable for this course\n \n //start with no names\n $filtered_names = array();\n\n //if the search is null, or empty then assume no filtering\n if (!empty($search)) {\n \n //generate the search regex pattern based on search string\n $pattern = $this->create_search_pattern($search);\n \n //go through all the possible modules possible\n foreach ($modnames as $modname=>$name) {\n \n //for each one that matches our search - add it to our filtered names list\n if (preg_match($pattern, $name))\n $filtered_names[$modname] = $name;\n }\n } else {//no filtering - use all mods\n $filtered_names = $modnames;\n }\n\n //get module details for all desired modules\n $modules = get_module_metadata($COURSE, $filtered_names); //get all metadata for the given names\n\n //return module info\n return $modules;\n }", "function qa_load_all_modules_with($method)\n{\n\t$modules = array();\n\n\t$regmodules = qa_list_modules_info();\n\n\tforeach ($regmodules as $moduletype => $modulesinfo) {\n\t\tforeach ($modulesinfo as $modulename => $moduleinfo) {\n\t\t\t$module = qa_load_module($moduletype, $modulename);\n\n\t\t\tif (method_exists($module, $method))\n\t\t\t\t$modules[$modulename] = $module;\n\t\t}\n\t}\n\n\treturn $modules;\n}", "public function getModules()\n {\n return array();\n }", "public function get_programModules($id) {\n\t\t//$id = Crypt::decryptString($id);\n\t\t// $programsModules = Program::with(['coach_program'=> function ($query) {\n\t\t// \t$query->where('coach_program.program_id','=','program.id');\n\t\t// },'modules' => function ($query) {\n\t\t// \t$query->orderBy('module_no');\n\t\t// }])->get();\n\n\t\t$programsModules = CoachProgram::with(['coach_program_detail','coach_program_detail.modules'=> function ($query) {\n\t\t\t$query->orderBy('module_no');\n\t\t}])->where('coach_id',$id)->get();\n\t\t//dd($programsModules);\n\t\treturn $programsModules;\n\t}", "public function getEnabledModules()\n {\n return array_filter($this->definitions, [$this, 'filterEnabled']);\n }", "public static function get_module($moduleid) {\n\t\n $context = get_context_instance(CONTEXT_SYSTEM);\n self::validate_context($context);\n require_capability('moodle/course:view', $context); \n $module = glueserver_course_db::glueserver_get_module($moduleid); \n $returns = array();\n foreach ($module as $m){\n \t\t$module = new glueserver_module($m);\n \t\t$returns[] = $module->get_data();\n }\n return $returns[0];\n }", "protected function installedModules()\n {\n $model = Pi::model('module');\n $select = $model->select()\n ->columns(array('dir' => new Expression('DISTINCT directory')));\n $rowset = $model->selectWith($select);\n $modules = array();\n foreach ($rowset as $row) {\n $modules[] = $row->dir;\n }\n\n return $modules;\n }", "public function actionLists()\n {\n\n $headers = apache_request_headers();\n $User = CustomerApiKey::model()->findUserByPublicKey($headers['X_MW_PUBLIC_KEY']);\n\n $this->user_id = $User->customer_id;\n\n if($User->private!=$headers['X_MW_PRIVATE_KEY'])\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','A private API Key is required.')\n ),400);\n }\n\n if(empty($User->public))\n {\n return $this->renderJson(array(\n 'status' => 'error',\n 'error' => Yii::t('api','A public API Key is required.')\n ),400);\n }\n $lists = array(\"lists\" => Lists::model()->getCustomerListsZapier($this->user_id));\n\n Logger::addProgress('(Zapier) ActionLists '.print_r($lists,true),'(Zapier) ActionLists');\n\n return $this->renderJson($lists,200);\n\n }", "function filter_dash_modules( $modules ) {\n \n $modules[] = 'My Tickets';\n \n //currently not using this\n //$this->add_template( 'dash_latesttickets', dirname( __FILE__ ) . '/dash_latesttickets.php' );\n \n return $modules;\n }", "public function getModulesPairs()\n\t{\n\t\t$db = $this->getDbTable()->getAdapter();\n\t\t$select = $db->select()\n\t\t\t->from(array('m' => 'system_modules'), array('module_name', 'id'));\n\t\treturn $db->fetchPairs($select);\n\t}", "function snowbuild_getmoduleinfo(){\n\t$info = array(\n\t\t\"name\"=>\"Snowman Building Contest\",\n\t\t\"version\"=>\"1.0\",\n\t\t\"author\"=>\"`\\$Red Yates`# & Shannon Brown\",\n\t\t\"download\"=>\"core_module\",\n\t\t\"category\"=>\"Village\",\n\t\t\"settings\"=>array(\n\t\t\t\"Snowman Building Module Settings, title\",\n\t\t\t\"perday\"=>\"Tries at building per day, int|1\",\n\t\t\t\"cost\"=>\"How much to carve a snowman, int|25\",\n\t\t\t\"snowbuildloc\"=>\"Village the snowman building is in, location|\",\n\t\t\t\"winner\"=>\"Whose snowman is on display, int|0\",\n\t\t),\n\t\t\"prefs\"=>array(\n\t\t\t\"Snowman Building User Prefs, title\",\n\t\t\t\"tries\"=>\"Times built today,int|0\"\n\t\t),\n\t);\n\treturn $info;\n}", "public function getAll()\n {\n $this->_modules['core'][] = array (\n 'module' => 'Magento',\n 'codePool' => 'core',\n 'active' => 'true',\n 'version' => Mage::getVersion()\n );\n\n foreach (Mage::getConfig()->getModuleConfig() as $node) {\n foreach ($node as $module => $data) {\n if (!isset($data->codePool)) {\n continue;\n }\n $codePool = $data->codePool->asArray();\n if (empty($codePool)) {\n continue;\n }\n if (is_array($codePool)) {\n $codePool = implode('.', $codePool);\n }\n\n $this->_modules[$codePool][] = array (\n 'module' => $module,\n 'codePool' => $codePool,\n 'active' => $data->active,\n 'version' => $data->version\n );\n }\n }\n\n return $this->_modules;\n }", "function qa_list_modules($type)\n{\n\t$modules = qa_list_modules_info();\n\treturn is_array(@$modules[$type]) ? array_keys($modules[$type]) : array();\n}", "public function getModuleList($forceScan = false)\n {\n if ($this->moduleList === null || $forceScan) {\n $this->scanDir();\n }\n\n return $this->moduleList;\n }", "public function actionIndex()\n {\n $searchModel = new ModuleSearch();\n //$dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n /* show only modules whose with status = {published, archived} in list view */\n $qParams = Yii::$app->request->queryParams;\n $qParams['ModuleSearch']['statusList'] = ['published','archived'];\n $dataProvider = $searchModel->search($qParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }", "public static function getModules()\n {\n $modules = [];\n $modules[] = new D2UModule('20-1',\n 'D2U Adressen - Adressausgabe',\n 10);\n $modules[] = new D2UModule('20-2',\n 'D2U Adressen - Kontaktbox',\n 5);\n $modules[] = new D2UModule('20-3',\n 'D2U Adressen - Weltkarte',\n 1);\n return $modules;\n }", "function usp_ews_modules_in_use($courseid) {\n global $DB;\n\t\n $dbmanager = $DB->get_manager(); // used to check if tables exist\n $modules = usp_ews_get_active_monitorable_modules();\n $modulesinuse = array();\n\n foreach ($modules as $module => $details) {\n if (\n $dbmanager->table_exists($module) &&\n $DB->record_exists($module, array('course'=>$courseid))\n ) {\n $modulesinuse[$module] = $details;\n }\n }\n return $modulesinuse;\n}", "protected function _get_lists() {\n\t\t/** @var Thrive_Dash_Api_KlickTipp $api */\n\t\t$api = $this->get_api();\n\n\t\ttry {\n\t\t\t$api->login();\n\t\t} catch ( Thrive_Dash_Api_KlickTipp_Exception $e ) {\n\t\t\treturn $this->error( sprintf( __( 'Could not connect to Klick Tipp using the provided data (%s)', 'thrive-dash' ), $e->getMessage() ) );\n\t\t}\n\n\t\ttry {\n\t\t\t$all = $api->getLists();\n\n\t\t\t$lists = array();\n\t\t\tforeach ( $all as $id => $name ) {\n\t\t\t\tif ( ! empty( $name ) ) {\n\t\t\t\t\t$lists[] = array(\n\t\t\t\t\t\t'id' => $id,\n\t\t\t\t\t\t'name' => $name,\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn $lists;\n\t\t} catch ( Thrive_Dash_Api_KlickTipp_Exception $e ) {\n\t\t\t$this->_error = $e->getMessage();\n\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.6519723", "0.64090395", "0.6387625", "0.6264763", "0.6264763", "0.6182842", "0.6080295", "0.6033333", "0.60101736", "0.60081464", "0.59897685", "0.5976847", "0.5955909", "0.59485173", "0.5936262", "0.58714646", "0.58619255", "0.5831128", "0.58197904", "0.58183616", "0.5800173", "0.5783523", "0.5755083", "0.5742425", "0.57317615", "0.5716133", "0.56801635", "0.565686", "0.55946857", "0.5583259", "0.55507374", "0.55324674", "0.55258787", "0.55084586", "0.5504625", "0.54982895", "0.54608345", "0.5459399", "0.54563546", "0.5436939", "0.5429421", "0.5428188", "0.5415958", "0.5381392", "0.5381392", "0.5381392", "0.53790504", "0.53774637", "0.53696144", "0.53376687", "0.53332704", "0.5329618", "0.53138185", "0.53127736", "0.5307166", "0.5305556", "0.53006965", "0.52956545", "0.5294822", "0.52946824", "0.52872545", "0.5286799", "0.5280012", "0.527669", "0.52755475", "0.5267051", "0.5259648", "0.5256768", "0.52510995", "0.5242082", "0.52288705", "0.5213347", "0.5206161", "0.5196788", "0.51935303", "0.5175094", "0.5165438", "0.51636785", "0.51634437", "0.5155302", "0.51552296", "0.5154841", "0.515466", "0.51438767", "0.5137913", "0.51306844", "0.5113126", "0.5112235", "0.5111206", "0.51087517", "0.510673", "0.5105599", "0.50934464", "0.50932723", "0.50916123", "0.5075999", "0.50594825", "0.505671", "0.50415975", "0.50287145" ]
0.74659175
0
Check if feed api in use.
public function isFeedChecked() { $base_config = $this->config_factory->getEditable('ap_newsroom.base_config'); if($base_config->get('use_feed')) { return TRUE; } else { return FALSE; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function can_create_feed() {\n\n\t\treturn $this->initialize_api();\n\n\t}", "function wpcom_vip_is_feedservice_ua() {\n\tif ( function_exists( 'wpcom_feed_cache_headers' ) ) {\n\t\t// Workaround so that no feed request served from nginx wpcom-feed-cache\n\t\t// If you are checking you must already know is a feed\n\t\t// and don't want any requests cached\n\t\t// ASSUMPTION: you've already confirmed is_feed() b/f calling\n\t\t// wpcom_vip_is_feedservice_ua\n\t\t\theader( \"X-Accel-Expires: 0\" );\n\t}\n\n\treturn (bool) preg_match(\"/feedburner|feedvalidator|MediafedMetrics/i\", $_SERVER[\"HTTP_USER_AGENT\"]);\n}", "public function isFeed()\n {\n if (($is = &$this->staticKey(__FUNCTION__)) !== null) {\n return $is; // Already cached this.\n }\n if (isset($_REQUEST['feed'])) {\n return $is = true;\n } elseif (!empty($_SERVER['REQUEST_URI']) && preg_match('/\\/feed(?:[\\/?]|$)/', $_SERVER['REQUEST_URI'])) {\n return $is = true;\n }\n return $is = false;\n }", "protected function api_connected() {\n\t\treturn ! empty( $this->api );\n\t}", "private static function checkFeed($feed_url){\n if( self::urlExists($feed_url)){\n if( self::xmlCheck($feed_url)){\n return true;\n }\n }\n return false;\n }", "protected function is_api_loaded()\n {\n }", "private function isApiAvailable() {\n\t\treturn get_option(\"wp_broadbean_ipavailibility\") == 1;\n\t}", "public function isFeed($url) {\n\t\t$feed = $this->getFeed($url);\n\t\treturn !empty($feed->url);\n\t}", "public function can_create_feed() {\n\t\t\n\t\treturn $this->initialize_api() && $this->api->is_client_folder_set();\n\t\t\n\t}", "public function hasFeedOptions() {\r\n $this->importCookie();\r\n\r\n if ($this->getOption('enable_feeds')) {\r\n $service = $this->getLinkedService(true); // $refresh := true\r\n return ($service && $this->cookie['can_publish'] && $service->hasFeedOptions());\r\n }\r\n\r\n return false;\r\n }", "public function is_feed($feeds = '')\n {\n }", "public function is_available() {\n\t\treturn $this->secret_api_key && $this->publishable_api_key;\n\t}", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('easywebshopsms/api_connection/active')==0) ? false : true;\n }", "static function is_api($request){\n if(strpos($request->url(), url('api').'/')!==false){\n return true;\n }\n\n return false;\n\n }", "function wpcom_vip_is_main_feed_requested() {\n\t$toMatch = '#^/(wp-(rdf|rss|rss2|atom|rssfeed).php|index.xml|feed|rss)/?$#i';\n\t$request = $_SERVER['REQUEST_URI'];\n\treturn (bool) preg_match( $toMatch, $request );\n}", "function forum_rss_feeds() {\n\n global $CFG;\n\n $status = true;\n\n //Check CFG->enablerssfeeds\n if (empty($CFG->enablerssfeeds)) {\n debugging('DISABLED (admin variables)');\n //Check CFG->forum_enablerssfeeds\n } else if (empty($CFG->forum_enablerssfeeds)) {\n debugging('DISABLED (module configuration)');\n //It's working so we start...\n } else {\n //Iterate over all forums\n if ($forums = get_records(\"forum\")) {\n foreach ($forums as $forum) {\n if (!empty($forum->rsstype) && !empty($forum->rssarticles) && $status) {\n\n $filename = rss_file_name('forum', $forum); // RSS file\n\n //First let's make sure there is work to do by checking existing files\n if (file_exists($filename)) {\n if ($lastmodified = filemtime($filename)) {\n if (!forum_rss_newstuff($forum, $lastmodified)) {\n continue;\n }\n }\n }\n\n //Ignore hidden forums\n if (!instance_is_visible('forum',$forum)) {\n if (file_exists($filename)) {\n @unlink($filename);\n }\n continue;\n }\n\n mtrace(\"Updating RSS feed for \".format_string($forum->name,true).\", ID: $forum->id\");\n\n //Get the XML contents\n $result = forum_rss_feed($forum);\n //Save the XML contents to file\n if (!empty($result)) {\n $status = rss_save_file(\"forum\",$forum,$result);\n }\n if (debugging()) {\n if (empty($result)) {\n echo \"ID: $forum->id-> (empty) \";\n } else {\n if (!empty($status)) {\n echo \"ID: $forum->id-> OK \";\n } else {\n echo \"ID: $forum->id-> FAIL \";\n }\n }\n }\n }\n }\n }\n }\n return $status;\n }", "public static function isApi()\n {\n return (self::getRequestType() == 'api')?true:false;\n }", "function lightboxgallery_rss_enabled() {\n global $CFG;\n\n return ($CFG->enablerssfeeds && get_config('lightboxgallery', 'enablerssfeeds'));\n}", "public function isRssEnabled()\n {\n return Mage::getStoreConfigFlag('rss/config/active') &&\n Mage::getStoreConfigFlag('komaks_newsedit/author/rss');\n }", "public function checkApiIsUp() {\n\t\t$result = $this->useCfCURLQuery( \"https://socket.bittrex.com/signalr/ping\" );\n\t\tif ( $result ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "protected static function _checkApiAvailability(){\n\t\t$fbLib = static::_getApiPath();\n\t\tif (!\\file_exists($fbLib)){\n\t\t\tthrow new ClassNotFoundException('Facebook Lib not there! Do git submoule init first!');\n\t\t}\n\t}", "public function isNotReadyForRequests() {\n return empty($this->service_url) || empty($this->api_key);\n }", "public function hasRss($context = null);", "private static function xmlCheck($feed_url) {\n $xml = new \\XMLReader();\n $xml->open($feed_url);\n $xml->setParserProperty(\\XMLReader::VALIDATE, true);\n if( $xml->isValid()) {\n\n if( @simplexml_load_file($feed_url)) {\n return true;\n }\n else{\n return false;\n }\n }\n else{\n return false;\n }\n }", "public function isAvailable()\n {\n if (empty($this->_url)) {\n return false;\n } // if\n\n try {\n $this->sendrequest('status', null);\n } catch (Exception $e) {\n return false;\n }\n\n return true;\n }", "static public function isApi() {\n return\n isset($_SERVER['REQUEST_URI'])\n && strpos($_SERVER['REQUEST_URI'], \"/passage/\") !== false;\n }", "public static function hasFacebookSupport()\n {\n return static::enabled(static::facebook());\n }", "function ppom_is_api_enable() {\n \n $api_enable = get_option( 'ppom_api_enable' );\n $api_key = get_option( 'ppom_rest_secret_key' );\n \n $return = false;\n \n if( $api_enable == 'yes' && $api_key != '' ) {\n $return = true;\n }\n \n return $return;\n}", "public function isApiEnabled()\n {\n return (Mage::getStoreConfig('smsnotifier/main_conf/active')==0) ? 0 : 1;\n\n }", "function forum_rss_feed($forum) {\n\n global $CFG;\n\n $status = true;\n\n //Check CFG->enablerssfeeds\n if (empty($CFG->enablerssfeeds)) {\n debugging(\"DISABLED (admin variables)\");\n //Check CFG->forum_enablerssfeeds\n } else if (empty($CFG->forum_enablerssfeeds)) {\n debugging(\"DISABLED (module configuration)\");\n //It's working so we start...\n } else {\n //Check the forum has rss activated\n if (!empty($forum->rsstype) && !empty($forum->rssarticles)) {\n //Depending of the forum->rsstype, we are going to execute, different sqls\n if ($forum->rsstype == 1) { //Discussion RSS\n $items = forum_rss_feed_discussions($forum);\n } else { //Post RSS\n $items = forum_rss_feed_posts($forum);\n\n }\n //Now, if items, we begin building the structure\n if (!empty($items)) {\n //First all rss feeds common headers\n $header = rss_standard_header(strip_tags(format_string($forum->name,true)),\n $CFG->wwwroot.\"/mod/forum/view.php?f=\".$forum->id,\n format_string($forum->intro,true));\n //Now all the rss items\n if (!empty($header)) {\n $articles = rss_add_items($items);\n }\n //Now all rss feeds common footers\n if (!empty($header) && !empty($articles)) {\n $footer = rss_standard_footer();\n }\n //Now, if everything is ok, concatenate it\n if (!empty($header) && !empty($articles) && !empty($footer)) {\n $status = $header.$articles.$footer;\n } else {\n $status = false;\n }\n } else {\n $status = false;\n }\n }\n }\n return $status;\n }", "protected function _checkExists($api)\n\t{\n\t\treturn (file_exists($this->getPath().'/'.$api.'/config.xml') && file_exists($this->getPath().'/'.$api.'/init.php'));\n\t}", "public function isAPI(){\n $paths = explode(\"/\", $this->path);\n if(isset($paths[0]) && strtolower($paths[0])==\"api\"){\n return true;\n }\n return false;\n }", "protected function is_feed_404() {\n\t\tif ( ! \\is_feed() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$wp_query = $this->query_wrapper->get_query();\n\n\t\t// Don't 404 if the query contains post(s) or an object.\n\t\tif ( $wp_query->posts || $wp_query->get_queried_object() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Don't 404 if it isn't archive or singular.\n\t\tif ( ! $wp_query->is_archive() && ! $wp_query->is_singular() ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function isRssEnabled()\n {\n return Mage::getStoreConfigFlag('rss/config/active') &&\n Mage::getStoreConfigFlag('tpl_eventsmanager/invitationstatus/rss');\n }", "public function validateApiKey()\n {\n $request = $this->call('GET', 'helper/ping');\n return !empty($request);\n }", "function is_comment_feed()\n {\n }", "function wprss_is_feed_source_updating( $id ) {\n // Get the 'updating' meta field\n $is_updating_meta = get_post_meta( $id, 'wprss_feed_is_updating', TRUE );\n\n // Check if the feed has the 'updating' meta field set\n if ( $is_updating_meta === '' ) {\n // If not, then the feed is not updating\n return FALSE;\n }\n\n // Get the limit used for the feed\n $limit = get_post_meta( $id, 'wprss_limit', true );\n if ( $limit === '' || intval( $limit ) <= 0 ) {\n $global_limit = wprss_get_general_setting('limit_feed_items_imported');\n $limit = ( $global_limit === '' || intval( $global_limit ) <= 0 ) ? NULL : $global_limit;\n }\n\n\t\t// Calculate the allowed maximum time, based on the maximum number of items allowed to be\n // imported from this source.\n // If no limit is used, 60s (1min) is used.\n $single_item_time_limit = wprss_get_item_import_time_limit();\n\t\t$allowed_time = $limit === NULL ? 60 : $single_item_time_limit * intval( $limit );\n\n // Calculate how many seconds have passed since the feed last signalled that it is updating\n $diff = time() - $is_updating_meta;\n\n // If the difference is greater than the allowed maximum amount of time, mark the feed as idle.\n\t\tif ( $diff > $allowed_time ) {\n\t\t\twprss_flag_feed_as_idle( $id );\n // Feed is not updating\n\t\t\treturn FALSE;\n\t\t}\n\n // Feed is updating\n\t\treturn TRUE;\n }", "private function queryFeed()\n\t{\n\t\t$api_endpoint = $this->supported_sites->getKey('facebook', 'api_endpoint');\t\t\n\t\t$client = new Client(['base_url' => $api_endpoint]);\n\t\ttry {\n\t\t\t$response = $client->get($this->id, [\n\t\t\t\t'query' => [\n\t\t\t\t\t'access_token' => $this->credentials['app_token']\n\t\t\t\t]\n\t\t\t]);\n\t\t\t$feed = json_decode($response->getBody());\n\t\t\t$this->feed = $feed;\n\t\t} catch (\\Exception $e){\n\t\t\tthrow new \\Exception($e->getMessage());\n\t\t}\n\t}", "public function authorize()\n {\n $feedID = $this->route('feed');\n if (isset($feedID)) {\n return !empty(Feed::find($feedID));\n }\n\n return true;\n }", "public function isRss() {\n $isRss = false;\n $settings = $this->getContainerSettings();\n $feedAppendage = $this->xpdo->getOption('rssAlias',$settings,'feed.rss,rss');\n $feedAppendage = explode(',',$feedAppendage);\n $fullUri = $this->xpdo->context->getOption('base_url',null,MODX_BASE_URL).$this->get('uri');\n\n $hasQuery = strpos($_SERVER['REQUEST_URI'],'?');\n $requestUri = !empty($hasQuery) ? substr($_SERVER['REQUEST_URI'],0,$hasQuery) : $_SERVER['REQUEST_URI'];\n if (strpos($requestUri,$fullUri) === 0 && strlen($fullUri) != strlen($requestUri)) {\n $appendage = rtrim(str_replace($fullUri,'',$requestUri),'/');\n if (in_array($appendage,$feedAppendage)) {\n $isRss = true;\n }\n }\n return $isRss;\n }", "public function isPubliclyAvailable() {\n $id = $this->getID();\n $the_post = $this->find('first', array(\n 'conditions' => array(\n 'Post.id' => $id,\n ),\n 'fields' => array(\n 'Post.enabled',\n 'Post.published',\n ),\n 'recursive' => -1,\n 'callbacks' => false,\n ));\n\n $invalid_post = empty($the_post);\n\n// Don't try to process any more logic unless we know the Post even exists.\n if ($invalid_post) {\n return false;\n }\n\n $disabled_post = $the_post['Post']['enabled'] === false;\n $unpublished_post = new DateTime($the_post['Post']['published']) > new DateTime();\n\n if ($disabled_post || $unpublished_post) {\n return false;\n }\n else {\n return true;\n }\n }", "public function setApi() {\n\t\tif(sienna_mikado_twitter_feed_installed()) {\n\t\t\t$this->api = \\MikadofTwitterApi::getInstance();\n\t\t}\n\t}", "public static function available()\n\t{\n\t\treturn function_exists('curl_init');\n\t}", "function wprss_do_not_cache_feeds( &$feed ) {\n $feed->enable_cache( false );\n }", "function feed_widget_admin_access() {\r\n $arguments = func_get_args();\r\n $feed = array_shift($arguments);\r\n foreach ($arguments as $access) {\r\n if (!user_access($access)) {\r\n return FALSE;\r\n }\r\n }\r\n return feed_widget_access($feed);\r\n}", "public function apiReady() {\n \n if(!$this->isReady()) {\n $this->error(\"apiReady() - not ready.\");\n return false;\n }\n \n if(empty($this->userId)) {\n $this->error(\"apiReady() - user id is not set.\");\n return false;\n }\n \n if(empty($this->getToken())) {\n $this->error(\"apiReady() - no access token.\");\n return false;\n }\n \n if(empty($this->getSecret())) {\n $this->error(\"apiReady() - no access token secret.\");\n return false;\n }\n \n /* ready! */\n \n return true;\n }", "function checkInput()\r\n\t{\r\n\t\tglobal $lng;\r\n\t\t\r\n\t\t$lng->loadLanguageModule(\"feed\");\r\n\t\t\r\n\t\t$_POST[$this->getPostVar()] = \r\n\t\t\tilUtil::stripSlashes($_POST[$this->getPostVar()]);\r\n\t\t\t\r\n\t\t// remove safari pseudo protocol\r\n\t\tif (substr($_POST[$this->getPostVar()], 0, 5) == \"feed:\")\r\n\t\t{\r\n\t\t\t$_POST[$this->getPostVar()] = \"http:\".\r\n\t\t\t\tsubstr($_POST[$this->getPostVar()], 5);\r\n\t\t}\r\n\t\t\r\n\t\t// add missing http://\r\n\t\tif (!is_int(strpos($_POST[$this->getPostVar()], \"://\")))\r\n\t\t{\r\n\t\t\t$_POST[$this->getPostVar()] = \"http://\".$_POST[$this->getPostVar()];\r\n\t\t}\r\n\t\t\t\r\n\t\t// check required\r\n\t\tif ($this->getRequired() && trim($_POST[$this->getPostVar()]) == \"\")\r\n\t\t{\r\n\t\t\t$this->setAlert($lng->txt(\"msg_input_is_required\"));\r\n\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// check feed url\r\n\t\t$url = $_POST[$this->getPostVar()];\r\n\t\tinclude_once(\"./Services/Feeds/classes/class.ilExternalFeed.php\");\r\n\t\t$check = ilExternalFeed::_checkUrl($url);\r\n\r\n\t\t// try to determine a feed url, if we failed here\r\n\t\tif ($check !== true)\r\n\t\t{\r\n\t\t\t$url2 = ilExternalFeed::_determineFeedUrl($url);\r\n\t\t\t$check2 = ilExternalFeed::_checkUrl($url2);\r\n\t\t\t\r\n\t\t\tif ($check2 === true)\r\n\t\t\t{\r\n\t\t\t\t$_POST[$this->getPostVar()] = $url2;\r\n\t\t\t\t$check = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// if check failed, output error message\r\n\t\tif ($check !== true)\r\n\t\t{\r\n\t\t\t$check = str_replace(\"MagpieRSS:\", \"\", $check);\r\n\t\t\t$this->setAlert($lng->txt(\"feed_no_valid_url\").\"<br />\".$check);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "public function is_comment_feed()\n {\n }", "public function isAvailable(): bool;", "public function is_update_available() {\n\t\t$theme_info = $this->get_info();\n\n\t\tif ( $this->is_api_error( $theme_info ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( version_compare( $theme_info->version, $this->theme_data->get( 'Version' ), '<=' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $plugin_info;\n\t}", "protected function isApiCall(Request $request)\n {\n return strpos($request->getUri(), '/api/') !== false;\n }", "function available() {\n\t\treturn function_exists('curl_init');\n\t}", "protected function isApiCall(Request $request)\n {\n return starts_with($request->getRequestUri(), '/api/') !== false;\n }", "private function _api_key_exists()\n {\n $apikey = Apikey::where('secret', '=', $this->_key)->first();\n if (!$apikey) {\n return false;\n }\n return true;\n }", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "public function isAvailable() {}", "function woo_multibanco_gateway_check_api() {\n\t\t$api_key = $this->api_key;\n\t\t\n\t\tif($api_key == \"sk_live_XXXXXXXXXXXXXXXXXXXXXXXX\" || $api_key == \"sk_test_XXXXXXXXXXXXXXXXXXXXXXXX\") {\n\t\t\tadd_action('admin_notices', array($this, 'woo_multibanco_gateway_api_key_admin_notice_error'));\n\t\t}\n\t}", "private static function _is_internal() {\n\t\t// Skip for preview, 404 calls, feed, search, favicon and sitemap access.\n\t\treturn is_preview() || is_404() || is_feed() || is_search()\n\t\t\t|| ( function_exists( 'is_favicon' ) && is_favicon() )\n\t\t\t|| '' !== get_query_var( 'sitemap' ) || '' !== get_query_var( 'sitemap-stylesheet' );\n\t}", "public function hasPulldf(){\r\n return $this->_has(24);\r\n }", "function available() {\n\t\treturn function_exists('fsockopen');\n\t}", "function isAvailable()\n {\n }", "public function updateIsAvailable()\n {\n return self::INSTALLED_VERSION != $this->version;\n }", "private function isInternal()\n {\n return Request::segment(1) != 'api';\n }", "public function is_api_request($is_api_request)\n {\n }", "public function getApiUsageAvailable() {\n return @$this->attributes['api_usage_available'];\n }", "public function hasFacebook(): bool;", "public static function hasTwitterSupport()\n {\n return static::enabled(static::twitter());\n }", "public function hasAuthticket()\n {\n return $this->get(self::AUTHTICKET) !== null;\n }", "public static function is_available()\n {\n }", "function facebook_enabled()\r\n{\r\n\tglobal $settings;\r\n\t\r\n\treturn !empty($settings['facebook_app_id']) && !empty($settings['facebook_app_secret']);\r\n}", "public static function isAvailable ()\n\t{\n\t\tif (!function_exists('curl_version')){\n\t\t\treturn false;\n\t\t}\n\n\t\t$versionInfo = curl_version();\n\t\t$versionTab = explode('.', $versionInfo['version']);\n\n\t\tif ($versionTab[0] < 7 || ($versionTab[0] == 7 && $versionTab[1] < 10) || ($versionTab[0] == 7 && $versionTab[1] == 10 && $versionTab[2] < 5)){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public function existsfeedupdatesAction()\n {\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // get GET/POST paramter\n $r = $this->_request->getParam('r');\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the subscription id from storage with use of the resource uri\n $subscriptionId = $subscriptionStorage->getSubscriptionIdByResourceUri($r);\n\n // if the subscription id isn't empty\n if (false !== $subscriptionId) {\n //get the erfurt cache dir\n $cacheFiles = scandir($this->_owApp->erfurt->getTmpDir());\n\n // search thrue the cahce dir to find filename with the subscription id\n foreach ($cacheFiles as $filename) {\n if (false !== strpos($filename, 'pubsub_'.$subscriptionId .'_')) {\n // if filename found output 'true' end return\n echo \"true\";\n return;\n }\n }\n }\n\n // if no filname with the subscrition id found or no subscription id was found\n // make output false\n echo \"false\";\n }", "private function _check_socials_access() {\n\n return Access_token::inst()->check_socials_access($this->c_user->id);\n\n }", "public function get_feed()\n {\n }", "public function set_is_api_request() {\n\t\t// Constant is not defined until parse_request.\n\t\tif ( ! $this->is_api_request ) {\n\t\t\t$this->is_api_request = defined( 'REST_REQUEST' ) && REST_REQUEST;\n\t\t}\n\t}", "function ticketbud_server_connectivity_ok() {\n\t// skip the check on WPMU because the status page is hidden\n\tglobal $ticketbud_unused_api_key;\n\tif ( $ticketbud_unused_api_key )\n\t\treturn true;\n\t$servers = ticketbud_get_server_connectivity();\n\treturn !( empty($servers) || !count($servers) || count( array_filter($servers) ) < count($servers) );\n}", "function getIsAvailable() ;", "public function CheckModule()\r\n\t{\r\n\t\tif($this->settings['API_KEY'] != $this->API_Key)\r\n\t\t\treturn FALSE;\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}", "public function get_api_is_reachable() {\n\t\t$enabled = get_option( 'algolia_api_is_reachable', 'no' );\n\n\t\treturn 'yes' === $enabled;\n\t}", "function isEnabled()\n{\n global $avahips_config;\n\n // Load Avahi-PS configuration file\n $aps_cfg = load_conffile($avahips_config);\n\n // Check for IPFS as a backend database for publication\n if (isset($aps_cfg['DATABASE']) && strpos($aps_cfg['DATABASE'], 'ipfs') !== false) {\n return true;\n }\n return false;\n}", "function isAvailable() ;", "function isAvailable() ;", "function wp_widget_rss_process($widget_rss, $check_feed = \\true)\n {\n }", "function is_twitch_online() {\n\t$twitch_stream = get_url_contents(\"https://api.twitch.tv/kraken/streams?channel=\" . get_theme_mod('twitch_profile') . \"\");\n\t$result = json_decode($twitch_stream, true);\n\tif ( $result['streams'] != null ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "public function hasRequest(): bool;" ]
[ "0.73219836", "0.6992901", "0.6945008", "0.68728346", "0.6842441", "0.6797434", "0.670532", "0.6701433", "0.6661849", "0.66510284", "0.64179325", "0.641213", "0.6411932", "0.63662285", "0.6359877", "0.6289321", "0.62438464", "0.6224127", "0.6219437", "0.62183994", "0.6185424", "0.6167215", "0.6157776", "0.6144431", "0.611727", "0.6115057", "0.6101075", "0.60882986", "0.60747665", "0.6043502", "0.6023016", "0.5987656", "0.5986052", "0.5980699", "0.5976397", "0.5973869", "0.5957391", "0.5943647", "0.5935377", "0.59041435", "0.5900671", "0.589589", "0.58730906", "0.5866499", "0.5849779", "0.5848702", "0.5844007", "0.5826868", "0.58179575", "0.58155537", "0.57915986", "0.5780787", "0.576516", "0.57628196", "0.575132", "0.575132", "0.575132", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.57499945", "0.5746106", "0.57387376", "0.57377386", "0.57269114", "0.57005686", "0.56846994", "0.5684553", "0.5676823", "0.5652668", "0.56501323", "0.5649693", "0.5647986", "0.56438947", "0.56312245", "0.56243247", "0.5621483", "0.561654", "0.5613397", "0.56022024", "0.5600864", "0.55988115", "0.5594328", "0.558713", "0.55841637", "0.5573988", "0.5573988", "0.55687225", "0.55648", "0.55642384" ]
0.72887605
1
Prepare node entity for cloning
public function prepareNodeForClone($entity_type) { $item_id = $this->getItemId(); if($item_id) { $singleContentResponse = $this->apNewsroomContent->getContentById($item_id); return $this->mapAPDataToNode($entity_type,$singleContentResponse); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function node_object_prepare(&$node) {\n $node_options = variable_get('node_options_'. $node->type, array('status', 'promote'));\n // If this is a new node, fill in the default values.\n if (!isset($node->nid)) {\n foreach (array('status', 'promote', 'sticky') as $key) {\n $node->$key = in_array($key, $node_options);\n }\n global $user;\n $node->uid = $user->uid;\n $node->created = REQUEST_TIME;\n }\n else {\n $node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');\n // Remove the log message from the original node object.\n $node->log = NULL;\n }\n // Always use the default revision setting.\n $node->revision = in_array('revision', $node_options);\n\n node_invoke($node, 'prepare');\n node_invoke_nodeapi($node, 'prepare');\n}", "public function prepare($node, $row) {\n EntityHelper::removeInvalidFieldDeltas('node', $node);\n EntityHelper::removeEmptyFieldValues('node', $node);\n }", "public function __clone()\n {\n // If the entity has an identity, proceed as normal.\n if ($this->id) {\n // unset identifiers\n $this->setId(0);\n \n // init validator\n $this->initValidator();\n \n // reset Workflow\n $this->resetWorkflow();\n \n $this->setCreatedDate(null);\n $this->setCreatedUserId(null);\n $this->setUpdatedDate(null);\n $this->setUpdatedUserId(null);\n \n \n }\n // otherwise do nothing, do NOT throw an exception!\n }", "public function prepare($node, $row) {\n $node->field_project_roles[LANGUAGE_NONE] = $this->getProjectRoles($node, $row);\n\n // Remove any empty or illegal delta field values.\n EntityHelper::removeInvalidFieldDeltas('node', $node);\n EntityHelper::removeEmptyFieldValues('node', $node);\n }", "public function __clone()\n {\n // if the entity has no identity do nothing, do NOT throw an exception\n if (!$this->id) {\n return;\n }\n \n // otherwise proceed\n \n // unset identifier\n $this->setId(0);\n \n // reset workflow\n $this->setWorkflowState('initial');\n \n // reset upload fields\n $this->setAvatarUpload(null);\n \n $this->setCreatedBy(null);\n $this->setCreatedDate(null);\n $this->setUpdatedBy(null);\n $this->setUpdatedDate(null);\n \n \n // clone categories\n $categories = $this->categories;\n $this->categories = new ArrayCollection();\n foreach ($categories as $c) {\n $newCat = clone $c;\n $this->categories->add($newCat);\n $newCat->setEntity($this);\n }\n }", "public function __clone()\n {\n // if the entity has no identity do nothing, do NOT throw an exception\n if (!($this->id)) {\n return;\n }\n \n // otherwise proceed\n \n // unset identifiers\n $this->setId(0);\n \n // reset workflow\n $this->resetWorkflow();\n \n $this->setCreatedBy(null);\n $this->setCreatedDate(null);\n $this->setUpdatedBy(null);\n $this->setUpdatedDate(null);\n \n \n // clone categories\n $categories = $this->categories;\n $this->categories = new ArrayCollection();\n foreach ($categories as $c) {\n $newCat = clone $c;\n $this->categories->add($newCat);\n $newCat->setEntity($this);\n }\n }", "public function prepare($entity, $row) {\n $row->field_location = explode('|', $row->field_location);\n\n $wrapper = entity_metadata_wrapper('node', $entity);\n $wrapper->field_location->set(array(\n 'lat' => +$row->field_location[0],\n 'lng' => +$row->field_location[1],\n ));\n }", "function prepareForCopy() {\n\t\t$this->id = null;\n\t}", "public function __clone()\n {\n $this->headers = clone $this->headers;\n $this->encoder = clone $this->encoder;\n $this->cacheKey = bin2hex(random_bytes(16)); // set 32 hex values\n $children = [];\n foreach ($this->children as $pos => $child) {\n $children[$pos] = clone $child;\n }\n $this->setChildren($children);\n }", "public function __clone()\n {\n $this->_id = null;\n $this->_key = null;\n $this->_rev = null;\n // do not change the _changed flag here\n }", "public function cloneTo(Entity $toEntity)\r\n {\r\n $thisData = $this->toArray();\r\n $thisData['id'] = null;\r\n $toEntity->fromArray($thisData);\r\n }", "public function __clone()\n {\n foreach ($this->children as $key => $value) {\n if (is_object($value)) {\n $this->children[$key] = clone $value;\n }\n }\n }", "public function __clone() {\n\t\tif ($this->dimensions instanceof Collection) {\n\t\t\t$existingDimensions = $this->dimensions->toArray();\n\t\t\t$this->dimensions = new ArrayCollection();\n\t\t\t/** @var NodeDimension $existingDimension */\n\t\t\tforeach ($existingDimensions as $existingDimension) {\n\t\t\t\t$this->dimensions->add(new NodeDimension($this, $existingDimension->getName(), $existingDimension->getValue()));\n\t\t\t}\n\t\t}\n\t}", "public function cloneNode() {\n return clone $this;\n }", "public function __clone()\n {\n $this->id = null;\n\n // Generate a new identifier\n $identifier = Uuid::uuid1()->toString();\n $this->identifier = $identifier;\n $this->uri = 'local:'.$this->identifier;\n\n // Set last change/update to now\n $this->updatedAt = new \\DateTimeImmutable();\n $this->changedAt = $this->updatedAt;\n }", "public function __clone()\n\t{\n\t\t$this->children=[];\n\t}", "protected function prepare() \n {\n $this->array = new ArrayNode;\n }", "public function __clone()\n {\n $this->_id = null;\n }", "public function __clone()\n {\n foreach ($this->parameters as $key => $child) {\n $this->parameters[$key] = clone $child;\n $this->parameters[$key]->parent = $this;\n }\n }", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "private function __clone(){}", "public function cloneNode()\n\t\t{\n\t\t\t$oDomNode = dom_import_simplexml( $this );\n\t\t\t$oNewNode = $oDomNode->cloneNode( true );\n\t\t\t\n\t\t\treturn( simplexml_import_dom( $oNewNode, \"SimpleXMLElementExt\" ) );\t\t\t\n\t\t\t\n\t\t}", "protected function __clone(){}", "public function getEntityClone()\n {\n return $this->entity;\n }", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function __clone() {}", "protected function prepare()\n {\n $this->slug = $this->getSubmittedSlug();\n\n if ($this->isNew()) {\n $this->prepForNewEntry();\n } else {\n $this->prepForExistingEntry();\n }\n\n // As part of the prep, we'll apply the date and slug. We'll remove them\n // from the fields array since we don't want it to be in the YAML.\n unset($this->fields['date'], $this->fields['slug']);\n\n $this->fieldset = $this->content->fieldset()->withTaxonomies();\n }", "public function __clone() {\n $this->actions = clone $this->actions;\n $this->actions->setRoot($this->getRoot());\n $this->conditions = clone $this->conditions;\n $this->conditions->setRoot($this->getRoot());\n }", "private function __clone () {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "private function __clone() {}", "public function __clone()\n\t{\n\t\t$this->_name = null;\n\t\tparent::__clone();\n\t}", "public function testPreSetDataWithNewNode()\n {\n Phake::when($this->node)->getId()->thenReturn(null);\n Phake::when($this->event)->getData()->thenReturn($this->node);\n\n $this->subscriber->preSetData($this->event);\n\n Phake::verify($this->form)->add('nodeSource', 'orchestra_node_choice', array(\n 'required' => false,\n 'mapped' => false,\n 'label' => 'open_orchestra_backoffice.form.node.node_source'\n ));\n }", "protected function __clone() { }", "function prepareData(){\n $this->ref = array();\n foreach($this->getIterator() as $junk=>$item){\n // current values\n $id = $item[$this->id_field];\n \n // save item\n $this->items[$id] = $item;\n \n // save relation\n if(isset($item[$this->parent_id_field])) {\n $this->ref[$item[$this->parent_id_field]][] = $id;\n } else {\n $this->ref[undefined][] = $id;\n }\n }\n }", "public function __construct() {\n $this->nodeStorage = \\Drupal::entityTypeManager()->getStorage('node');\n }", "private function __clone(){ }", "public function __clone(){\n\t trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n\t }", "final private function __clone(){}", "public function __clone()\n {\n $this->init(clone $this->original, $this->encoding);\n }", "function osa_clone_node_alter_group_class(&$node, $context) {\r\n $node->field_event_children['und'][0]['value'] = json_encode(array());\r\n}", "public static function fromNode(Node $node);", "public function __clone()\n\t {\n\t trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n\t }", "public function nodePreSave(EntityEvent $event) {\n $node = $event->getEntity();\n $node->status = 1;\n\n // Prevent bug caused by pathauto menu rebuild outside of Drupal context.\n // @see http://previousnext.com.au/blog/using-behat-and-drupaldriver-beware-pathauto\n $node->path = array('pathauto' => 0);\n\n if (module_exists('workbench_moderation')) {\n $node->workbench_moderation_state_new = 'published';\n }\n }", "public function prepareRow($row) {\n if ($row->parent_id == 0) {\n $row->parent_id = NULL;\n }\n }", "private function __clone(){\n\t\t\n\t}", "private function __clone ()\n\t{}", "private function _setUpNewNode(Node $node)\n {\n $node->setContainer($this->_container);\n\n return $node;\n }", "private function replicateNodeTree(Node $node): Node\n {\n /** @var Node $new */\n $new = $node->copy();\n\n $this->copyChildren($node, $new);\n\n return $new;\n }", "public function __clone()\n {\n $this->constructedObjectId = spl_object_hash($this);\n }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "private function __clone() { }", "protected function __clone() {\n \n }", "private function __clone() { \n\n\t}", "public function __clone()\n {\n trigger_error('La clonación de este objeto no está permitida', E_USER_ERROR);\n\n }" ]
[ "0.64748895", "0.64306897", "0.6331925", "0.616428", "0.6071687", "0.6031265", "0.59198064", "0.58280045", "0.58152056", "0.57362133", "0.56623363", "0.56195015", "0.5575454", "0.5532027", "0.55180246", "0.550112", "0.5494381", "0.54736334", "0.54394907", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.54049236", "0.5390099", "0.53768593", "0.53250057", "0.5320001", "0.5320001", "0.5320001", "0.5320001", "0.5320001", "0.5320001", "0.5320001", "0.5316026", "0.530845", "0.530289", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.528009", "0.52526426", "0.52488464", "0.52379555", "0.5232949", "0.52290654", "0.52262753", "0.5212264", "0.5210155", "0.5197678", "0.5195955", "0.5193265", "0.5188767", "0.5186931", "0.518279", "0.51821035", "0.5173943", "0.51697093", "0.51657313", "0.5165108", "0.515313", "0.515313", "0.515313", "0.515313", "0.515313", "0.515313", "0.515313", "0.515313", "0.515313", "0.515313", "0.51502347", "0.51474094", "0.5145338" ]
0.66675603
0
Get itemID from url.
public function getItemId() { $item_id = $this->request_stack->getCurrentRequest()->query->get('item_id'); if(!$item_id) { throw new InvalidArgumentException('Item id is not valid.'); } return $this->request_stack->getCurrentRequest()->query->get('item_id'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static public function getIdFromUrl($url) {\n $cleanedUrl = substr($url, 0, -1); // Remove last / from url.\n $explodedUrl = explode('/', $cleanedUrl);\n return (int) end($explodedUrl); // Get id from url\n }", "private static function get_id_from_url(string $url): string {\n\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb->posts} WHERE guid='$url'\";\n $id = $wpdb->get_var($query);\n\n return $id;\n }", "public function getId($item);", "public static function getIdFromUrl($url) {\n\t\t\n\t\t$url = filter_var($url, FILTER_VALIDATE_URL);\n\t\t\n\t\t$pattern = '|^http://[^/]+(.*)/([0-9]+)(\\\\?.*)?$|' ;\n\t\t\t\n \tpreg_match($pattern, $url, $matches);\n \t\n \tif (count($matches) < 3) {\n \t\tthrow new RegexException('Invalid url. Id cannot be extracted.');\n \t}\n \t\n \treturn $matches[2];\n\t\t\n\t}", "function getIdFromLinkVnExpress($url) {\n // tra ve dc id cua url truyen vao\n // url thi la bat ky link nao theo dung dinh dang cua VNExpress\n $arrUrl = explode('-', $url); // chuyen chuoi ve mang\n $strId = end($arrUrl); // lay ra phan tu cuoi cung cua mang va khong lam thay doi mang ban dau\n $id = intval($strId);\n return $id;\n}", "public static function getIdFromUrl($url)\n {\n $base_url = WEB_SERVER_BASE_URL . '/badges/';\n $id = (int) str_replace($base_url, '', $url);\n\n return $id;\n }", "static public function GetGETItemId() {\n if (isset(self::$itemId))\n return self::$itemId;\n else\n return false;\n }", "abstract public function getItem($url,$itemId);", "protected function get_id_for_item( $item ) {\n\t\tif ( ! empty( $item['id'] ) ) {\n\t\t\treturn $item['id'];\n\t\t}\n\n\t\t// Check to see if the item already had a non-empty ID, else generate one from the title.\n\t\tif ( preg_match( '/id=([\"\\'])(?P<id>[^\"\\']+)\\\\1/', $item['attrs'], $m ) ) {\n\t\t\t$id = $m['id'];\n\t\t} else {\n\t\t\t$id = sanitize_title( $item['title'] );\n\t\t}\n\n\t\t// Append unique suffix if anchor ID isn't unique in the document.\n\t\t$count = 2;\n\t\t$orig_id = $id;\n\t\twhile ( in_array( $id, $this->used_ids ) && $count < 50 ) {\n\t\t\t$id = $orig_id . '-' . $count;\n\t\t\t$count++;\n\t\t}\n\n\t\t$this->used_ids[] = $id;\n\n\t\treturn $id;\n\t}", "function url_to_postid($url)\n {\n }", "public function idByUrl($url) {\n $url_parts = parse_url($url);\n if (isset($url_parts['host']) and in_array($url_parts['host'], self::$_hosts) and isset($url_parts['query'])) {\n $query = $url_parts['query'];\n $params = explode('&', $query);\n foreach ($params as $pair) {\n list($key, $value) = explode('=', $pair);\n if ($key === 'v' and $value) {\n return $value;\n }\n }\n }\n\n return null;\n }", "private function __getCategoryIdFromUrl() {\n return $this->uri->segment( 3, 0 );\n }", "static function getPMIDfromURL($url)\n {\n $pieces = explode('/', $url); // make array of url bits\n $id = preg_grep(\"/[0-9]/\", $pieces); // get just the PMID portion of URL\n $id = array_values($id); // reset array keys\n if ($id[0]) {\n return $id[0]; // return the PMID\n } else {\n return \"There is an error with the url\";\n }\n }", "protected function extractId($url)\n {\n $parts = explode('/', $url);\n return end($parts);\n }", "function getItemid() {\r\n\t\t$db = & JFactory::getDBO();\r\n\t\t$user = & JFactory::getUser() ;\r\n\t\t$sql = \"SELECT id FROM #__menu WHERE link LIKE '%index.php?option=com_osmembership%' AND published=1 AND `access` IN (\".implode(',', $user->getAuthorisedViewLevels()).\") ORDER BY `access`\";\t\t\t\r\n\t\t$db->setQuery($sql) ;\r\n\t\t$itemId = $db->loadResult();\t\t\r\n\t\tif (!$itemId) {\r\n\t\t\t$Itemid = JRequest::getInt('Itemid');\r\n\t\t\tif ($Itemid == 1)\r\n\t\t\t\t$itemId = 999999 ;\r\n\t\t\telse \r\n\t\t\t\t$itemId = $Itemid ;\t\r\n\t\t}\t\t\t\r\n\t\treturn $itemId ;\t\r\n\t}", "function entry_id_from_url_title($url_title)\n\t{\n ee()->db->where('url_title', $url_title)->limit(1);\n $entry = ee()->db->get('channel_titles')->row_array(); \n if($entry)\n {\n return $entry['entry_id'];\n }\n return false;\n\t}", "function fjarrett_get_attachment_id_by_url($url) {\n\t\t$parsed_url = explode( parse_url(WP_CONTENT_URL, PHP_URL_PATH), $url);\n\t\t$this_host = str_ireplace('www.', '', parse_url(home_url(), PHP_URL_HOST));\n\t\t$file_host = str_ireplace('www.', '', parse_url($url, PHP_URL_HOST));\n\t\tif (!isset($parsed_url[1]) || empty($parsed_url[1]) || ($this_host != $file_host)) {\n\t\t\treturn;\n\t\t}\n\t\tGlobal $wpdb;\n\t\t$prefix = is_multisite() ? $wpdb->base_prefix : $wpdb->prefix;\n\t\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM {$prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1]));\n\t\treturn $attachment[0];\n\t}", "public static function url($itemID = '') {\n\t\t$url = new Purl(self::pw('pages')->get('pw_template=whse-bin-inquiry')->url);\n\t\tif (empty($itemID)) {\n\t\t\treturn $url->getUrl();\n\t\t}\n\t\t$url->query->set('itemID', $itemID);\n\t\treturn $url->getUrl();\n\t}", "public function getUrlId();", "function attachment_url_to_postid($url)\n {\n }", "public function getURLID( $url )\n {\n if( !empty($this->urlIDs[ $url ]) ){ return $this->urlIDs[ $url ]; }\n else\n {\n $theURLID = $this->APICall( array( 'url' => $url ), \"Could not lookup the URL ID for url \" . $url );\n $this->urlIDs[ $url ] = $theURLID;\n return $theURLID;\n }\n }", "public function getItemID()\n {\n return $this->itemID;\n }", "public function getItemID()\n {\n return $this->itemID;\n }", "function dahz_get_attachment_id_from_url( $url ) {\n\tglobal $wpdb;\n\n\t$prefix = $wpdb->prefix;\n\n\t$posts = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $url ) ); \n \n\treturn array_shift( $posts );\n}", "public function getID($url,$type = \"video\"){\n parse_str(preg_replace('/https:\\/\\/[www|m]\\.youtube\\.com\\/|watch\\?|https:\\/\\/[www|m]\\.youtube\\.com\\/|playlist\\?/','',$url));\n if($type == \"video\"){\n if(isset($v)){return $v;}\n else{return FALSE;} \n }elseif($type == \"playlist\"){\n\n if(isset($list)){return $list;}\n else{return FALSE;}\n }else{return FALSE; } \n }", "function jmayt_id_from_url($url) {\n if (preg_match('%(?:youtube(?:-nocookie)?\\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\\.be/)([^\"&?/ ]{11})%i', $url, $match)) {\n $id = $match[1];\n return $id;\n }\n return false;\n}", "public function getId()\n\t{\n\t $pattern = '/http\\:\\/\\/(\\w{3}\\.)?break.com\\/(.*)/';\n\t preg_match( $pattern, $this->url, $match );\n\n return !empty( $match[2] ) ? $match[2] : null;\n\t}", "function fjarrett_get_attachment_id_by_url( $url ) {\n\t$parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\tif ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n\t\treturn;\n\t}\n\n\tglobal $wpdb;\n\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\n\treturn $attachment[0];\n}", "function themify_get_attachment_id_from_url( $url = '', $base_url = '' ) {\r\n\t\t// If this is the URL of an auto-generated thumbnail, get the URL of the original image\r\n\t\t$url = preg_replace( '/-\\d+x\\d+(?=\\.(jpg|jpeg|png|gif)$)/i', '', $url );\r\n\r\n\t\t$id = attachment_url_to_postid( $url );\r\n\t\treturn $id;\r\n\t}", "protected function getRemoteId(&$item)\n {\n $remote_id = null;\n if(!empty($item['booking_id']))\n {\n $remote_id = $item['booking_id'];\n unset($item['booking_id']);\n }\n if(!empty($item['remote_id']))\n {\n $remote_id = $item['remote_id'];\n unset($item['remote_id']);\n }\n return ($this->usePrefix ? $this->prefix: '') . $remote_id;\n }", "private function getEdxCourseId($url)\n {\n return substr($url, strrpos($url,'-')+1);\n }", "public function getId()\n\t{\n\t\t$videoId\t= '';\n\n\t\tpreg_match('/videos\\/(.*)/', $this->url , $matches);\n\t \tif (!empty($matches[1])){\n\t\t\t$videoId\t= $matches[1];\n\t\t}\n\n\t\treturn $videoId;\n\t}", "function get_item_id($item_name) {\n $item_list = make_get_call(\"items\");\n \n foreach ($item_list as $key => $value) {\n if (strtolower($value) == $item_name) return $key;\n }\n \n return $item_list;\n }", "public function pId()\n {\n static $id = null;\n\n if (!is_null($id)) {\n return $id;\n }\n\n $id = $this->property('id');\n\n if (strpos($id, 'http') === 0) {\n $path = explode('/', parse_url($id, PHP_URL_PATH));\n\n if ($path[1] == 'gallery') {\n $id = $path[2];\n }\n elseif ($path[1] == 'a') {\n $id = 'a/'.$path[2];\n }\n else {\n $id = $path[1];\n }\n }\n\n return $id;\n }", "public function getItemId()\n {\n return $this->item_id;\n }", "function getYoutubeID($url){\n $cut = substr($url, strpos($url, \"=\") + 1, 11);\n return $cut;\n }", "private function getIdFromRedirectedUrl(): string\n {\n $url = $this->getResponse()\n ->getHeader('Location')\n ->getFieldValue();\n $pattern = '!/id/(.*?)/!';\n $result = preg_match($pattern, $url, $matches);\n\n return $result ? $matches[1] : '';\n }", "public function getIdItem() {\n return intval($this->idItem);\n }", "function getId()\n\t{\n\t\t$id=(int)$_GET['prodid'];\n\t\tif(is_int($id))\n\t\t{\n\t\t\treturn $id;\n\t\t}\n\t}", "function ywraq_get_attachment_id_by_url( $url ) {\n\t\t// Split the $url into two parts with the wp-content directory as the separator\n\t\t$parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n\t\t// Get the host of the current site and the host of the $url, ignoring www\n\t\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\n\t\t// Return nothing if there aren't any $url parts or if the current host and $url host do not match\n\t\tif ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Now we're going to quickly search the DB for any attachment GUID with a partial path match\n\t\t// Example: /uploads/2013/05/test-image.jpg\n\t\tglobal $wpdb;\n\n\t\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\n\t\t// Returns null if no attachment is found\n\t\treturn $attachment[0];\n\t}", "function get_guid_from_url($url) {\n\treturn 0;\n}", "function get_id_from_link($link)\n\t{\n\t\t$link_bits = explode('/', $link);\n\t\treturn $link_bits[(count($link_bits)-1)];\n\t}", "public function getItemId() {\n return $this->item->getItemId();\n }", "public function getItemId()\n {\n return $this->itemId;\n }", "public static function getIdByURL($URL)\n\t{\n\t\t// exists\n\t\treturn (int) FrontendModel::getDB()->getVar('SELECT id\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM tags\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE url = ?;',\n\t\t\t\t\t\t\t\t\t\t\t\t\t(string) $URL);\n\t}", "function wpbm_get_image_id( $image_url ){\n global $wpdb;\n $query = \"SELECT ID FROM {$wpdb -> posts} WHERE guid='$image_url'\";\n $id = $wpdb -> get_var( $query );\n return $id;\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "public function getItemId()\n {\n return $this->get(self::_ITEM_ID);\n }", "function tfuse_get_attachment_id_by_url( $url ) {\r\n $attachment_id = 0;\r\n $dir = wp_upload_dir();\r\n if ( false !== strpos( $url, $dir['baseurl'] . '/' ) ) { // Is URL in uploads directory?\r\n $file = basename( $url );\r\n $query_args = array(\r\n 'post_type' => 'attachment',\r\n 'post_status' => 'inherit',\r\n 'fields' => 'ids',\r\n 'posts_per_page' => 1,\r\n 'meta_query' => array(\r\n array(\r\n 'value' => $file,\r\n 'compare' => 'LIKE',\r\n 'key' => '_wp_attached_file',\r\n ),\r\n )\r\n );\r\n $query = new WP_Query( $query_args );\r\n if ( $query->have_posts() ) {\r\n return $query->posts[0];\r\n }\r\n }\r\n\r\n return $attachment_id;\r\n }", "public function get_itemid($params) {\n global $DB;\n\n $item = $DB->get_record_sql('SELECT id FROM {workshop_submissions}\n WHERE workshopid = ?\n AND authorid = ?\n AND content = ?',\n array($params->moduleid, $params->userid, $params->onlinetext)\n );\n\n return ($item) ? $item->id : 0;\n }", "private function get_resource_id( $item ) {\n\t\t\tswitch ( $item->type ) {\n\t\t\t\tcase 'file':\n\t\t\t\t\t$item->key = \"file:{$item->post_id}\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ecv':\n\t\t\t\t\t$item->key = \"ecv:{$item->ecv_id}\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'uri':\n\t\t\t\t\t$item->key = $item->uri;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tforeach ( $this->resource_map as $resource ) {\n\t\t\t\tif ( $resource->key == $item->key )\n\t\t\t\t\treturn $resource->id;\n\t\t\t}\n\n\t\t\t$item->id = \\GTO\\Framework\\Util\\UUID::v4();\n\t\t\t$this->resource_map[ ] = $item;\n\t\t\treturn $item->id;\n\t\t}", "private function getItemid($view, $id = null)\n\t{\n\t\t// Get all relevant menu items.\n\t\t$items = $this->menu->getItems('component', 'com_conference');\n\n\t\t// ItemId\n\t\t$itemId = null;\n\n\t\tif ($id)\n\t\t{\n\t\t\tforeach ($items as $item)\n\t\t\t{\n\t\t\t\tif (\n\t\t\t\t\t(isset($item->query['view']) && $item->query['view'] == $view) &&\n\t\t\t\t\t(isset($item->query['id']) && $item->query['id'] == $id))\n\t\t\t\t{\n\t\t\t\t\t$itemId = $item->id;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (!$itemId)\n\t\t{\n\t\t\tforeach ($items as $item)\n\t\t\t{\n\t\t\t\tif (isset($item->query['view']) && $item->query['view'] == $view)\n\t\t\t\t{\n\t\t\t\t\t$itemId = $query['Itemid'] = $item->id;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn $itemId;\n\t}", "public function getItemId();", "function strip_url( $url ) {\n\t\t\t$id_match = '[0-9a-zA-Z\\-_]+';\n\t\t\tif ( preg_match( '|https?://(www\\.)?youtube\\.com/(watch)?\\?.*v=(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[3];\n\t\t\telse if ( preg_match( '|https?://(www\\.)?youtube(-nocookie)?\\.com/embed/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[3];\n\t\t\telse if ( preg_match( '|https?://(www\\.)?youtube\\.com/v/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[2];\n\t\t\telse if ( preg_match( '|http://youtu\\.be/(' . $id_match . ')|', $url, $matches ) )\n\t\t\t\t$id = $matches[1];\n\t\t\telse if ( !preg_match( '|^http|', $url, $matches ) )\n\t\t\t\t$id = $url;\n\t\t\t\n\t\t\treturn $id;\n\t\t}", "function thegrapes_get_attachment_id_by_url( $url ) {\n\n // Split the $url into two parts with the wp-content directory as the separator\n $parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n // Get the host of the current site and the host of the $url, ignoring www\n $this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n $file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\n // Return nothing if there aren't any $url parts or if the current host and $url host do not match\n if ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n return;\n }\n\n // Now we're going to quickly search the DB for any attachment GUID with a partial path match\n\n // Example: /uploads/2013/05/test-image.jpg\n global $wpdb;\n $attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\n // Returns null if no attachment is found\n return $attachment[0];\n}", "public function getId_item()\n {\n return $this->id_item;\n }", "public function getItemId()\n\t{\n\t\treturn $this->_itemID;\n\t}", "static function youtube_id_from_url($url) {\n\t\t$pattern = '#(?:https?://)?(?:www\\.)?(?:youtu\\.be/|youtube\\.com(?:/embed/|/v/|/watch\\?v=|/watch\\?.+&v=))([\\w-]{11})(?:.+)?#x';\n\t\t$result = preg_match($pattern, $url, $matches);\n\n\t\tif (false != $result) {\n\t\t\treturn $matches[1];\n\t\t}\n\t\treturn false;\n\t}", "public function getItemIdentifier()\n {\n return $this->itemIdentifier;\n }", "public function get_id() {\n\t\tif ( isset( $this->item['id'] ) ) {\n\t\t\treturn esc_attr( $this->item['id'] );\n\t\t}\n\n\t\treturn false;\n\t}", "public function getId()\r\n {\r\n if (isset($this->data['itemid'])) {\r\n return $this->data['itemid'];\r\n }\r\n return null;\r\n }", "static function get_attachment_id_by_url($url) {\n\t\t// Split the $url into two parts with the wp-content directory as the separator\n\t\t$parsed_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n\t\t// Get the host of the current site and the host of the $url, ignoring www\n\t\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\t\t// Return nothing if there aren't any $url parts or if the current host and $url host do not match\n\t\tif ( ! isset( $parsed_url[1] ) || empty( $parsed_url[1] ) || ( $this_host != $file_host ) ) {\n\t\t\treturn null;\n\t\t}\n\t\t// Now we're going to quickly search the DB for any attachment GUID with a partial path match\n\t\t// Example: /uploads/2013/05/test-image.jpg\n\t\tglobal $wpdb;\n\t\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parsed_url[1] ) );\n\t\t// Returns null if no attachment is found\n\t\tif ( ! empty( $attachment[0] ) ) {\n\t\t\treturn $attachment[0];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "public function getItemKey($item) {\n\t\treturn $item->id;\n\t}", "public function getItemIdentifier() : string\n\t{\n\t\treturn $this->itemIdentifier;\n\t}", "public static function getIdByUrl($url)\n\t{\n\t\treturn (int) FrontendModel::getDB()->getVar('SELECT p.id FROM profiles AS p WHERE p.url = ?', (string) $url);\n\t}", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "function getId_item()\n {\n if (!isset($this->iid_item) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->iid_item;\n }", "public function getItemId()\n {\n return $this->getItem()->getId();\n }", "public function get_item_id(){\n $this->db->select('itemID')->from('item')->where('itemID', );\n $query = $this->db->get();\n \n if($query->num_rows() == 1)\n {\n $row = $query->row(0);\n return $row->itemID;\n }\n }", "public function getId() {\n if($this->items!==false)\n return @current($this->items)->id_str;\n return false;\n }", "public function getItemId() {\n\t\treturn($this->itemId);\n\t}", "public function getId(object $item): mixed\n {\n return $item->id;\n }", "function rockthemes_get_image_id_from_url($image_url) {\n\tglobal $wpdb;\n\t$prefix = $wpdb->prefix;\n\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $image_url )); \n\tif(!empty($attachment) && $attachment[0]){\n return $attachment[0]; \n\t}else{\n\t\t$new_image_url = '';\n\t\t\n\t\tif(strpos($image_url, 'https') > -1){\n\t\t\t$new_image_url = str_replace('https', 'http', $image_url);\n\t\t}elseif(strpos($image_url, 'http') > -1){\n\t\t\t$new_image_url = str_replace('http', 'https', $image_url);\n\t\t}\n\n\t\t$attachment = $wpdb->get_col($wpdb->prepare(\"SELECT ID FROM \" . $prefix . \"posts\" . \" WHERE guid='%s';\", $new_image_url)); \n\n\t\tif(!empty($attachment) && $attachment[0]){\n \t\treturn $attachment[0]; \n\t\t}\t\n\n\t}\n\treturn '';\n}", "public static function getVimeoId($url){\n return self::parseForLastParam($url);\n }", "public function getIdentifier()\n {\n if ($this->identifierType === self::URL_REWRITE)\n {\n return $this->request->path();\n }\n return $this->request->get();\n }", "public function url_to_postid($url)\n {\n return url_to_postid($url);\n }", "static function get_attachment_id_from_src ($url) {\n\t\t$parse_url = explode( parse_url( WP_CONTENT_URL, PHP_URL_PATH ), $url );\n\n\t\t// Get the host of the current site and the host of the $url, ignoring www.\n\t\t$this_host = str_ireplace( 'www.', '', parse_url( home_url(), PHP_URL_HOST ) );\n\t\t$file_host = str_ireplace( 'www.', '', parse_url( $url, PHP_URL_HOST ) );\n\n\t\t// Return nothing if there aren't any $url parts or if the current host and $url host do not match.\n\t\tif ( ! isset( $parse_url[1] ) || empty( $parse_url[1] ) || ( $this_host != $file_host ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Now we're going to quickly search the DB for any attachment GUID with a partial path match.\n\t\t// Example: /uploads/2013/05/test-image.jpg\n\t\tglobal $wpdb;\n\n\t\t$attachment = $wpdb->get_col( $wpdb->prepare( \"SELECT ID FROM {$wpdb->prefix}posts WHERE guid RLIKE %s;\", $parse_url[1] ) );\n\n\t\t// Returns null if no attachment is found.\n\t\treturn $attachment[0];\n\t}", "function ticket_item_id(){\r\n\t\t$product_id = ( !empty($this->order_item['variation_id'])? $this->order_item['variation_id']: $this->order_item['product_id']);\r\n\r\n\t\t// get ticket IDS saved in order\r\n\t\t\t$ticket_ids = get_post_meta($this->order_id, '_tixids', true);\r\n\t\t\t$_code_mid = $this->order_id.'-'.$product_id;\r\n\r\n\t\t\t$ticket_item_id='';\r\n\t\t\t\r\n\t\t\tif(!is_array($ticket_ids)) return $ticket_item_id;\r\n\r\n\t\t\t//find ticket item id from saved ticket item ids in order meta\r\n\t\t\tforeach($ticket_ids as $__tid){\r\n\t\t\t\t$__tid_1 = explode(',', $__tid);\r\n\t\t\t\t\r\n\t\t\t\tif(strpos($__tid_1[0], $_code_mid)){\r\n\t\t\t\t\t$tt = explode('-', $__tid_1[0]);\t\t\t\t\t\r\n\t\t\t\t\t$ticket_item_id = $tt[0];\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\treturn $ticket_item_id;\r\n\t}", "public function getCatalogItemUri($params=[]) {\n\t\t$uri = '/'.$params['item']['url'];\n\t\treturn $uri;\n\t}", "function _get_youtube_id_from_url($url)\n {\n $pattern = \n '%^# Match any youtube URL\n (?:https?://)? # Optional scheme. Either http or https\n (?:www\\.)? # Optional www subdomain\n (?: # Group host alternatives\n youtu\\.be/ # Either youtu.be,\n | youtube\\.com # or youtube.com\n (?: # Group path alternatives\n /embed/ # Either /embed/\n | /v/ # or /v/\n | /watch\\?v= # or /watch\\?v=\n ) # End path alternatives.\n ) # End host alternatives.\n ([\\w-]{10,12}) # Allow 10-12 for 11 char youtube id.\n $%x'\n ;\n $result = preg_match($pattern, $url, $matches);\n if (false !== $result) {\n return $matches[1];\n }\n return false;\n }", "function bandcamp_album_id($url) {\n\n $content = file_get_contents($url, false, null, -1);\n\n if (preg_match('/<!-- album id ([0-9]*) -->/UimsS', $content, $match)) {\n\n if (isset($match[1])) {\n return $match[1];\n } else {\n return false;\n }\n\n } else {\n\n return false;\n\n }\n\n }", "function get_blog_id_from_url($domain, $path = '/')\n {\n }", "public function getPageIdByItemId($item_id)\n {\n $row = $this->db->where('item_id', $item_id)\n ->select('page_id')\n ->get($this->getTable())\n ->row();\n\n if ($row == null) {\n return null;\n }\n\n return $row->page_id;\n }", "public function getIdentifier()\n {\n return $this->getUri()->toString();\n }", "function GetFidFromUrl($url)\n{\n\t$url = mysql_real_escape_string($url);\n\t$result = mysql_query(\"SELECT id FROM files WHERE url='$url'\") or die();\n\treturn mysql_result($result, 0);\n}", "public static function getYouTubeIdFromURL($url) {\n// parse_str($url_string, $args);\n// return isset($args['v']) ? $args['v'] : false;\n\n $videoid = preg_replace(\"#[&\\?].+$#\", \"\", preg_replace(\"#http://(?:www\\.)?youtu\\.?be(?:\\.com)?/(embed/|watch\\?v=|\\?v=|v/|e/|.+/|watch.*v=|)#i\", \"\", $url));\n return $videoid;\n }", "function getItemId($item_id,$lang)\r\n\t\t{\r\n\t\t\treturn $this->getItemIvar_dump($item_id,'',$lang);\r\n\t\t}", "private function parseIdFromTweetUrl($tweetUrl)\n {\n $path = parse_url($tweetUrl)['path']; \n return explode('/', $path)[3];\n }", "function fs_get_youtube_id( $url ){\r\n\tpreg_match( \"#(?<=v=)[a-zA-Z0-9-]+(?=&)|(?<=v\\/)[^&\\n]+|(?<=v=)[^&\\n]+|(?<=youtu.be/)[^&\\n]+#\", $url, $matches );\r\n\treturn $matches[0];\r\n}", "public function get_url_to_postid( $url ) {\n\t\tif ( function_exists( 'url_to_postid' ) ) {\n\t\t\treturn url_to_postid( $url );\n\t\t}\n\t\tglobal $wp_rewrite;\n\n\t\t$url = apply_filters( 'tm_url_to_postid', $url );\n\n\t\t// First, check to see if there is a 'p=N' or 'page_id=N' to match against\n\t\tif ( preg_match( '#[?&](p|page_id|attachment_id)=(\\d+)#', $url, $values ) ) {\n\t\t\t$id = absint( $values[2] );\n\t\t\tif ( $id )\n\t\t\t\treturn $id;\n\t\t}\n\n\t\t// Check to see if we are using rewrite rules\n\t\t$rewrite = $wp_rewrite->wp_rewrite_rules();\n\n\t\t// Not using rewrite rules, and 'p=N' and 'page_id=N' methods failed, so we're out of options\n\t\tif ( empty( $rewrite ) )\n\t\t\treturn 0;\n\n\t\t// Get rid of the #anchor\n\t\t$url_split = explode( '#', $url );\n\t\t$url = $url_split[0];\n\n\t\t// Get rid of URL ?query=string\n\t\t$url_split = explode( '?', $url );\n\t\t$url = $url_split[0];\n\n\t\t// Add 'www.' if it is absent and should be there\n\t\tif ( FALSE !== strpos( home_url(), '://www.' ) && FALSE === strpos( $url, '://www.' ) )\n\t\t\t$url = str_replace( '://', '://www.', $url );\n\n\t\t// Strip 'www.' if it is present and shouldn't be\n\t\tif ( FALSE === strpos( home_url(), '://www.' ) )\n\t\t\t$url = str_replace( '://www.', '://', $url );\n\n\t\t// Strip 'index.php/' if we're not using path info permalinks\n\t\tif ( !$wp_rewrite->using_index_permalinks() )\n\t\t\t$url = str_replace( 'index.php/', '', $url );\n\n\t\tif ( FALSE !== strpos( $url, home_url() ) ) {\n\t\t\t// Chop off http://domain.com\n\t\t\t$url = str_replace( home_url(), '', $url );\n\t\t} else {\n\t\t\t// Chop off /path/to/blog\n\t\t\t$home_path = parse_url( home_url() );\n\t\t\t$home_path = isset( $home_path['path'] ) ? $home_path['path'] : '';\n\t\t\t$url = str_replace( $home_path, '', $url );\n\t\t}\n\n\t\t// Trim leading and lagging slashes\n\t\t$url = trim( $url, '/' );\n\n\t\t$request = $url;\n\t\t// Look for matches.\n\t\t$request_match = $request;\n\t\tforeach ( (array) $rewrite as $match => $query ) {\n\t\t\t// If the requesting file is the anchor of the match, prepend it\n\t\t\t// to the path info.\n\t\t\tif ( !empty( $url ) && ($url != $request) && (strpos( $match, $url ) === 0) )\n\t\t\t\t$request_match = $url . '/' . $request;\n\n\t\t\tif ( preg_match( \"!^$match!\", $request_match, $matches ) ) {\n\t\t\t\t// Got a match.\n\t\t\t\t// Trim the query of everything up to the '?'.\n\t\t\t\t$query = preg_replace( \"!^.+\\?!\", '', $query );\n\n\t\t\t\t// Substitute the substring matches into the query.\n\t\t\t\t$query = addslashes( WP_MatchesMapRegex::apply( $query, $matches ) );\n\n\t\t\t\t// Filter out non-public query vars\n\t\t\t\tglobal $wp;\n\t\t\t\tparse_str( $query, $query_vars );\n\t\t\t\t$query = array();\n\t\t\t\tforeach ( (array) $query_vars as $key => $value ) {\n\t\t\t\t\tif ( in_array( $key, $wp->public_query_vars ) )\n\t\t\t\t\t\t$query[ $key ] = $value;\n\t\t\t\t}\n\n\t\t\t\t// Taken from class-wp.php\n\t\t\t\tforeach ( $GLOBALS['wp_post_types'] as $post_type => $t )\n\t\t\t\t\tif ( $t->query_var )\n\t\t\t\t\t\t$post_type_query_vars[ $t->query_var ] = $post_type;\n\n\t\t\t\tforeach ( $wp->public_query_vars as $wpvar ) {\n\t\t\t\t\tif ( isset( $wp->extra_query_vars[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $wp->extra_query_vars[ $wpvar ];\n\t\t\t\t\telseif ( isset( $_POST[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $_POST[ $wpvar ];\n\t\t\t\t\telseif ( isset( $_GET[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $_GET[ $wpvar ];\n\t\t\t\t\telseif ( isset( $query_vars[ $wpvar ] ) )\n\t\t\t\t\t\t$query[ $wpvar ] = $query_vars[ $wpvar ];\n\n\t\t\t\t\tif ( !empty( $query[ $wpvar ] ) ) {\n\t\t\t\t\t\tif ( !is_array( $query[ $wpvar ] ) ) {\n\t\t\t\t\t\t\t$query[ $wpvar ] = (string) $query[ $wpvar ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tforeach ( $query[ $wpvar ] as $vkey => $v ) {\n\t\t\t\t\t\t\t\tif ( !is_object( $v ) ) {\n\t\t\t\t\t\t\t\t\t$query[ $wpvar ][ $vkey ] = (string) $v;\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 ( isset( $post_type_query_vars[ $wpvar ] ) ) {\n\t\t\t\t\t\t\t$query['post_type'] = $post_type_query_vars[ $wpvar ];\n\t\t\t\t\t\t\t$query['name'] = $query[ $wpvar ];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Do the query\n\t\t\t\t$query = new WP_Query( $query );\n\t\t\t\tif ( !empty( $query->posts ) && $query->is_singular )\n\t\t\t\t\treturn $query->post->ID;\n\t\t\t\telse\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn 0;\n\t}", "function url_to_attachment_id( string $image_url ) : string {\n\tglobal $wpdb;\n\t$original_image_url = $image_url;\n\t$image_url = preg_replace( '/^(.+?)(?:-e\\d+)?(?:-\\d+x\\d+)?\\.(jpg|jpeg|png|gif)(?:(?:\\?|#).+)?$/i', '$1.$2', $image_url );\n\t$cached_id = wp_cache_get( md5( $image_url ), 'url_to_id' );\n\tif ( ! $cached_id ) {\n\t\treturn $cached_id;\n\t}\n\t$cached_id = wp_cache_get( md5( $original_image_url ), 'url_to_id', false, $found );\n\tif ( $found ) {\n\t\treturn $cached_id;\n\t}\n\t$attachment_id = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->prefix . 'posts WHERE guid=%s;', $image_url ) );\n\tif ( ! empty( $attachment_id ) ) {\n\t\twp_cache_set( md5( $image_url ), $attachment_id[0], 'url_to_id' );\n\t\treturn $attachment_id[0];\n\t}\n\tif ( $image_url !== $original_image_url ) {\n\t\t$attachment_id = $wpdb->get_col( $wpdb->prepare( 'SELECT ID FROM ' . $wpdb->prefix . 'posts WHERE guid=%s;', $original_image_url ) );\n\t\tif ( ! empty( $attachment_id ) ) {\n\t\t\twp_cache_set( md5( $original_image_url ), $attachment_id[0], 'url_to_id' );\n\t\t\treturn $attachment_id[0];\n\t\t}\n\t}\n\twp_cache_set( md5( $original_image_url ), false, 'url_to_id' );\n\treturn '';\n}", "public function getItemId(): ?string\n\t{\n\t\treturn $this->itemId;\n\t}", "protected function _getItemId(Varien_Object $item)\n {\n return $item->getCode();\n }", "function getPermalinkID($db, $safeButUnescapedPath) {\n $path = $db->doEscapeParam($safeButUnescapedPath);\n $query = \"SELECT * FROM permalinks WHERE path ='$path'\";\n $rows = $db->doQuery($query);\n return (count($rows) === 1) ? $rows[0]['id'] : 0;\n }", "function origincode_gallery_video_get_video_gallery_id()\n{\n if (isset($_GET['page']) && $_GET['page'] == 'video_galleries_origincode_video_gallery') {\n if (isset($_GET[\"id\"])) {\n $id = absint($_GET[\"id\"]);\n } else {\n $id = 0;\n }\n }\n return $id;\n}", "public static function getRealItemID($item_id)\n\t{\n\t\t$arr = Data::getItemArray($item_id);\n\t\tif ($arr) {\n\t\t\treturn $arr['item_id'];\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}" ]
[ "0.6916571", "0.68542975", "0.68120944", "0.66871554", "0.6649469", "0.6591656", "0.654832", "0.6510976", "0.64997524", "0.6490539", "0.6462986", "0.6458779", "0.6442195", "0.6413571", "0.6375115", "0.6361082", "0.63535327", "0.6341373", "0.63255036", "0.62724036", "0.62666523", "0.62545884", "0.62545884", "0.6251826", "0.6244503", "0.6239723", "0.62117636", "0.62117267", "0.615996", "0.61126393", "0.6086408", "0.6085344", "0.6068363", "0.60451585", "0.60409963", "0.60279894", "0.6024434", "0.60180825", "0.6002132", "0.60003024", "0.59838957", "0.59689695", "0.5928454", "0.5927028", "0.58653027", "0.586345", "0.5860938", "0.5860938", "0.5860938", "0.5860938", "0.5860938", "0.5854511", "0.58465487", "0.58305246", "0.58269453", "0.5810242", "0.5799875", "0.57945585", "0.57874876", "0.5786675", "0.5783958", "0.5760515", "0.57511336", "0.57456744", "0.5736845", "0.5728671", "0.57025474", "0.56995326", "0.56764036", "0.56764036", "0.56764036", "0.5672063", "0.56658244", "0.5664504", "0.5662604", "0.56574386", "0.56566757", "0.5652873", "0.56511873", "0.5645897", "0.5637611", "0.5632698", "0.56231403", "0.56197023", "0.5616542", "0.56122416", "0.55949324", "0.5590615", "0.55835736", "0.55827457", "0.5582098", "0.55633026", "0.555308", "0.5552208", "0.5551375", "0.55417603", "0.5529053", "0.5527212", "0.5524335", "0.5515222" ]
0.65060896
8
Map text type field.
public function mapTextTypeField(&$entity, $field, $item_data) { $field_name = $field['id']; $mapping_index = explode('.',$field['path']); // Loop for value. $field_value = $item_data['data']; for ($i = 0; $i < count($mapping_index); $i++) { if(isset($field_value[$mapping_index[$i]])) { $field_value = $field_value[$mapping_index[$i]]; } } if(is_string($field_value) && $entity->hasField($field_name)) { $entity->$field_name->appendItem($field_value); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static function convert_text_field() {\n\n\t\t// Create a new Text field.\n\t\tself::$field = new GF_Field_Text();\n\n\t\t// Add standard properties.\n\t\tself::add_standard_properties();\n\n\t}", "public function getTYPE_TEXT()\n {\n return self::TYPE_TEXT;\n }", "public function getType()\n {\n return 'text field';\n }", "public function typeText() {\n $params = $this->types();\n return isset($params[$this->type]) ? $params[$this->type] : '';\n }", "function map_field($field){\n $str= $field->to_str();\n //\n //return field to str\n return $str;\n }", "function get_fields_text()\n\t{\n\t\t$fields_text\t=\tarray(); \n\t\t$fields\t\t=\t$this->_get_fields();\n\t\tforeach ( $fields as $field )\n\t\t{\n\t\t\tif ( $field->type == 'varchar' ||\n\t\t\t $field->type == 'text'\n\t\t\t )\n\t\t\t{\n\t\t\t\t$fields_text[]->name\t= $field->name;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $fields_text;\n\t}", "public function text($field) {\n\t\t\t$this->all($field);\n\t\t}", "protected function typeText(Fluent $column)\n {\n return 'text';\n }", "protected function type_text(Magic $column)\n {\n return 'TEXT';\n }", "protected function type_text(Magic $column)\n {\n return 'TEXT';\n }", "function hook_acquia_contenthub_field_type_mapping_alter(array &$mapping) {\n $mapping['my_custom_field'] = 'array<string>';\n}", "function get_field_mapping_types() {\n return drupal_map_assoc([\n 'string',\n 'keyword',\n 'date',\n 'long',\n 'double',\n 'boolean',\n 'ip',\n 'object',\n 'nested',\n 'geo_point',\n 'geo_shape',\n 'completion',\n ]);\n}", "function isTextType($type)\n{\n return($type == \"string\" or $type == \"varchar\" or $type == \"tinytext\" or $type == \"password\" or\n $type == \"set\" or $type == \"enum\" or $type == \"char\" or $type == \"file\" or isTextAreaType($type));\n}", "protected function typeText(Magic $column)\n {\n return 'TEXT';\n }", "function getSingleField_typeText($fieldConf, $tcaFieldConf) {\n\n\t\t\t// Add the various parameters according to TCA configuration:\n\t\t$params = array(\n\t\t\t'name' => isset ($fieldConf['overridename']) ? $fieldConf['overridename'] : $this->prefixId.'[data]['.$fieldConf['table'].']['.$fieldConf['name'].']',\n\t\t\t'id' => isset ($fieldConf['overrideid']) ? $fieldConf['overrideid'] : $this->prefixId.'[data]['.$fieldConf['table'].']['.$fieldConf['name'].']',\n\t\t\t'rows' => ($tcaFieldConf['rows'] ? $tcaFieldConf['rows'] : 5),\n\t\t\t'cols' => ($tcaFieldConf['cols'] ? $tcaFieldConf['cols'] : 30),\n\t\t\t'maxlength' => ($fieldTCAConf['max'] ? $tcaFieldConf['max'] : 255),\n\t\t\t'tabindex' => ($this->fieldTabIndex += 10),\n\t\t\t'class' => 'tx-frontendformslib-field tx-frontendformslib-field-' . (intval($fieldConf['config']['tx_frontendformslib_swaphorizontally']) ? 'switched': 'normal'),\n\t\t);\n\n\t\t$output = '<textarea '.$this->implode_assoc_r('=\"', '\" ', $params).'\" />'.htmlspecialchars($this->sessionData['data'][$fieldConf['table']][$fieldConf['name']]).'</textarea>';\n\n\t\treturn $output;\n\t}", "public function text ( \\r8\\Form\\Text $field )\n {\n $this->addField( \"text\", $field );\n }", "public function getValueElementType()\n {\n return 'text';\n }", "function get_field_type($field)\n\t{\n\t\tif( $field == \"usr_email\" )\n\t\t\treturn \"email\";\n\t\telse if( $field == \"usr_cod_postal\" )\n\t\t\treturn \"number\";\n\t\telse\n\t\t\treturn \"text\";\n\t}", "public function isTextType()\n {\n return PropelTypes::isTextType($this->getType());\n }", "function ifx_textasvarchar($mode)\n{\n}", "function testText()\n {\n $l_st=new StaticText();\n $l_st->setText(new DynamicStaticValue(static::TEXT));\n $l_store=new MapData(null);\n $l_text=$l_st->getAttValue(\"text\", $l_store,\"string\",true);\n $this->assertEquals(static::TEXT,$l_text);\n }", "public static function normalize( $field ) {\n\t\t$field = parent::normalize( $field );\n\t\t$field['multiple'] = false;\n\t\t$field['attributes']['id'] = false;\n\t\t$field['attributes']['type'] = 'text';\n\t\treturn $field;\n\t}", "protected function getProfilefields_Type_TextService()\n {\n return $this->services['profilefields.type.text'] = new \\phpbb\\profilefields\\type\\type_text(${($_ = isset($this->services['request']) ? $this->services['request'] : ($this->services['request'] = new \\phpbb\\request\\request(NULL, true))) && false ?: '_'}, ${($_ = isset($this->services['template']) ? $this->services['template'] : $this->getTemplateService()) && false ?: '_'}, ${($_ = isset($this->services['user']) ? $this->services['user'] : $this->getUserService()) && false ?: '_'});\n }", "public static function registerText(Text $text): void {\n $level = $text->getPosition()->getLevel();\n switch (true) {\n case $text instanceof CRFT:\n self::$crfts[$level->getFolderName()][$text->getName()] = $text;\n break;\n\n case $text instanceof FT:\n self::$fts[$level->getFolderName()][$text->getName()] = $text;\n FtsData::get()->saveTextByLevel($level, $text);\n break;\n }\n }", "public function text_or_binary()\n {\n }", "public function saveTextToEntity($entity_type_id, $entity_id, $field_name, $speech);", "public function getFormType() : string\n {\n return 'text';\n }", "public function isTextType()\n {\n return $this->getModel()->isPlain();\n }", "public function isText() {}", "public function getDataWithTypeField() {}", "public function getTextSourceField() {}", "function register_field_type_info($info)\n {\n }", "public function setType(){\n switch($this->security){\n case 'H':\n case 'L':\n case '0.0':\n $typeId = 2; // k-space\n break;\n case 'A':\n $typeId = 3; // a-space\n break;\n default:\n $typeId = 1; // w-space\n }\n\n /**\n * @var $type MapTypeModel\n */\n $type = $this->rel('typeId');\n $type->getById($typeId);\n $this->typeId = $type;\n }", "abstract protected function get_typestring();", "private function getFieldType($val) {\n\t\t$type = \"TEXT\";\n\t\tif (is_numeric($val)) {\n\t\t\tif (floatval($val) == intval($val)) $type = \"INT\";\n\t\t\telse $type = \"NUMERIC\";\n\t\t}\n\t\treturn $type;\n\t}", "function _db_process_field($field) {\n\n if (!isset($field['size'])) {\n $field['size'] = 'normal';\n }\n\n // Set the correct database-engine specific datatype.\n if (!isset($field['mysql_type'])) {\n $map = db_type_map();\n $field['mysql_type'] = $map[$field['type'] .':'. $field['size']];\n }\n\n if ($field['type'] == 'serial') {\n $field['auto_increment'] = TRUE;\n }\n\n return $field;\n}", "abstract public function convertField($field);", "public function dbFieldType()\n {\n return 'string';\n }", "private function changeCarrierConfigurationValueColumnTypeToText(): void\n {\n $carrierConfigurationTable = Table::withPrefix(Table::TABLE_CARRIER_CONFIGURATION);\n $query = \"ALTER TABLE $carrierConfigurationTable MODIFY value TEXT;\";\n\n $this->db->execute($query);\n }", "public function elasticMapping($mapping)\n\t{\n\t\t$mapping[$this->name] = [\n\t\t\t'type' => 'text',\n\t\t\t'fields' => [\n\t\t\t\t'raw' => ['type' => 'keyword'],\n\t\t\t],\n\t\t];\n\t}", "function testTextbasedSaving() {\n\t\t$existingEntry = $this->objFromFixture('TagFieldTest_BlogEntry', 'blogentry1');\n\t\t$field = new TagField('TextbasedTags', null, null, 'TagFieldTest_BlogEntry');\n\t\t$field->setValue('tag1 tag3 '); // test separator handling as well\n\t\t$field->saveInto($existingEntry);\n\t\t$existingEntry->write();\n\t\t$this->assertEquals(\n\t\t\t$existingEntry->TextbasedTags,\n\t\t\t'tag1 tag3'\n\t\t);\n\t}", "public function getTypes()\n {\n $val = parent::getTypes();\n if (!$val || !is_object($val)) {\n return $val;\n }\n $xml = $val->getValue();\n $xml .= <<<XML\n\n\t <fieldType name=\"autosuggest_text\" class=\"solr.TextField\"\n\t positionIncrementGap=\"100\">\n\t <analyzer type=\"index\">\n\t <tokenizer class=\"solr.StandardTokenizerFactory\"/>\n\t <filter class=\"solr.LowerCaseFilterFactory\"/>\n\t <filter class=\"solr.ShingleFilterFactory\" minShingleSize=\"2\" maxShingleSize=\"4\" outputUnigrams=\"true\" outputUnigramsIfNoShingles=\"true\" />\n\t <filter class=\"solr.PatternReplaceFilterFactory\" pattern=\"^([0-9. ])*$\" replacement=\"\"\n\t replace=\"all\"/>\n\t <filter class=\"solr.RemoveDuplicatesTokenFilterFactory\"/>\n\t </analyzer>\n\t <analyzer type=\"query\">\n\t <tokenizer class=\"solr.StandardTokenizerFactory\"/>\n\t <filter class=\"solr.LowerCaseFilterFactory\"/>\n\t </analyzer>\n\t </fieldType>\n\nXML;\n $val->setValue($xml);\n return $val;\n }", "function get_field_types()\n {\n }", "function addText($key, $text);", "abstract public function createText(string $text): Text;", "function getColumnText($field, $fieldNumber) {\r\n\t\tdie(\"getColumnText() should be implemented in derived class.\");\r\n\t}", "public function getTypeMapper();", "public function testGetDataTableTextDataType() {\r\n\t\t// Insert values into database\r\n\t\t$value = str_pad('', 4000, ' °!\"§$%&/()=?`*\\'>; :_+öä#<,.-²³¼¹½¬{[]}\\\\¸~’–…·|@\\t\\r\\n'); // Must be 80 chars to pad correctly to 4000 characters\r\n\t\t$escapedvalue = $this->escape($value);\r\n\t\t$this->executeQuery('insert into POTEST (UUID, TEXT_VALUE) values (\\'testuuid0\\',\\''.$escapedvalue.'\\')');\r\n\t\t// Extract datatable\r\n\t\t$datatable = $this->getPersistenceAdapter()->getDataTable('select TEXT_VALUE from POTEST order by UUID');\r\n\t\t$datamatrix = $datatable->getDataMatrix();\r\n\t\t// Check strings for correct conversion\r\n\t\t$resultstring = $datamatrix[0][0]; \r\n\t\t$this->assertEquals(4000, strlen($resultstring), 'Result string has not the correct length.');\r\n\t\t$this->assertEquals($value, $resultstring, 'Result string is not the same as the given one.');\r\n\t\t$this->assertEquals('UTF-8', mb_detect_encoding($resultstring), 'The string encoding is not UTF8.');\r\n\t}", "function registerFieldType($name, $type);", "abstract protected function mapRule($field, $rule, $params, $message, $fieldType);", "private static function stringField($type, $size)\n {\n $obj = new StringField();\n $obj->type = $type;\n $obj->size = $size;\n $obj->encoding = 'utf8_general_ci';\n\n return $obj;\n }", "protected function handle_field_args( $data = array() ) {\n\t\t\t$data = parent::handle_field_args( $data );\n\t\t\t$data['text_type'] = 'text';\n\t\t\treturn $data;\n\t\t}", "public function testStringFields()\n {\n $field = $this->table->getField('stringone');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Character',\n $field);\n $this->assertTrue($field->isNullOk());\n $this->assertEquals(50, $field->getMaxCharacters());\n $this->assertNull($field->getDefaultValue());\n\n $field = $this->table->getField('stringtwo');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Character',\n $field);\n $this->assertFalse($field->isNullOk());\n $this->assertEquals(\"'ABCDE'::bpchar\", $field->getDefaultValue());\n $this->assertEquals(5, $field->getMaxCharacters());\n\n $field = $this->table->getField('stringthree');\n $this->assertInstanceOf('Metrol\\DBTable\\Field\\PostgreSQL\\Character',\n $field);\n $this->assertTrue($field->isNullOk());\n $this->assertEquals(\"'blah blah'::text\", $field->getDefaultValue());\n $this->assertNull($field->getMaxCharacters());\n }", "public function mapParagraphsType(&$entity, $field, $item_data) {\n $field_name = $field['id'];\n foreach ($field['paragraph_list'] as $para_type => $para_fields) {\n $paragraph = $this->entityTypeManager\n ->getStorage('paragraph')\n ->create(['type' => $para_type]);\n foreach ($para_fields['fields'] as $key => $para_field) {\n $this->resolveFieldTypeMapping($paragraph, $para_field, $item_data);\n }\n if(!empty($paragraph) && $entity->hasField($field_name)) {\n $entity->$field_name->appendItem($paragraph);\n }\n }\n }", "public function getContentColumnType(): string {\n return Schema::TYPE_TEXT;\n }", "protected function processField($field) {\n if (!isset($field['size'])) {\n $field['size'] = 'normal';\n }\n // Set the correct database-engine specific datatype.\n if (!isset($field['sqlsrv_type'])) {\n $map = $this->getFieldTypeMap();\n $field['sqlsrv_type'] = $map[$field['type'] . ':' . $field['size']];\n }\n if ($field['type'] == 'serial') {\n $field['identity'] = TRUE;\n }\n return $field;\n }", "function Type()\n {\n return 'autocomplete text';\n }", "public function testSaveDataTableTextDataType() {\r\n\t\t$value = str_pad('', 4000, ' °!\"§$%&/()=?`*\\'>; :_+öä#<,.-²³¼¹½¬{[]}\\\\¸~’–…·|@\\t\\r\\n'); // Must be 80 chars to pad correctly to 4000 characters\r\n\t\t// Store datatable\r\n\t\t$datatable = new avorium_core_data_DataTable(1, 2);\r\n\t\t$datatable->setHeader(0, 'UUID');\r\n\t\t$datatable->setHeader(1, 'TEXT_VALUE');\r\n\t\t$datatable->setCellValue(0, 0, 'testuuid0');\r\n\t\t$datatable->setCellValue(0, 1, $value);\r\n\t\t$this->getPersistenceAdapter()->saveDataTable('POTEST', $datatable);\r\n\t\t// Read database via SQL\r\n\t\t$results = $this->executeQuery('select TEXT_VALUE from POTEST order by UUID');\r\n\t\t// Compare values\r\n\t\t$resultstring = $results[0][0];\r\n\t\t$this->assertEquals(4000, strlen($resultstring), 'Result string has not the correct length.');\r\n\t\t$this->assertEquals($value, $resultstring, 'Result string is not the same as the given one.');\r\n\t\t$this->assertEquals('UTF-8', mb_detect_encoding($resultstring), 'The string encoding is not UTF8.');\r\n\t}", "public function testFieldWithSpecialConfig()\n {\n self::assertEquals('keyword', $this->mapper->getDataType('tstamp'), 'Wrong data type found');\n\n // Und jetzt per Config überschreiben\n $cfg = [];\n $cfg['fields.']['tstamp.']['type'] = 'unindexed';\n $mapper = tx_rnbase::makeInstance('tx_mksearch_service_engine_lucene_DataTypeMapper', $cfg);\n self::assertEquals('unindexed', $mapper->getDataType('tstamp'), 'Wrong data type found');\n // Die anderen sollten weiter normal funktionieren\n self::assertEquals('keyword', $mapper->getDataType('uid'), 'Wrong data type found');\n }", "public function addText($str_name)\n {\n return $this->addField($str_name, self::FIELD_TEXT);\n }", "public function getFieldType($fieldname);", "public function setType($type) {\n\t\tif($type == self::TYPE_TEXT){\n\t\t\t$this->type = self::TYPE_TEXT;\n\t\t} else {\n\t\t\t$this->type = self::TYPE_HTML;\n\t\t}\n\t}", "function testTextFieldExpectsStringReturned() {\n\n\t\t// arrange\n\t\t$TestValidTextField = new TestValidTextField();\n\t\t$TestValidTextField->fields['field']['type'] = 'text';\n\t\t$_POST = array(\n\t\t\t'post_ID' => 1,\n\t\t\t'field' => 'Text field expects a string',\n\t\t);\n\t\t$validated = array();\n\n\t\t// act\n\t\t$TestValidTextField->validate($_POST['post_ID'], $TestValidTextField->fields['field'], $validated['field'], array());\n\n\t\t// assert\n\t\t$this->assertEquals(\n\t\t\t'Text field expects a string',\n\t\t\t$validated['field']\n\t\t);\n\t}", "public function getFieldMapping($field_name);", "function dmlChangeColumnType () {\r\n\t\t// Create connection\r\n\t\t$conn = new mysqli($GLOBALS['servername'], $GLOBALS['username'], $GLOBALS['password'], $GLOBALS['dbname']);\r\n\t\t// Check connection\r\n\t\tif ($conn->connect_error) {\r\n\t\t\tdie(\"Connection failed: \" . $conn->connect_error);\r\n\t\t} \r\n\r\n\t\t$sql = \"ALTER TABLE tbldmlmapcontent MODIFY CntField7 MEDIUMTEXT\";\r\n\r\n\t\tif ($conn->query($sql) === TRUE) {\r\n\t\t\techo 1;\r\n\t\t} else {\r\n\t\t\techo 0;\r\n\t\t}\r\n\t\t\r\n\t\t$conn->close();\r\n\t}", "function guessTextField($entity, $prefer_long_text=true)\n{\n $the_field = \"\";\n //try long texts\n for ($i=0; $i<count($entity[\"fields\"]); $i++) {\n $dt = $entity[\"fields\"][$i][\"data_type\"];\n if (($prefer_long_text and isTextAreaType($dt)) or(!$prefer_long_text and isTextType($dt))) {\n $the_field = $entity[\"fields\"][$i][\"name\"];\n break;\n }\n }\n //now others\n if ($the_field == \"\") {\n for ($i=0; $i<count($entity[\"fields\"]); $i++) {\n $dt = $entity[\"fields\"][$i][\"data_type\"];\n if (($prefer_long_text and isTextType($dt)) or(!$prefer_long_text and isTextAreaType($dt))) {\n $the_field = $entity[\"fields\"][$i][\"name\"];\n break;\n }\n }\n }\n return $the_field;\n}", "function getFieldType() {\n\t\treturn 'field';\n\t}", "protected function handleFieldTypes($field, $fieldData)\n {\n switch ($field->type) {\n // Untranslatable fields. These do not include the\n // actual label in the page data.\n case 'suggest':\n case 'radio':\n case 'checkboxes':\n return;\n\n case 'array':\n case 'collection':\n case 'list':\n case 'tags':\n case 'checkbox':\n $this->fields = (new ArrayField($this->fields))->map($fieldData);\n break;\n\n case 'table':\n case 'replicator':\n $this->fields = (new ReplicatorField($this->fields))->map($fieldData);\n break;\n\n // \"Default\" fields include:\n // - Bard\n // - Regular string values\n default:\n $this->fields = (new StringField($this->fields))->map($fieldData);\n break;\n }\n }", "function getTypeConverter() ;", "public function add_text($text)\n {\n }", "function getTypeOfField($fieldName);", "function recognize_data_type($string)\n{\n\t$string = mb_strtolower(trim($string), 'UTF-8');\n\n\t// if the data type is empty string or any of bool representations set it as bool\n\tif(empty($string) || is_bool(filter_var($string, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE)))\n\t\treturn \"BIT\";\n\tif(is_int(filter_var($string, FILTER_VALIDATE_INT))) // else if int set as int\n\t\treturn \"INT\";\n\tif(is_float(filter_var($string, FILTER_VALIDATE_FLOAT))) // or float\n\t\treturn \"FLOAT\";\n\n\treturn \"NTEXT\"; // if neither of them set it to NTEXT (doesn't mather if it is attribute or not, it will be decided later)\n}", "public function getFieldTypes() {\n\t\treturn array(crud::TYPE_STRING);\n\t}", "function nodeCoreTextField(&$node, $field, $value){\n \t\tif (!empty($node->nid)){\n \t\t\t//its an existing node...\n \t\t\tif (!isset($node->{$field}) || $node->{$field} != $value){\n \t\t\t\t//...with a new incoming value\n \t\t\t\t$this->nodeNeedsUpdate[$node->nid] = true;\n \t\t\t\t//dsm(__FUNCTION__.\" flagging \".$node->nid);\n \t\t\t}\n \t\t}\n \t\t\t\n \t\t$node->{$field} = $value;\n \t}", "function PMA_isTablefieldChar($field)\n{\n // If check to ensure types such as \"enum('one','two','char',..)\" or\n // \"enum('one','two','varchar',..)\" are not categorized as char.\n if (stripos($field['Type'], 'char') === 0\n || stripos($field['Type'], 'varchar') === 0\n ) {\n return stristr($field['Type'], 'char');\n } else {\n return false;\n }\n}", "private function detectFieldType($class, $field)\n {\n $annotations = $this->annotationReader->getPropertyAnnotations(new \\ReflectionProperty($class, $field));\n $mappingColumn = array_filter($annotations, function($item) {\n return $item instanceof \\Doctrine\\ORM\\Mapping\\Column;\n });\n $mappingColumnCurrent = current($mappingColumn);\n\n return ($mappingColumnCurrent->type === 'string') ? 'text' : 'textarea';\n }", "function register_field_type($class)\n {\n }", "public function getTextEntity();", "function get_field_type($name)\n {\n }", "public function init_fields() {\n $fields = [];\n\n $fields['type'] = [\n 'type' => Controls_Manager::TEXT,\n 'label' => __('Text', 'chaman_addons')\n ];\n\n return $fields;\n }", "public function setMailTextType($mailType='text') {\n\t\t$this->_mailTextType = ($mailType == 'text') ? 'text' : 'html';\n\t}", "function barnelli_wp_text_input($field) {\n\tglobal $thepostid, $post, $vision;\n\n\t$thepostid \t\t\t\t= empty( $thepostid ) ? $post->ID : $thepostid;\n\t$field['placeholder'] \t= isset( $field['placeholder'] ) ? $field['placeholder'] : '';\n\t$field['class'] \t\t= isset( $field['class'] ) ? $field['class'] : 'short';\n\t$field['wrapper_class'] = isset( $field['wrapper_class'] ) ? $field['wrapper_class'] : '';\n\t$field['value'] \t\t= isset( $field['value'] ) ? $field['value'] : get_post_meta( $thepostid, $field['id'], true );\n\t$field['name'] \t\t\t= isset( $field['name'] ) ? $field['name'] : $field['id'];\n\t$field['type'] \t\t\t= isset( $field['type'] ) ? $field['type'] : 'text';\n\n\t// Custom attribute handling\n\t$custom_attributes = array();\n\n\tif ( ! empty( $field['custom_attributes'] ) && is_array( $field['custom_attributes'] ) )\n\t\tforeach ( $field['custom_attributes'] as $attribute => $value )\n\t\t\t$custom_attributes[] = esc_attr( $attribute ) . '=\"' . esc_attr( $value ) . '\"';\n\n\techo '<p class=\"form-field ' . esc_attr( $field['id'] ) . '_field ' . esc_attr( $field['wrapper_class'] ) . '\"><label for=\"' . esc_attr( $field['id'] ) . '\">' . wp_kses_post( $field['label'] ) . '</label><input type=\"' . esc_attr( $field['type'] ) . '\" class=\"' . esc_attr( $field['class'] ) . '\" name=\"' . esc_attr( $field['name'] ) . '\" id=\"' . esc_attr( $field['id'] ) . '\" value=\"' . esc_attr( $field['value'] ) . '\" placeholder=\"' . esc_attr( $field['placeholder'] ) . '\" ' . implode( ' ', $custom_attributes ) . ' /> ';\n\n\tif ( ! empty( $field['description'] ) ) {\n\n\t\tif ( isset( $field['desc_tip'] ) ) {\n\t\t\techo '<img class=\"help_tip\" data-tip=\"' . esc_attr( $field['description'] ) . '\" src=\"' . $vision->plugin_url() . '/assets/images/help.png\" height=\"16\" width=\"16\" />';\n\t\t} else {\n\t\t\techo '<span class=\"description\">' . wp_kses_post( $field['description'] ) . '</span>';\n\t\t}\n\n\t}\n\techo '</p>';\n}", "function _field_text($fval) \n {\n $fval = (empty($fval) && !empty($this->opts))? $this->opts : $fval;\n if (is_array($fval) && !empty($this->attribs['multi']))\n $fval = ''; // we can't handle this here. Don't put \"Array\"\n\n return sprintf(\"<input type=\\\"text\\\" id=\\\"%s\\\" name=\\\"%s%s\\\" value=\\\"%s\\\" size=\\\"%d\\\" maxlength=\\\"%d\\\" class=\\\"%s\\\" %s />\\n\",\n $this->fname, \n $this->fname, \n (!empty($this->attribs['multi']))? '[]':'', \n $this->_htmlentities($fval), \n $this->_get_field_size(), \n $this->attribs['maxlength'], \n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n }", "function acf_text_input($attrs = array())\n{\n}", "public static function varchar() {}", "abstract function typeAsString();", "public function getTextFields( $translation = true );", "function _token_rules_map_type($type) {\r\n if (($data_type = rules_get_data_types($type)) && isset($data_type['token type'])) {\r\n return $data_type['token type'];\r\n }\r\n return $type;\r\n}", "function acf_get_text_input($attrs = array())\n{\n}", "private function defineInputType()\n {\n\n $input = '';\n\n switch ($this->type) {\n case 'integer':\n $input = 'number';\n break;\n case 'datetime':\n $input = 'datetime';\n break;\n case 'date':\n $input = 'date';\n break;\n case 'text':\n $input = 'textarea';\n break;\n case 'float':\n $input = 'decimal';\n break;\n case 'decimal':\n $input = 'decimal';\n break;\n case 'string':\n $input = 'text';\n break;\n case 'combo':\n $input = 'select';\n break;\n case 'hidden':\n $input = 'hidden';\n $this->notnull = false;\n break;\n case 'checkbox':\n $input = 'checkbox';\n break;\n\n }\n\n $this->input = $input;\n }", "public static function fieldTypes()\n {\n $types = [\n 'label' => _MA_XMARTICLE_FIELDTYPE_LABEL,\n 'vs_text' => _MA_XMARTICLE_FIELDTYPE_VSTEXT,\n 's_text' => _MA_XMARTICLE_FIELDTYPE_STEXT,\n 'm_text' => _MA_XMARTICLE_FIELDTYPE_MTEXT,\n 'l_text' => _MA_XMARTICLE_FIELDTYPE_LTEXT,\n 'text' => _MA_XMARTICLE_FIELDTYPE_TEXT,\n 'select' => _MA_XMARTICLE_FIELDTYPE_SELECT,\n 'select_multi' => _MA_XMARTICLE_FIELDTYPE_SELECTMULTI,\n 'radio_yn' => _MA_XMARTICLE_FIELDTYPE_RADIOYN,\n 'radio' => _MA_XMARTICLE_FIELDTYPE_RADIO,\n 'checkbox' => _MA_XMARTICLE_FIELDTYPE_CHECKBOX,\n 'number' => _MA_XMARTICLE_FIELDTYPE_NUMBER\n ];\n\n return $types;\n }", "function mDATATYPE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DATATYPE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:241:3: ( 'datatype' ) \n // Tokenizer11.g:242:3: 'datatype' \n {\n $this->matchString(\"datatype\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }", "function acf_register_field_type_info($info)\n{\n}", "function qa_post_text($field)\n{\n\tif (qa_to_override(__FUNCTION__)) { $args=func_get_args(); return qa_call_override(__FUNCTION__, $args); }\n\n\treturn isset($_POST[$field]) ? preg_replace('/\\r\\n?/', \"\\n\", trim(qa_gpc_to_string($_POST[$field]))) : null;\n}", "public function getType() {\n return $this->field['type'] ?? '';\n }", "function awmInputFieldsTypes()\n {\n return apply_filters('awmInputFieldsTypes_filter', array(\n 'text' => array('label' => __('Text', 'extend-wp')),\n 'email' => array('label' => __('Email', 'extend-wp')),\n 'checkbox' => array('label' => __('Checkbox', 'extend-wp')),\n 'url' => array('label' => __('Url', 'extend-wp')),\n 'number' => array('label' => __('Number', 'extend-wp')),\n 'file' => array('label' => __('File', 'extend-wp')),\n 'color' => array('label' => __('Color', 'extend-wp')),\n 'submit' => array('label' => __('Submit', 'extend-wp')),\n ));\n }", "public static function text() {}", "function check_text($type, $font_size, $text) {\n \n $values = array(\n \"font\" => $font_size,\n \"text\" => $text\n );\n \n $str_length_of_text = mb_strlen($text);\n $max_length = 0;\n \n switch($type) {\n case Instruction::TITLE:\n $max_length = $this->max_base_length_of_title;\n break;\n case Instruction::HEADER_TITLE:\n $max_length = $this->max_base_length_of_header_title;\n break;\n case Instruction::INFO:\n $max_length = $this->max_base_length_of_info;\n break;\n case Instruction::REVIEWER_NAME:\n $max_length = $this->max_base_length_of_name;\n break;\n default:\n throw new Exception(\"Bad type of text selected.\");\n break;\n } \n \n if($str_length_of_text <= $max_length) {\n return $values;\n }\n else {\n //calculate font and round it down\n $new_font_size = round(($font_size * $max_length) / $str_length_of_text, 0, PHP_ROUND_HALF_DOWN); \n return $this->reduce_text_if_too_long($type, $font_size, $max_length, $new_font_size, $text);\n }\n }", "public function setCustomField($field, $value, $type = 'TYPE_STRING') {\n\n $fieldObj = Doctrine::getTable('ArticleCustomField')->findOneByName($field);\n\n if(!$fieldObj) {\n // pole nie istnieje\n // to na przyszlosc, gdy dojdzie mozliwosc samodzielnego definiowania pol przez usera\n// $fieldObj = new ArticleCustomField();\n// $fieldObj->name = $field;\n// $fieldObj->type = $type;\n// $fieldObj->save();\n\n return;\n }\n\n if(!$article2customFieldValue = Doctrine::getTable('ArticleCustomFieldValue')->find(array('article_id' => $this->getPrimaryKey(),\n 'field_id' => $fieldObj->getPrimaryKey()))) {\n $article2customFieldValue = new ArticleCustomFieldValue();\n }\n\n $article2customFieldValue->article_id = $this->getPrimaryKey();\n $article2customFieldValue->field_id = $fieldObj->getPrimaryKey();\n\n if($fieldObj->type == 'TYPE_DATE') {\n //0 - rok, 1 - miesiac, 2 - dzien, 3 - godzina, 4 - minuty, 5 - sekundy\n $time = preg_split('/[\\s-:]+/', $value);\n $value = mktime($time[3], $time[4], $time[5], $time[1], $time[2], $time[0]);\n }\n\n $article2customFieldValue->value = $value;\n\n $article2customFieldValue->save();\n\n }", "function hydrate($text, $map = null) {\n if(!$map || !is_array($map)) {\n $map = array();\n }\n\n foreach($map as $from => $to) {\n $text = str_replace($from, $to, $text);\n }\n return $text;\n}" ]
[ "0.6864198", "0.6534051", "0.6453625", "0.62800676", "0.6169659", "0.59466153", "0.59465766", "0.5925325", "0.59144026", "0.59144026", "0.58567095", "0.58124936", "0.5793117", "0.5789615", "0.57548696", "0.5707303", "0.5688153", "0.5676421", "0.5653418", "0.56323534", "0.56064737", "0.5602657", "0.5568063", "0.55143297", "0.5458372", "0.5450289", "0.5443822", "0.54202646", "0.5417075", "0.53858966", "0.537156", "0.5367459", "0.5366766", "0.53665674", "0.5361221", "0.53449655", "0.53390974", "0.53343165", "0.5323854", "0.52930325", "0.5271325", "0.5270211", "0.52661985", "0.52488077", "0.524165", "0.5235763", "0.522553", "0.5218351", "0.52056265", "0.5198538", "0.51714975", "0.51665443", "0.5160868", "0.51574665", "0.5149295", "0.5137459", "0.51327837", "0.5132369", "0.5126887", "0.51056594", "0.51011795", "0.5085857", "0.5080268", "0.50695443", "0.5064052", "0.5057425", "0.50534934", "0.50450313", "0.50428873", "0.50364554", "0.5035319", "0.5012307", "0.5008183", "0.5001896", "0.5001815", "0.50013655", "0.49989033", "0.49970368", "0.499398", "0.49868876", "0.4986002", "0.4982986", "0.49707988", "0.4953899", "0.49511978", "0.49494934", "0.49449706", "0.4943834", "0.49429014", "0.4934924", "0.49346977", "0.49329427", "0.49212632", "0.4918081", "0.49097455", "0.48976743", "0.48817024", "0.48800865", "0.48799127", "0.48737767" ]
0.69684404
0
Map image type field
public function mapImageField(&$entity, $field, $item_data) { $field_name = $field['id']; $is_multiple = $field['multiple']; if(isset($item_data['data']['item']['associations'])) { $media_index = $item_data['data']['item']['associations']; foreach ($media_index as $index => $media) { if($media['type'] == 'picture') { $media_id = $media['altids']['itemid']; $media_data = $this->apNewsroomContent->getContentById($media_id); $file_data = $this->saveFile($media_data, $this->apNewsroomContent->getApNewsroomApi()->getApiKey()); if(!empty($file_data) && $entity->hasField($field_name)) { $entity->$field_name->appendItem($file_data); if(!$is_multiple) { break; } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getImageType() \n { \n return $this->_type; \n }", "private function get_type_img()\n {\n $this->multi_byte_string_to_array();\n foreach($this->strings as $char)\n {\n $this->init_img();\n $this->create_img($char);\n }\n }", "public function ImageType($file_type){\r\n $this->file_type=$file_type;\r\n }", "function getImageType()\r\n {\r\n return $this->type;\r\n }", "public function getImageType(): int\n {\n return $this->imageType;\n }", "public function testImageValue() : void {\n\t\t$this->assertEquals('kc_image', PostType::Image->value);\n\t}", "public function getOutputImageType();", "public function getImagesTypes() {\n\t\treturn array( \n 'uncategorized' => 'Uncategorized',\n 'background' => \"Background & Pattern\",\n 'frame' => \"Mask\",\n 'image' => \"Image\",\n 'clipart' => \"Clipart\",\n 'shape' => \"Shape\" \n );\n\t}", "function getImageType()\n {\n return is_null($this->_sImageType) ? NULL : (string) $this->_sImageType;\n }", "function gd_edit_image_support($mime_type)\n {\n }", "function testCompatible(){\n\t\tif($this->$imageAsset[\"type\"] == \"image/jpeg\" || $_FILES[\"image_upload_box\"][\"type\"] == \"image/pjpeg\"){\t\n\t\t\t$this->imgType = 'jpg';\n\t\t}\t\t\n\t\t// if uploaded image was GIF\n\t\tif($this->$imageAsset[\"type\"] == \"image/gif\"){\t\n\t\t\t$this->imgType = 'gif';\n\t\t}\t\n\t\t// if uploaded image was PNG\n\t\tif($this->$imageAsset[\"type\"] == \"image/x-png\"){\n\t\t\t$this->imgType = 'png';\n\t\t}\n\t\telse {\n\t\t\t$this->imgType = 'invalid';\n\t\t}\n\t\t\n\t}", "function type_url_form_image()\n {\n }", "function setImageType($iType)\n\t{\n\t\tswitch ($iType) {\n\t\t\tcase 1:\n\t\t\t\t$this->type = $iType;\n\t\t\t\t$this->mimetype = 'image/gif';\n\t\t\t\t$this->setFilenameExtension();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$this->type = $iType;\n\t\t\t\t$this->mimetype = 'image/jpeg';\n\t\t\t\t$this->setFilenameExtension();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t$this->type = $iType;\n\t\t\t\t$this->mimetype = 'image/png';\n\t\t\t\t$this->setFilenameExtension();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\t\t}\n\t}", "public static function change_image_type(){\n/**\n*\n*This function change the image type like convert png to jpg or bmp or gif\n*\n*/\npublic static function rotate()\n}", "function setImageType($a_sImageType)\n {\n $this->_sImageType = is_null($a_sImageType) ? NULL : (string) $a_sImageType;\n $this->setSearchParameter('image_type', (string) $this->_sImageType, is_null($this->_sImageType) ? self::CONDITION_IS_NULL : self::CONDITION_EQUALS);\n }", "public function getType(){\n if ($this->isImage())\n return 'img';\n if ($this->isDoc())\n return 'doc';\n if ($this->isVid())\n return 'vid';\n if ($this->isAudio())\n return 'audio';\n return ''; \n }", "function dlts_image_field_schema_7001($field) {\n field_cache_clear();\n return array(\n 'columns' => array(\n 'fid' => array(\n 'description' => 'The {file_managed}.fid being referenced in this field.',\n 'type' => 'int',\n 'not null' => FALSE,\n 'unsigned' => TRUE,\n ),\n 'djakota_width' => array(\n 'description' => 'The width of the image in pixels.',\n 'type' => 'int',\n 'unsigned' => TRUE,\n ),\n 'djakota_height' => array(\n 'description' => 'The height of the image in pixels.',\n 'type' => 'int',\n 'unsigned' => TRUE,\n ),\n 'djakota_levels' => array(\n 'description' => 'Djatoka Jpeg 2000 Image Server levels values of the image.',\n 'type' => 'int',\n 'unsigned' => TRUE,\n ),\n 'djakota_dwtLevels' => array(\n 'description' => 'Djatoka Jpeg 2000 Image Server dwtLevels values of the image.',\n 'type' => 'int',\n 'unsigned' => TRUE,\n ),\n 'djakota_compositingLayerCount' => array(\n 'description' => 'Djatoka Jpeg 2000 Image Server compositing layer count of the image.',\n 'type' => 'int',\n 'unsigned' => TRUE,\n ),\n 'width' => array(\n 'description' => 'The width of the image in pixels.',\n 'type' => 'int',\n 'unsigned' => TRUE,\n ),\n 'height' => array(\n 'description' => 'The height of the image in pixels.',\n 'type' => 'int',\n 'unsigned' => TRUE,\n ),\n ),\n 'indexes' => array(\n 'fid' => array('fid'),\n ),\n 'foreign keys' => array(\n 'fid' => array(\n 'table' => 'file_managed',\n 'columns' => array('fid' => 'fid'),\n ),\n ),\n );\n}", "function getGDType(){\n\t\treturn isset(we_base_imageEdit::$GDIMAGE_TYPE[strtolower($this->Extension)]) ? we_base_imageEdit::$GDIMAGE_TYPE[strtolower($this->Extension)] : 'jpg';\n\t}", "function validate_image_field($field)\n {\n }", "public function getImageTag();", "public static function bootImageableTrait()\n {\n /* morphMap for Image model */\n Relation::morphMap([\n static::getImagableMorphKey() => static::class,\n ]);\n }", "public function it_shows_file_input_type_on_image()\n {\n // configure\n $inputs = [\n [\n 'type' => 'image',\n 'name' => 'logo',\n 'label' => 'Upload Logo'\n ]\n ];\n\n $this->configureInputs($inputs);\n\n // assert\n $this->get('/settings')\n ->assertStatus(200)\n ->assertSee('type=\"file\"', false);\n }", "public static function imageColumnType($value, $column, $record)\n {\n if ($column->config['relationName'] === null || $record->{$column->config['relationName']} === null) {\n return $column->config['default'] != null ? $column->config['default'] : '';\n }\n\n $mask = '<img src=\"%s\" alt=\"%s\" title=\"%s\" width=\"%s\">';\n $src = $record->{$column->config['relationName']}->getPath();\n $alt = $record->{$column->config['relationName']}->title ? : '';\n $width = ($column->config['width'] != null) ? $column->config['width'] : '90';\n\n return sprintf( $mask, $src, $alt, $alt, $width );\n }", "protected function getLiipImagine_Form_Type_ImageService()\n {\n return $this->services['liip_imagine.form.type.image'] = new \\Liip\\ImagineBundle\\Form\\Type\\ImageType();\n }", "function hook_file_default_types_alter(&$types) {\n $types['image']->mimetypes[] = 'image/svg+xml';\n}", "function getGDType(){\n \t\treturn isset($GLOBALS[\"GDIMAGE_TYPE\"][strtolower($this->Extension)]) ? $GLOBALS[\"GDIMAGE_TYPE\"][strtolower($this->Extension)] : \"jpg\";\n\t}", "public function type()\n {\n if (null === $this->type) {\n $this->type = new Type\\Imagick($this);\n }\n if (null === $this->type->getImage()) {\n $this->type->setImage($this);\n }\n return $this->type;\n }", "function check_image_type_array($source_pic)\n{\n switch ($source_pic) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "function get_image_file_types() {\n return array( \n 'gif',\n 'jpg',\n 'jpeg',\n 'png',\n 'wbmp',\n );\n }", "function altlab_timeline_featured_image($entry, $form){\n $timeline_type = rgar($entry, '3');//entry field ID is 3\n if ($timeline_type == 'First computer I owned' ){//response\n $img_id = 6895;//id of image in wp media library\n }\n if ($timeline_type == 'First time online'){\n $img_id = 6899;\n }\n if ($timeline_type == 'First email'){\n $img_id = 6900;\n }\n if ($timeline_type == 'First cell phone'){\n $img_id = 6898;\n }\n \n set_post_thumbnail( $entry['post_id'], $img_id );\n}", "function exif_imagetype ( $image_location ) {\r\n\t\t$image_size = getimagesize($image_location);\r\n\t\tif ( !$image_size )\r\n\t\t\treturn $image_size;\r\n\t\t$image_type = $image_size[2];\r\n\t\treturn $image_type;\r\n\t}", "function business_register_taxonomy_for_images() {\n register_taxonomy_for_object_type( 'category', 'attachment' );\n\tregister_taxonomy_for_object_type( 'content_type', 'attachment' );\n}", "function _meta(&$img,$opt){\n if($img['meta']){\n // map JPEGMeta calls to opt names\n\n switch($opt){\n case 'title':\n return $img['meta']->getField('Simple.Title');\n case 'desc':\n return $img['meta']->getField('Iptc.Caption');\n case 'cdate':\n return $img['meta']->getField('Date.EarliestTime');\n case 'width':\n return $img['meta']->getField('File.Width');\n case 'height':\n return $img['meta']->getField('File.Height');\n\n\n default:\n return '';\n }\n\n }else{\n // just return the array field\n return $img[$opt];\n }\n }", "public function image(){\n return $this->morphOne('App\\Models\\Image', 'imageable');\n }", "public function getImageClass()\n {\n return $this->image_class;\n }", "public function getImageFields()\n {\n return [\n 'training_resource_thumbnail' => '/'\n ];\n }", "function file_image($imageType, $props = array(), $file = null)\n{\n if (!$file) {\n $file = get_current_record('file');\n }\n $fileMarkup = new Omeka_View_Helper_FileMarkup;\n return $fileMarkup->image_tag($file, $props, $imageType);\n}", "public function getImagesImageType()\r\n\t{\r\n\t\treturn 'thickbox'; // change this to 'thickbox_default' if images don't show in Prestashop 1.5\r\n\t}", "function check_image_type($source_pic)\n{\n $image_info = check_mime_type($source_pic);\n\n switch ($image_info) {\n case 'image/gif':\n return true;\n break;\n\n case 'image/jpeg':\n return true;\n break;\n\n case 'image/png':\n return true;\n break;\n\n case 'image/wbmp':\n return true;\n break;\n\n default:\n return false;\n break;\n }\n}", "function get_field_mapping_types() {\n return drupal_map_assoc([\n 'string',\n 'keyword',\n 'date',\n 'long',\n 'double',\n 'boolean',\n 'ip',\n 'object',\n 'nested',\n 'geo_point',\n 'geo_shape',\n 'completion',\n ]);\n}", "public function getType() {\n if($this->get('person') instanceof Person) {\n return \\App\\Enums\\AvatarType::PERSON();\n } elseif($this->get('user') instanceof User) {\n return \\App\\Enums\\AvatarType::USER();\n }\n return null;\n }", "function record_image($record, $imageType = null, $props = array())\n{\n if (is_string($record)) {\n $record = get_current_record($record);\n }\n\n if (!($record instanceof Omeka_Record_AbstractRecord)) {\n throw new InvalidArgumentException('An Omeka record must be passed to record_image.');\n }\n $fileMarkup = new Omeka_View_Helper_FileMarkup;\n return $fileMarkup->image_tag($record, $props, $imageType);\n}", "public function imageable() {\n \treturn $this->morphTo();\n }", "public function getImageTypeAllowableValues()\r\n {\r\n return [\r\n self::IMAGE_TYPE_BACKUP,\r\n self::IMAGE_TYPE_REPLICATION,\r\n ];\r\n }", "public function change() {\n\t\t$this->table('mime_type_images')\n\t\t\t->addColumn('name', 'string', [\n\t\t\t\t'comment' => 'extension (e.g. jpg)',\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 100,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('ext', 'string', [\n\t\t\t\t'comment' => 'extension (lowercase!) of real image (exe.gif -> gif)',\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 20,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('active', 'boolean', [\n\t\t\t\t'default' => false,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('details', 'string', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 190,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('created', 'datetime', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('modified', 'datetime', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->create();\n\n\t\t$this->table('mime_types')\n\t\t\t->addColumn('name', 'string', [\n\t\t\t\t'comment' => 'Program Name',\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 100,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('ext', 'string', [\n\t\t\t\t'comment' => 'extension (lowercase!)',\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 20,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('type', 'string', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 190,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('alt_type', 'string', [\n\t\t\t\t'comment' => 'alternate (sometimes there is more than one type)',\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 190,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('details', 'string', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => 190,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('core', 'boolean', [\n\t\t\t\t'comment' => 'if part of core definitions',\n\t\t\t\t'default' => false,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('active', 'boolean', [\n\t\t\t\t'default' => false,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('created', 'datetime', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('modified', 'datetime', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('sort', 'integer', [\n\t\t\t\t'comment' => 'often used ones should be on top',\n\t\t\t\t'default' => '0',\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => false,\n\t\t\t])\n\t\t\t->addColumn('mime_type_image_id', 'integer', [\n\t\t\t\t'default' => null,\n\t\t\t\t'limit' => null,\n\t\t\t\t'null' => true,\n\t\t\t\t'signed' => false,\n\t\t\t])\n\t\t\t->create();\n\t}", "public function image()\n {\n return $this->morphOne(Image::class,'imageable');\n }", "function register_field_type_info($info)\n {\n }", "protected function getImageAttributes() {}", "function image_link_input_fields($post, $url_type = '')\n {\n }", "public function image(){\n return $this->morphOne(Image::class, 'imageable');\n }", "public function image(){\n return $this->morphOne(Image::class, 'imageable');\n }", "public function image(){\n return $this->morphOne(Image::class, 'imageable');\n }", "private function imageFieldToMedia(MigratePrepareRowEvent $event) {\n if (in_array($event->getSource()->getPluginId(), [\n 'd7_field',\n 'd7_field_instance',\n 'd7_field_instance_per_view_mode',\n 'd7_field_instance_per_form_display',\n 'd7_view_mode',\n ])) {\n $row = $event->getRow();\n if (($row->getSourceProperty('type') == 'image')) {\n $row->setSourceProperty('type', 'media_image');\n }\n }\n }", "public function getTypeMapper();", "public function image()//minuscula modeloforaneo\n {\n return $this->morphOne('App\\Image','imageable'); //1er parametro:direccion modeloforaneo, 2do parametro: modeloforaneo+'able'\n }", "function define_image_vars ( ) {\r\n\t\t/*\r\n\t\t * Changlog\r\n\t\t * v1.1, November 11, 2009\r\n\t\t * - Cleaned\r\n\t\t */\r\n\t\tglobal $IMAGE_TYPE_EXTS, $IMAGE_TYPE_EXT, $IMAGE_TYPE_READFUNCTION, $IMAGE_TYPE_WRITEFUNCTION, $IMAGE_CODE_TYPE, $IMAGE_SUPPORTED_READ_TYPES, $IMAGE_SUPPORTED_READ_EXTENSIONS, $IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS, $IMAGE_SUPPORTED_WRITE_TYPES, $IMAGE_SUPPORTED_WRITE_EXTENSIONS, $IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS, $IMAGE_SUPPORTED_TYPES, $IMAGE_SUPPORTED_EXTENSIONS, $IMAGE_SUPPORTED_TYPES_EXTENSIONS;\r\n\t\tif ( isset($IMAGE_TYPE_EXTS) )\r\n\t\t\treturn true;\r\n\t\t\r\n\t\t$IMAGE_TYPE_EXTS = array(IMAGETYPE_GIF => array('gif'), IMAGETYPE_JPEG => array('jpeg', 'jpg', 'jpe'), IMAGETYPE_JPEG2000 => array('jpeg', 'jpg', 'jpe'), IMAGETYPE_PNG => array('png'), IMAGETYPE_PSD => array('psd'), IMAGETYPE_BMP => array('bmp'), IMAGETYPE_TIFF_II => array('tiff'), IMAGETYPE_TIFF_MM => array('tiff'), IMAGETYPE_JPC => array('jpc'), IMAGETYPE_JP2 => array('jp2'), IMAGETYPE_JPX => array('jpx'), IMAGETYPE_JB2 => array('jb2'), IMAGETYPE_SWF => array('swf'), IMAGETYPE_SWC => array('swc'), IMAGETYPE_IFF => array('iff'), IMAGETYPE_WBMP => array('wbmp'), IMAGETYPE_XBM => array('xbm'));\r\n\t\t$IMAGE_TYPE_EXT = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_READ_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_READ_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_WRITE_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_WRITE_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_SUPPORTED_TYPES = array();\r\n\t\t$IMAGE_SUPPORTED_EXTENSIONS = array();\r\n\t\t$IMAGE_SUPPORTED_TYPES_EXTENSIONS = array();\r\n\t\t\r\n\t\t$IMAGE_TYPE_READFUNCTION = array();\r\n\t\t$IMAGE_TYPE_WRITEFUNCTION = array();\r\n\t\t\r\n\t\tforeach ( $IMAGE_TYPE_EXTS as $image_type => $image_extensions ) {\r\n\t\t\t// Check type\r\n\t\t\tforeach ( $image_extensions as $image_extension ) {\r\n\t\t\t\t// Check read\r\n\t\t\t\t$image_read_function = 'imagecreatefrom' . $image_extension;\r\n\t\t\t\t$image_supported_read = function_exists($image_read_function);\r\n\t\t\t\tif ( $image_supported_read ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_READ_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t}\r\n\t\t\t\t// check write\r\n\t\t\t\t$image_write_function = 'image' . $image_extension;\r\n\t\t\t\t$image_supported_write = function_exists($image_write_function);\r\n\t\t\t\tif ( $image_supported_write ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_WRITE_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t}\r\n\t\t\t\t// Check overall\r\n\t\t\t\tif ( $image_supported_read && $image_supported_write ) {\r\n\t\t\t\t\t// Supported\r\n\t\t\t\t\t$IMAGE_TYPE_EXT[$image_type] = $image_extension;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_TYPES[] = $image_type;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_EXTENSIONS += $image_extensions;\r\n\t\t\t\t\t$IMAGE_SUPPORTED_TYPES_EXTENSIONS[$image_type] = $image_extensions;\r\n\t\t\t\t\t$IMAGE_TYPE_WRITEFUNCTION[$image_type] = $image_write_function;\r\n\t\t\t\t\t$IMAGE_TYPE_READFUNCTION[$image_type] = $image_read_function;\r\n\t\t\t\t\t// Done we work\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t// Continue\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// Done\r\n\t\treturn true;\r\n\t}", "public function mapImageSizeVariants(Image $image, array $metaData);", "function image_attachment_fields_to_save($post, $attachment)\n {\n }", "function neurovision_images() {\n \tregister_post_type( 'images', /* (http://codex.wordpress.org/Function_Reference/register_post_type) */\n \t \t// let's now add all the options for this post type\n \t\tarray('labels' => array(\n \t\t\t'name' => __('Images', 'neurovisiontheme'), /* This is the Title of the Group */\n \t\t\t'singular_name' => __('Image', 'neurovisiontheme'), /* This is the individual type */\n \t\t\t'all_items' => __('All Images', 'neurovisiontheme'), /* the all items menu item */\n \t\t\t'add_new' => __('Add New Image', 'neurovisiontheme'), /* The add new menu item */\n \t\t\t'add_new_item' => __('Add New Image', 'neurovisiontheme'), /* Add New Display Title */\n \t\t\t'edit' => __( 'Edit', 'neurovisiontheme' ), /* Edit Dialog */\n \t\t\t'edit_item' => __('Edit Image', 'neurovisiontheme'), /* Edit Display Title */\n \t\t\t'new_item' => __('New Image', 'neurovisiontheme'), /* New Display Title */\n \t\t\t'view_item' => __('View Image', 'neurovisiontheme'), /* View Display Title */\n \t\t\t'search_items' => __('Search Images', 'neurovisiontheme'), /* Search Custom Type Title */\n \t\t\t'not_found' => __('Nothing found in the Database.', 'neurovisiontheme'), /* This displays if there are no entries yet */\n \t\t\t'not_found_in_trash' => __('Nothing found in Trash', 'neurovisiontheme'), /* This displays if there is nothing in the trash */\n \t\t\t'parent_item_colon' => ''\n \t\t\t), /* end of arrays */\n \t\t\t'description' => __( 'neurovision Images', 'neurovisiontheme' ), /* Custom Type Description */\n\n \t\t\t'public' => true,\n \t\t\t'publicly_queryable' => true,\n \t\t\t'exclude_from_search' => false,\n \t\t\t'show_ui' => true,\n \t\t\t'query_var' => true,\n \t\t\t'menu_position' => 6, /* this is what order you want it to appear in on the left hand side menu */\n \t\t\t'menu_icon' => 'dashicons-format-image', /* the icon for the custom post type menu */\n \t\t\t'rewrite'\t=> array( 'slug' => 'images', 'with_front' => false ), /* you can specify its url slug */\n \t\t\t'has_archive' => true, /* you can rename the slug here */\n \t\t\t'capability_type' => 'post',\n \t\t\t'hierarchical' => false,\n \t\t\t/* the next one is important, it tells what's enabled in the post editor */\n \t\t\t'supports' => array( 'title', 'editor', 'page-attributes', 'thumbnail')\n \t \t) /* end of options */\n \t); /* end of register post type */\n\n }", "static function getImgProperty($img)\r\n\t{\r\n\t\t$ImgSize = getimagesize($img);\r\n\t\t$ImgMime = $ImgSize['mime'];\r\n\t\t$mime = explode('/',$ImgMime);\r\n\t\t$ImgType = $mime[1];\r\n\t\t$prop['width'] = $ImgSize[0];\r\n\t\t$prop['height'] = $ImgSize[1];\r\n\t\t$prop['type'] = $ImgType;\r\n\t\treturn($prop);\r\n\t}", "function Utilities_Image(){\n\t\t// $this->$imageAsset = $img;\t\t\n\t}", "function Photo_Uploaded_Mime_Type()\n{\n // On assume ici que la photo est valide\n\n $imageFileType = pathinfo(basename($_FILES['un_fichier']['name']), PATHINFO_EXTENSION);\n switch ($imageFileType) {\n case 'jpg':\n case 'JPG':\n return 'image/jpeg';\n\n case 'gif':\n case 'GIF':\n return 'image/gif';\n\n case 'png':\n case 'PNG':\n return 'image/png';\n }\n\n return 'ERROR';\n}", "private function buildImagesFields()\n {\n $groupName = Translate::getAdminTranslation(\"Images\", \"AdminProducts\");\n\n //====================================================================//\n // PRODUCT IMAGES\n //====================================================================//\n\n //====================================================================//\n // Product Images List\n $this->fieldsFactory()->create(SPL_T_IMG)\n ->Identifier(\"image\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Images\", \"AdminProducts\"))\n ->Group($groupName)\n ->MicroData(\"http://schema.org/Product\", \"image\");\n\n //====================================================================//\n // Product Images => Position\n $this->fieldsFactory()->create(SPL_T_INT)\n ->Identifier(\"position\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Position\", \"AdminProducts\"))\n ->MicroData(\"http://schema.org/Product\", \"positionImage\")\n ->Group($groupName)\n ->isNotTested();\n\n //====================================================================//\n // Product Images => Is Cover\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->Identifier(\"cover\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Cover\", \"AdminProducts\"))\n ->MicroData(\"http://schema.org/Product\", \"isCover\")\n ->Group($groupName)\n ->isNotTested();\n\n //====================================================================//\n // Product Images => Is Visible Image\n $this->fieldsFactory()->create(SPL_T_BOOL)\n ->Identifier(\"visible\")\n ->InList(\"images\")\n ->Name(Translate::getAdminTranslation(\"Visible\", \"AdminProducts\"))\n ->MicroData(\"http://schema.org/Product\", \"isVisibleImage\")\n ->Group($groupName)\n ->isNotTested();\n }", "function check_image_type($ftype)\n{\n$ext = strtolower(end(explode('.',$ftype)));\n$img_array = array('jpeg','jpg','gif','png');\n\n//\tif($ftype == \"image/jpeg\" || $ftype == \"image/jpg\" || $ftype == \"image/gif\" || $ftype == \"image/png\" )\n\tif(in_array($ext,$img_array))\n\t\treturn 1;\n\t\telse\n\t\t\treturn 0;\n}", "function store_images($source_id, $type) {\n\t\t$image = File::where('type', $type)->where('source_id', $source_id)->first();\n\n\t\tif ($image) {\n\t\t\treturn $image->image_name;\n\t\t}\n\t\treturn getEmptyStoreImage();\n\t}", "public function register_image_sizes() {\n\n }", "function setImage( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n \n if ( get_class( $value ) == \"ezimage\" )\n {\n $this->ImageID = $value->id();\n }\n elseif( is_numeric( $value ) )\n {\n $this->ImageID = $value;\n }\n }", "public function setOutputImageType($type);", "public function image();", "public function image();", "function image_type_to_common_extension($imagetype, $include_dot = true) {\n\t$replace = array(\n\t\t'jpeg' => 'jpg',\n\t\t'tiff' => 'tif',\n\t);\n\t$ext = image_type_to_extension($imagetype, $include_dot);\n\treturn isset($replace[$ext]) ? $replace[$ext] : $ext;\n}", "function getTypeConverter() ;", "protected function processImage() {}", "function wp_get_image_mime($file)\n {\n }", "function _rulesDimensionImage($directory_name, $data_type = false, $photo_extension = false, $options = array()){\n \t$type_image = $this->RmCommon->filterEmptyField($options, 'type_image', false, 'landscape');\n \t$result = array();\n \t\n \tif( in_array($directory_name, array( 'logos' )) ) {\n \t\tif( $data_type == 'thumb' ) {\n \t\t\t$result = 'xsm';\n \t\t} else if( $data_type == 'large' ) {\n \t\t\t$result = 'xxsm';\n \t\t} else {\n\t \t\t$result = array(\n\t\t\t\t\t'xsm' => '100x40',\n\t\t\t\t\t'xm' => '200x200',\n\t\t\t\t\t'xxsm' => '240x96'\n\t\t\t\t);\n\t \t}\n \t} else if( in_array($directory_name, array( 'users' )) ) {\n \t\tif( $data_type == 'thumb' ) {\n \t\t\t$result = 'pm';\n \t\t} else if( $data_type == 'large' ) {\n \t\t\t$result = 'pxl';\n \t\t} else {\n\t \t\t$result = array(\n\t\t\t\t\t'ps' => '50x50',\n\t\t\t\t\t'pm' => '100x100',\n\t\t\t\t\t'pl' => '150x150',\n\t\t\t\t\t'pxl' => '300x300',\n\t\t\t\t);\n\t \t}\n \t} else if( in_array($directory_name, array( 'ebrosur', 'ebrosur_template' )) ) {\n if( $data_type == 'thumb' ) {\n \t\t\t$result = 'm';\n \t\t} else if( $data_type == 'large' ) {\n \t\t\t$result = 'xl';\n \t\t} else {\n\t\t\t\t$isBuilder = Common::config('Config.Company.data.UserCompanyConfig.is_ebrochure_builder');\n\n \t\t\tif($type_image == 'potrait'){\n \t\t\t\t$result = array(\n\t\t\t\t\t\t's' => '296x420',\n\t\t\t\t\t\t'm' => '453x640',\n\t\t\t\t\t\t'xl' => $isBuilder ? '768x1024' : '724x1024',\n\t\t\t\t\t);\n \t\t\t}else{\n \t\t\t\t$result = array(\n\t\t\t\t\t\t's' => '420x296',\n\t\t\t\t\t\t'm' => '640x453',\n\t\t\t\t\t\t'xl' => $isBuilder ? '1024x768' : '1024x724',\n\t\t\t\t\t);\n \t\t\t}\n\t \t}\n } else if( in_array($directory_name, array( 'files', 'crms', 'document', 'documents')) && in_array($photo_extension, array( 'pdf', 'xls', 'xlsx' )) ) {\n\t\t\t$result = false;\n } else {\n \t\tif( $data_type == 'thumb' ) {\n \t\t\t$result = 'm';\n \t\t} else if( $data_type == 'large' ) {\n \t\t\t$result = 'l';\n \t\t} else {\n\t \t\t$result = array(\n\t\t\t\t\t's' => '150x84',\n\t\t\t\t\t'm' => '300x169',\n\t\t\t\t\t'l' => '855x481',\n\t\t\t\t\t'company' => '855x481'\n\t\t\t\t);\n\t \t}\n \t}\n\n \treturn $result;\n }", "function make_image_slide_data($image_id) {\n return array(\n 'type' => 'image',\n 'id' => absint($image_id)\n );\n }", "Function getFileType(){\n\t\t$it = $this->info['origSize'][2];\n\t\tswitch($it){\n\t\t\tcase IMAGETYPE_GIF: $r = \"gif\"; break;\n\t\t\tcase IMAGETYPE_JPEG: $r = \"jpg\"; break;\n\t\t\tcase IMAGETYPE_PNG: $r = \"png\"; break;\n\t\t\tcase IMAGETYPE_BMP: $r = \"bmp\"; break;\n\t\t\tcase IMAGETYPE_WBMP: $r = \"wbmp\"; break;\n\t\t\tcase IMAGETYPE_WEBP: $r = \"webp\"; break;\n\t\t\tdefault:\n\t\t\t\t$r = false;\n\t\t\t\tbreak;\n\t\t}\n\t\t\n\t\treturn $r;\n\t}", "public function image() {\n return $this->morphOne('App\\Models\\Image', 'imageable');\n }", "protected function imageName() {}", "protected function getImageTypeFromImages($imgType){\n if(!isset($this->images)){\n return;\n }\n foreach ($this->images as $image) {\n if($image['type'] == $imgType){\n return $image['src'];\n } \n }\n }", "function forceType($fieldName,$inputType){\n\n\t\tif($inputType == \"file\") $this->hasFiles = true;\n\t\t$this->forced[$fieldName] = $inputType;\n\n\t}", "protected function findType() {\n switch ($this->part->type) {\n case IMAP::ATTACHMENT_TYPE_MESSAGE:\n $this->type = 'message';\n break;\n case IMAP::ATTACHMENT_TYPE_APPLICATION:\n $this->type = 'application';\n break;\n case IMAP::ATTACHMENT_TYPE_AUDIO:\n $this->type = 'audio';\n break;\n case IMAP::ATTACHMENT_TYPE_IMAGE:\n $this->type = 'image';\n break;\n case IMAP::ATTACHMENT_TYPE_VIDEO:\n $this->type = 'video';\n break;\n case IMAP::ATTACHMENT_TYPE_MODEL:\n $this->type = 'model';\n break;\n case IMAP::ATTACHMENT_TYPE_TEXT:\n $this->type = 'text';\n break;\n case IMAP::ATTACHMENT_TYPE_MULTIPART:\n $this->type = 'multipart';\n break;\n default:\n $this->type = 'other';\n break;\n }\n }", "protected function add_image_to_index(\\WP_REST_Response $response, $image_id, $type)\n {\n }", "function register_image_sizes() {\n\t}", "public function getImagesLinkType()\n {\n return 'structure';\n }", "function image() {\n return data_field_admin::field_icon($this);\n }", "public function mapImageSizeVariant(Image $image, array $variantMetaData);", "public function model()\n {\n return Image::class;\n }", "function match_mime_type_to_extension($image_type, $image_type_identifiers)\n {\n foreach ($image_type_identifiers as $_key_outer_loop => $_val_outer_loop) {\n foreach ($_val_outer_loop as $_key => $_val) {\n if (is_int($_key)) {// Keep record of extension for mime check\n $extension = $_val;\n }\n if ($_key == 'mime_type') {\n if ($_val === $image_type) {// Found match no need to continue looping\n return $extension;### Return\n }\n }\n }\n }\n // Compared all values without match\n return $extension = INVALID_IMAGETYPE;\n }", "function check_image_type(&$type, &$error, &$error_msg)\n{\n\tglobal $lang;\n\n\tswitch( $type )\n\t{\n\t\tcase 'jpeg':\n\t\tcase 'pjpeg':\n\t\tcase 'jpg':\n\t\t\treturn '.jpg';\n\t\t\tbreak;\n\t\tcase 'gif':\n\t\t\treturn '.gif';\n\t\t\tbreak;\n\t\tcase 'png':\n\t\t\treturn '.png';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$error = true;\n\t\t\t$error_msg = (!empty($error_msg)) ? $error_msg . '<br />' . $lang['Avatar_filetype'] : $lang['Avatar_filetype'];\n\t\t\tbreak;\n\t}\n\n\treturn false;\n}", "function changer_formats($type)\n{\n $format = \"\";\n \n switch ($type)\n {\n case 'image/png':\n $format = '.png';\n break;\n case 'image/jpeg':\n $format = '.jpg';\n break;\n case 'image/gif':\n $format = '.gif';\n break;\n case 'image/bmp':\n $format = '.bmp';\n break;\n case 'image/vnd.microsoft.icon':\n $format = '.ico';\n break;\n case 'image/tiff':\n $format = '.tif';\n break;\n case 'image/svg+xml':\n $format = '.svg';\n break;\n }\n \n return $format;\n}", "public function meta_type();", "public function image()\n {\n return $this->morphOne('App\\Image', 'imageable');\n }", "function getType()\n\t{\n\t\treturn $this->il_type;\n\t}", "private function varIsImage($img) {\r\n $fp = fopen($img, 'rb');\r\n $exif_data = @exif_read_data($fp);\r\n if(is_array($exif_data)) {\r\n $this->varIsArray($exif_data);\r\n } else {\r\n $this->checkType($img . ' : No exif support for this image format!');\r\n }\r\n fclose($fp);\r\n }", "private function adjust_field_types() {\n // Adjust int fields.\n $ft = array('id', 'course', 'context', 'file', 'cropx', 'cropy', 'scalex', 'scaley', 'height', 'width', 'rotate');\n foreach ($ft as $f) {\n $this->$f = ($this->$f === null) ? null : (int)$this->$f;\n }\n }", "function _db_process_field($field) {\n\n if (!isset($field['size'])) {\n $field['size'] = 'normal';\n }\n\n // Set the correct database-engine specific datatype.\n if (!isset($field['mysql_type'])) {\n $map = db_type_map();\n $field['mysql_type'] = $map[$field['type'] .':'. $field['size']];\n }\n\n if ($field['type'] == 'serial') {\n $field['auto_increment'] = TRUE;\n }\n\n return $field;\n}", "function yz_filter_exported_field_value( $value, $field ) {\n\n if ( ! isset( $field['type'] ) ) {\n return $value;\n }\n\n switch ( $field['type'] ) {\n\n case 'options':\n\n return implode( ', ', $value );\n\n case 'images':\n case 'image':\n\n global $YZ_upload_url;\n\n foreach ( $value as $key => $val ) {\n\n if ( empty( $val ) ) continue;\n\n if ( $key == 'original' ) {\n $key = __( 'Original', 'youzer' );\n } elseif ( $key == 'thumbnail' ) {\n $key = __( 'Thumbnail', 'youzer' );\n }\n\n // Get Url.\n $url = $YZ_upload_url . $val;\n\n // Get Content.\n $content .='<strong>' . $key . '</strong> : <a href=\"' . $url . '\">' . $url . '</a><br>';\n\n }\n\n return $content;\n\n default:\n return $value;\n break;\n }\n\n}", "function PMA_istableFieldBlob($field)\n{\n // If check to ensure types such as \"enum('one','two','blob',..)\" or\n // \"enum('one','two','tinyblob',..)\" etc. are not categorized as blob.\n if (stripos($field['Type'], 'blob') === 0\n || stripos($field['Type'], 'tinyblob') === 0\n || stripos($field['Type'], 'mediumblob') === 0\n || stripos($field['Type'], 'longblob') === 0\n ) {\n return stristr($field['Type'], 'blob');\n } else {\n return false;\n }\n}", "function wp_mime_type_icon($mime = 0)\n {\n }" ]
[ "0.67992747", "0.67736816", "0.66332746", "0.6491411", "0.6258314", "0.61537004", "0.61391544", "0.6115127", "0.60603297", "0.60329527", "0.6019482", "0.5985831", "0.5926729", "0.58506", "0.5839317", "0.57877916", "0.5745399", "0.5724725", "0.571769", "0.5709774", "0.5685355", "0.5684247", "0.565423", "0.56540596", "0.56525797", "0.5641755", "0.5632782", "0.56197053", "0.5602789", "0.5599788", "0.5599604", "0.55895305", "0.5571294", "0.5563755", "0.5545718", "0.5540168", "0.5508091", "0.55069715", "0.5499353", "0.54981196", "0.5492055", "0.54903567", "0.54893225", "0.548872", "0.5471954", "0.54597497", "0.5456076", "0.545524", "0.5449704", "0.54491216", "0.54491216", "0.54491216", "0.54410034", "0.5436291", "0.54304487", "0.54179066", "0.5406542", "0.5404243", "0.5403903", "0.53917533", "0.5391079", "0.53858197", "0.5385426", "0.538426", "0.5383652", "0.53795713", "0.53764534", "0.53680784", "0.5357477", "0.5357477", "0.5355943", "0.5347728", "0.5333055", "0.53316206", "0.5326557", "0.5325778", "0.5318798", "0.5318633", "0.5308172", "0.5302613", "0.5298505", "0.5297085", "0.52869856", "0.52809644", "0.5261019", "0.5250294", "0.5242852", "0.52334917", "0.52309674", "0.52198225", "0.5218538", "0.5217726", "0.520194", "0.5201023", "0.5194947", "0.51944995", "0.51898646", "0.51882136", "0.51831514", "0.5178214" ]
0.6164357
5
Save file for image type.
public function saveFile($media_data, $api_key) { if(isset($media_data['data']['item']['renditions']['main'])) { $title = $media_data['data']['item']['title']; $alt_text = $media_data['data']['item']['headline']; if(isset($media_data['data']['item']['altids']['itemid'])) { $item_id = $media_data['data']['item']['altids']['itemid']; $uri = $media_data['data']['item']['renditions']['main']['href']; $image_url = $uri . '&apikey=' . $api_key; $actual_uri = NULL; // Get redirected url. $response = $this->http_client_factory->fromOptions([ 'allow_redirects' => [ 'on_redirect' => function (RequestInterface $request, ResponseInterface $response, \Psr\Http\Message\UriInterface $uri) use (&$actual_uri) { $actual_uri = (string) $uri; } ], ])->get($image_url); $redirected_url = $actual_uri . '&apikey=' . $api_key; $data = file_get_contents($redirected_url); $file = file_save_data($data, "public://$item_id.jpeg", FileSystemInterface::EXISTS_REPLACE); return [ 'target_id' => $file->id(), 'alt' => $alt_text, 'title' => $title, ]; } } return []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveImage()\n\t{\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t/* store a interlaced gif image */\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagegif($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t/* store a progressive jpeg image (with default quality value)*/\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagejpeg($this->ImageStream, $this->sFileLocation, $this->jpegquality);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t/* store a png image */\n\t\t\t\timagepng($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\n\t\t\t\tif (!file_exists($this->sFileLocation)) {\n\t\t\t\t\t$this->printError('file not stored');\n\t\t\t\t}\n\t\t}\n\t}", "protected function save()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n imagegif($this->image, $this->getPath(true));\n break;\n \n case 'image/jpeg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/jpg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/png':\n imagepng($this->image, $this->getPath(true), round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n \n chmod($this->getPath(true), 0777);\n }", "abstract public function save($img, $filename);", "public function save() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n $ext = $this->getImageExt();\n $quality = $this->__imageQuality;\n $dirSavePath = dirname($this->__imageSavePath);\n \n if (empty($this->__imageSavePath) || !is_dir($dirSavePath)) {\n $this->setError(__d('cloggy','Image save path not configured or maybe not exists.'));\n } else { \n \n /*\n * create resized image\n */\n switch($ext) {\n \n case 'jpg':\n case 'jpeg':\n\n if (imagetypes() & IMG_JPG) {\n @imagejpeg($this->__imageResized,$this->__imageSavePath,$quality); \n }\n\n break;\n\n case 'gif':\n\n if (imagetypes() & IMG_GIF) {\n @imagegif($this->__imageResized,$this->__imageSavePath); \n }\n\n break;\n\n case 'png':\n\n $scaleQuality = round($this->__imageQuality/100) * 9;\n $invertScaleQuality = 9 - $scaleQuality;\n\n if (imagetypes() & IMG_PNG) {\n @imagepng($this->__imageResized,$this->__imageSavePath,$invertScaleQuality); \n }\n\n break;\n\n } \n \n } \n \n /*\n * destroy resized image\n */\n if ($this->__imageResized) {\n \n //destroy resized image\n imagedestroy($this->__imageResized);\n \n } \n \n }\n \n }", "private function savePhoto()\n {\n $image = Image::make($this->filePath);\n\n File::exists($this->sanghaPhotosPath()) or File::makeDirectory($this->sanghaPhotosPath());\n\n $image->resize(400, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($this->sanghaPhotosPath() . $this->fileName)\n ->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n })\n ->save($this->sanghaPhotosPath() . 'tn_' . $this->fileName);\n\n }", "private function save()\n {\n $this->collage->setImageFormat('jpeg');\n return $this->collage->writeImage($this->name);\n }", "function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) \n {\n //salva imagen tipo JPEG\n if( $image_type == IMAGETYPE_JPEG )\n {\n imagejpeg($this->image,$filename,$compression);\n } \n //Salva imagen GIF.\n elseif( $image_type == IMAGETYPE_GIF ) \n {\n imagegif($this->image,$filename); \n } \n //Salva imagen PNG\n //Necesita una imagen transparente.\n elseif( $image_type == IMAGETYPE_PNG ) \n { \n imagealphablending($this->image, false);\n imagesavealpha($this->image,true);\n imagepng($this->image,$filename);\n } \n if( $permissions != null) \n {\n chmod($filename,$permissions);\n }\n }", "function imageSaveFile($property, \\SplFileInfo $file);", "function save(&$image) {\r\r\n\t\treturn $this->__write($image);\r\r\n\t\t}", "public function save(array $options = []) {\n/* if (preg_match('/image/', $this->mime_type)) {\n $this->isImage = true;\n $manager = new ImageManager(array('driver' => 'gd'));\n $image = Storage::disk('public')->get($this->myFile);\n $imageOrig = $manager->make($image); \n //Get width and height of the image\n $this->img_width = $imageOrig->width();\n $this->img_height = $imageOrig->height();\n }*/\n parent::save($options);\n $this->createThumbs();\n }", "public function save()\n {\n\n $photo = $this->flyer->addPhoto($this->makePhoto());\n\n\n // move the photo to the images folder\n $this->file->move($photo->baseDir(), $photo->name);\n\n\n// Image::make($this->path)\n// ->fit(200)\n// ->save($this->thumbnail_path);\n\n // generate a thumbnail\n $this->thumbnail->make($photo->path, $photo->thumbnail_path);\n }", "function imageSave($property, UploadedFile $file);", "public function save($file = NULL)\n {\n if($file === NULL && $this->storage)\n {\n $this->storage->save($this);\n }\n elseif($file !== NULL)\n {\n $this->savePicture($file);\n }\n else\n {\n trigger_error('Image file to save is not defined', E_USER_WARNING);\n }\n }", "public function saveToFile($file_path = \"\") {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n if (!is_dir(dirname($file_path))) {\n $parent_directory = dirname($file_path);\n $mode = 0777;\n $recursive = true;\n mkdir($parent_directory, $mode, $recursive);\n }\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n $file_extension = \"jpg\";\n break;\n case \"image/png\":\n $file_extension = \"png\";\n break;\n case \"image/gif\":\n $file_extension = \"gif\";\n break;\n }\n\n// filling out the file path\n $file_path = sprintf(\"%s.%s\", $file_path, $file_extension);\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $file_path);\n break;\n case \"image/png\":\n imagepng($this->_resource, $file_path);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $file_path);\n break;\n }\n\n// assigning the new image file_location attribute\n $this->_file_location = $file_path;\n\n// changing the mode (so that all can make good use of the new image file)\n chmod($this->_file_location, 0777);\n } else {\n trigger_error(\"CAMEMISResizeImage::saveToFile() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "public function save($file, $path);", "function saveImageObjectToFile($objImage, $imageType, $fileName, $quality)\n\t{\n\t\t$filePath = dirname($fileName);\n\t\tif (!is_dir($filePath))\n\t\t\tmkdir($filePath, 0777, true);\n\t\t\n\t\t// If the file already exists\n\t\tif(is_file($fileName))\n\t\t\t@unlink($fileName);\n\n\t\t\t\t\n\t\tswitch ($imageType)\n\t\t{\n\t\t\tcase 1: $res = @imagegif($objImage,$fileName); break;\n\t\t\tcase 2: $res = @imagejpeg($objImage,$fileName,intval($quality*100)); break;\n\t\t\tcase 3: $res = @imagepng($objImage,$fileName,intval($quality*9)); break;\n\t\t}\n\t\t\t\t\n\t\tif (!$res)\n\t\t\t$this->lastError = 'error_saving_image_file';\n\t\t\n\t\tchmod($fileName, 0777);\n\t\t\n\t\treturn $res;\n\t}", "public function save()\n {\n $this->validate();\n $this->validate(['image' => 'required|image']);\n\n // try to upload image and resize by ImageSaverController config\n try {\n $imageSaver = new ImageSaverController();\n $this->imagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n\n $this->PostSaver();\n\n $this->resetAll();\n $this->ChangeCreatedMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully added',\n 'icon' => 'success'\n ]);\n $this->render();\n }", "protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }", "public function save($file)\r\n\t{\r\n\t\tif(empty($this->img))\r\n\t\t{\r\n\t\t\t$this->render();\r\n\t\t}\r\n\t\timagepng($this->img, $file);\r\n\t}", "protected function _store($im)\n {\n if (!is_null($this->_options['savePath'])) {\n switch ($this->_options['imageType']) {\n case 'gif':\n imagegif($im, $this->_options['savePath']);\n break;\n case 'jpeg':\n imagejpeg($im, $this->_options['savePath']);\n break;\n case 'png':\n default:\n imagepng($im, $this->_options['savePath']);\n }\n }\n \n return $im; \n }", "public function save()\n {\n $dir = $this->pathTmpImage;\n\n $files = scandir($dir);\n\n foreach ($files as $file) {\n if ($file == $_POST['image']) { \n copy($this->pathTmpImage . $file, $this->pathResult . $file);\n }\n }\n\n //$this->dbInsert($_POST['image']);\n\n unlink($this->pathTmpImage . $_POST['image']);\n }", "function save($filePath);", "public function save() {\n\t $file = new File();\n\t $file->setName($this->name);\n\t $file->setPath($this->folder->getPath().'/'.$this->name);\n\t $file->setExtension($this->extension);\n\t $file->setSize(filesize($this->filename));\n\t \n\t $this->em->persist($file);\n\t \n\t $this->folder->addFile($file->getId());\n\t \n\t // Categorized file\n\t if ($file->isPicture()) {\n\t $image = getimagesize($this->filename);\n\t \n\t $fileType = new Picture($this->filename);\n\t $fileType->setWidth($image[0]);\n\t $fileType->setHeight($image[1]);\n\t }elseif ($file->isAudio()) {\n\t $fileType = new Audio();\n\t }elseif ($file->isVideo()) {\n\t $fileType = new Video();\n\t }else {\n\t $fileType = new Document();\n\t }\n\t \n\t if ($fileType !== null) {\n\t $fileType->setFile($file);\n\t $this->em->persist($fileType);\n\t }\n\t \n\t $this->em->flush();\n\t return $file;\n\t}", "function save_img() {\n imagejpeg($this->img, 'captcha.jpg');\n\n // Libération de la mémoire\n imagedestroy($this->img);\n \n }", "function save_image($source, $destination, $image_type, $quality){\n switch(strtolower($image_type)){//determine mime type\n case 'image/png':\n imagepng($source, $destination); return true; //save png file\n break;\n case 'image/gif':\n imagegif($source, $destination); return true; //save gif file\n break;\n case 'image/jpeg': case 'image/pjpeg':\n imagejpeg($source, $destination, $quality); return true; //save jpeg file\n break;\n default: return false;\n }\n}", "function save_image($source, $image_type, $destination_folder){\n\t switch(strtolower($image_type)){//determine mime type\n\t\t case 'image/png': \n\t\t\t imagepng($source, $destination_folder); return true; //save png file\n\t\t\t break;\n\t\t case 'image/gif': \n\t\t\t imagegif($source, $destination_folder); return true; //save gif file\n\t\t\t break; \n\t\t case 'image/jpeg': case 'image/pjpeg': \n\t\t\t imagejpeg($source, $destination_folder); return true; //save jpeg file\n\t\t\t break;\n\t\t default: return false;\n\t }\n }", "public function save($img, $name, $path = null)\n {\n $path = $path ?: $this->path;\n\n $this->disk->put($path .'/'. $name, $img->stream());\n }", "public static function save_file($_file)\n {\n $photo_file = MyUtil::gen_file_name();\n $new_file = $_SERVER['DOCUMENT_ROOT'] . \"/statics/images/upload/$photo_file\";\n if (file_put_contents($new_file, $_file)) {\n $img_type = exif_imagetype($new_file);\n $ext = image_type_to_extension($img_type, TRUE);\n rename($new_file, $new_file . $ext);\n $new_file = $new_file . $ext;\n return $photo_file . $ext;\n }\n }", "public function SaveProfileImg() {\n $file_name = $_SESSION['user_id'] . \"-\" . time() . \"-\" . $this->ImageName;\n $file_size = $this->ImageSize;\n $file_tmp = $this->ImageTmpName;\n $tmp = explode('.', $file_name);\n $file_ext = end($tmp);\n $expensions = array(\"jpeg\", \"jpg\", \"png\", \"gif\");\n \n if (in_array($file_ext, $expensions) === false) {\n throw new Exception(\"extension not allowed, please choose a JPEG or PNG or GIF file.\");\n }\n \n if ($file_size > 2097152) {\n throw new Exception('File size must be excately 2 MB');\n }\n \n if (empty($errors) == true) {\n move_uploaded_file($file_tmp, \"data/profile/\" . $file_name);\n return \"data/profile/\" . $file_name;\n } else {\n echo \"Error\";\n }\n }", "function save_image($source, $destination, $image_type, $quality){\n\tswitch(strtolower($image_type)){//determine mime type\n\t\tcase 'image/png':\n\t\t\timagepng($source, $destination); return true; //save png file\n\t\t\tbreak;\n\t\tcase 'image/gif':\n\t\t\timagegif($source, $destination); return true; //save gif file\n\t\t\tbreak;\n\t\tcase 'image/jpeg': case 'image/pjpeg':\n\t\t\timagejpeg($source, $destination, $quality); return true; //save jpeg file\n\t\t\tbreak;\n\t\tdefault: return false;\n\t}\n}", "function save($filename, $compression=75, $permissions=null) \r\n\t{\r\n $success = true;\r\n $image_type = $this->type;\r\n \r\n ob_start(); \r\n //$mime = image_type_to_mime_type( $image_type );\r\n //header(\"Content-type: $mime\");\r\n \r\n if( $image_type == IMAGETYPE_JPEG ) {\r\n if (!$success = imagejpeg($this->image, null ))\r\n {\r\n $this->setError( \"DSCImage::save( 'jpeg' ) Failed\" );\r\n }\r\n } elseif( $image_type == IMAGETYPE_GIF ) {\r\n if (!$success = imagegif($this->image, null ))\r\n {\r\n $this->setError( \"DSCImage::save( 'gif' ) Failed\" );\r\n }\r\n } elseif( $image_type == IMAGETYPE_PNG ) {\r\n if (!$success = imagepng($this->image, null ))\r\n {\r\n $this->setError( \"DSCImage::save( 'png' ) Failed\" );\r\n }\r\n }\r\n\r\n if ($success)\r\n {\r\n $imgToWrite = ob_get_contents();\r\n ob_end_clean();\r\n \r\n if (!JFile::write( $filename, $imgToWrite)) \r\n {\r\n $this->setError( JText::_( \"Could not write file\" ).\": \".$filename );\r\n return false;\r\n }\r\n \r\n if( $permissions != null) {\r\n chmod($filename,$permissions);\r\n }\r\n unset($this->image);\r\n return true; \r\n }\r\n \r\n return false;\r\n\t}", "public function save($value){\n $target_path = IMG_PATH.DS.$this->file_name;\n try {\n //move the uploaded file to target path\n move_uploaded_file($value, $target_path);\n return $this->_add_photo();\n } catch (Exception $e) {\n throw $e;\n }\n }", "private function saveImage()\n {\n $name = $_FILES['image']['name'];\n $tmp_name = $_FILES['image']['tmp_name'];\n\n return move_uploaded_file($tmp_name, 'images/' . $name);\n }", "private function saveGdImage( $dst_img, $filepath, $type ) {\n\t\t$successSaving = false;\n\t\tswitch ( $type ) {\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\t$successSaving = imagejpeg( $dst_img,$filepath,$this->jpg_quality );\n\t\t\t\tbreak;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\t$successSaving = imagepng( $dst_img,$filepath );\n\t\t\t\tbreak;\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\t$successSaving = imagegif( $dst_img,$filepath );\n\t\t\t\tbreak;\n\t\t\tcase IMAGETYPE_BMP:\n\t\t\t\t$successSaving = imagewbmp( $dst_img,$filepath );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn($successSaving);\n\t}", "protected function savePicture($file)\n {\n $this->loadImageResource();\n\n // SUPPORT FOR CMYK IMAGES\n $colorSpace = new Colorspace();\n $colorSpace->apply($this);\n\n // APPLY EFFECT ON IMAGE\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $effect->apply($this);\n }\n }\n\n // CREATE DIRECTORY BY FILE PATH\n if(!file_exists($directory = dirname($file)))\n {\n mkdir($directory, 0777, TRUE);\n }\n\n // Zjistíme v jakém formátu máme obrázek uložit.\n $imageSaveFormat = $this->saveAs ?: strtolower(pathinfo($file, PATHINFO_EXTENSION));\n\n // Provedeme uložení obrázku přes GD.\n if($this->isGd())\n {\n // Uložení do WebP.\n if($imageSaveFormat === EPictureFormat::WEBP)\n {\n if($this->progressive)\n {\n imageinterlace($this->resource, TRUE);\n }\n\n imagewebp($this->resource, $file, $this->quality);\n }\n // Uložení do PNG.\n elseif($imageSaveFormat === EPictureFormat::PNG)\n {\n if($this->progressive)\n {\n imageinterlace($this->resource, TRUE);\n }\n\n imagepng($this->resource, $file, 9);\n }\n // Uložení do GIF.\n elseif($imageSaveFormat === EPictureFormat::GIF)\n {\n $gifResource = $this->resource;\n\n if($this->isGdImageTransparent($gifResource))\n {\n $validAlpha = ceil(0.333 * 127);\n $visiblePixels = 0;\n\n $height = imagesy($gifResource);\n $width = imagesx($gifResource);\n\n $transparentColor = imagecolorallocate($gifResource, 0xfe, 0x3, 0xf4);\n\n // FIX GIF IMAGE OPACITY\n for($x = 0; $x < $width; $x++)\n {\n for($y = 0; $y < $height; $y++)\n {\n $pixelIndex = imagecolorat($gifResource, $x, $y);\n $pixelColor = imagecolorsforindex($gifResource, $pixelIndex);\n\n if($pixelColor['alpha'] <= $validAlpha)\n {\n $visiblePixels++;\n }\n }\n }\n\n if(!$visiblePixels)\n {\n $validAlpha = 127;\n }\n\n for($x = 0; $x < $width; $x++)\n {\n for($y = 0; $y < $height; $y++)\n {\n $pixelIndex = imagecolorat($gifResource, $x, $y);\n $pixelColor = imagecolorsforindex($gifResource, $pixelIndex);\n\n if($pixelColor['alpha'] >= $validAlpha)\n {\n imagesetpixel($gifResource, $x, $y, $transparentColor);\n }\n else\n {\n $visiblePixel = imagecolorallocatealpha(\n\n $gifResource,\n $pixelColor['red'],\n $pixelColor['green'],\n $pixelColor['blue'],\n 0\n );\n\n imagesetpixel($gifResource, $x, $y, $visiblePixel);\n }\n }\n }\n\n imagecolortransparent($gifResource, $transparentColor);\n }\n\n if($this->progressive)\n {\n imageinterlace($gifResource, TRUE);\n }\n\n imagegif($gifResource, $file);\n }\n // Uložení do JPG.\n else\n {\n $image = $this->resource;\n\n $width = imagesx($image);\n $height = imagesy($image);\n\n $background = imagecreatetruecolor($width, $height);\n $whiteColor = imagecolorallocate($background, 255, 255, 255);\n\n imagefilledrectangle($background, 0, 0, $width, $height, $whiteColor);\n imagecopy($background, $image, 0, 0, 0, 0, $width, $height);\n\n if($this->progressive)\n {\n imageinterlace($background, TRUE);\n }\n\n imagejpeg($background, $file, $this->quality);\n }\n }\n // Provedeme uložení obrázku přes Imagick.\n else\n {\n // Uložení do WebP.\n if($imageSaveFormat === EPictureFormat::WEBP)\n {\n // There are problems with saving webP via imagick.\n // We will fall back to use GD extension to save image.\n $imageGd = $this->convertResource($this::WORKER_GD);\n\n if($this->progressive)\n {\n imageinterlace($imageGd, TRUE);\n }\n\n imagewebp($imageGd, $file, $this->quality);\n }\n // Uložení do JPG.\n elseif($imageSaveFormat === EPictureFormat::JPG)\n {\n $background = $this->createImagick();\n $background->newImage(\n\n $this->resource->getImageWidth(),\n $this->resource->getImageHeight(),\n '#FFFFFF'\n );\n\n $background->compositeImage($this->resource, Imagick::COMPOSITE_OVER, 0, 0);\n $background->setImageFormat('jpg');\n $background->setImageCompression(Imagick::COMPRESSION_JPEG);\n $background->setImageCompressionQuality($this->quality);\n\n if($this->progressive)\n {\n $background->setInterlaceScheme(Imagick::INTERLACE_PLANE);\n }\n\n $background->writeImage($file);\n }\n // Uložení do GIF.\n elseif($imageSaveFormat === EPictureFormat::GIF)\n {\n $validAlpha = 0.333;\n $visiblePixels = 0;\n $iterator = $this->resource->getPixelIterator();\n\n /** @var $pixel \\ImagickPixel */\n foreach($iterator as $row => $pixels)\n {\n foreach ($pixels as $col => $pixel)\n {\n $color = $pixel->getColor(TRUE);\n\n if($color['a'] >= $validAlpha)\n {\n $visiblePixels++;\n }\n }\n\n $iterator->syncIterator();\n }\n\n if(!$visiblePixels)\n {\n $validAlpha = 0;\n }\n\n // SAVE NEW ALPHA COLOR VALUE\n foreach($iterator as $row => $pixels)\n {\n foreach ($pixels as $col => $pixel)\n {\n $color = $pixel->getColor(TRUE);\n $pixel->setColorValue(Imagick::COLOR_ALPHA, $color['a'] >= $validAlpha ? 1 : 0);\n }\n\n $iterator->syncIterator();\n }\n\n if($this->progressive)\n {\n $this->resource->setInterlaceScheme(Imagick::INTERLACE_PLANE);\n }\n\n $this->resource->writeImage($file);\n }\n // Uložení do PNG.\n else\n {\n if($this->progressive)\n {\n $this->resource->setInterlaceScheme(Imagick::INTERLACE_PLANE);\n }\n\n $this->resource->writeImage($file);\n }\n }\n\n // Nastavení práv založenému obrázku.\n chmod($file, 0777);\n touch($file, filemtime($this->getImage()));\n\n // Odstranění dočasných souborů.\n foreach($this->tmpImage as $tmpImage)\n {\n unlink($tmpImage);\n }\n }", "private function save_image($source, $destination, $image_type){\n\tswitch(strtolower($image_type)){//determine mime type\n\tcase 'image/png':\n\t imagepng($source, $destination); return true; //save png file\n\t break;\n\tcase 'image/gif':\n\t imagegif($source, $destination); return true; //save gif file\n\t break; \n\tcase 'image/jpeg': case 'image/pjpeg':\n\t imagejpeg($source, $destination, '90'); return true; //save jpeg file\n\t break;\n\tdefault: return false;\n\t} \n\t}", "public function save(Photo $photo);", "public function save($pathToOutputFile)\n {\n switch($this->type)\n {\n case 'image/jpg':\n case 'image/jpeg':\n return imagejpeg($this->getWorkingImageResource(), $pathToOutputFile, self::JPEG_QUALITY);\n\n case 'image/png':\n return imagepng($this->getWorkingImageResource(), $pathToOutputFile);\n }\n }", "function savePicture($filepath,$data)\n {\n $file = fopen($filepath,\"w+\");\n fwrite($file,$data);\n fclose($file);\n }", "public function save($file, $image_type = IMAGETYPE_JPEG, $compression = 90, $mode = 0700){\n\n //bring dependant libraries into scope\n global $file_system;\n\n $return = false;\n\n switch ($image_type) {\n case IMAGETYPE_JPEG:\n if(imagejpeg($this->image, $file, $compression)){\n $return = true;\n }\n\n break;\n\n case IMAGETYPE_GIF:\n if(imagegif($this->image, $file, $compression)){\n $return = true;\n }\n\n break;\n\n case IMAGETYPE_PNG:\n if(imagepng($this->image, $file, $compression)){\n $return = true;\n }\n\n break;\n\n }\n\n $file_system->rchmod($file, $mode);\n\n return $return;\n }", "public function writeimg() {\n\t\t$data = Input::all();\n\t\t$img = $data['imgdata'];\n\t\t$student_id = $data['student_id'];\n\t\t$img = str_replace('data:image/png;base64,', '', $img);\n\t\t$img = str_replace(' ', '+', $img);\n\t\t$imgdat = base64_decode($img);\n\t\t$myPublicFolder = public_path();\n\t\t$savePath = $myPublicFolder.\"/photo\";\n\t\t$path = $savePath.\"/$student_id.png\";\n\t\tFile::delete($path);\n\t\tFile::put($path , $imgdat);\n\t\t$last_add = Student::orderby('id', 'desc')->first();\n\t\tStudent::where('student_id', '=', $student_id)->update(array('pic' => \"$student_id.png\"));\n\t\treturn View::make('finish', array('imgid' => Student::where('student_id', '=', $student_id)->firstOrFail()->group));\n\t}", "private function _imgSave(){\r\n\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $img = getimagesize($sourcePath);\r\n $new_name = uniqid();\r\n\r\n switch($img['mime']){\r\n case 'image/png':\r\n $new_name .= '.png';\r\n break;\r\n case 'image/jpeg':\r\n $new_name .= '.jpg';\r\n break;\r\n case 'image/gif':\r\n $new_name .= '.gif';\r\n break;\r\n default:\r\n echo \"Only PNG, JPEG or GIF images are allowed!\";\r\n exit;\r\n }\r\n\r\n $targetPath = ROOT.'/site/files/'.$new_name;\r\n $webPath = WEBROOT.'/site/files/'.$new_name;\r\n\r\n if(rename($sourcePath, $targetPath)){\r\n $result->url = $webPath;\r\n $result->size = [$img[0],$img[1]];\r\n $result->alt = 'an image';\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }", "public function saveImageToUser($image, $user);", "public function saveImage($savePath, $imageQuality = \"100\") {\n switch ($this->ext) {\n case 'image/jpg':\n case 'image/jpeg':\n // Check PHP supports this file type\n if (imagetypes() & IMG_JPG) {\n imagejpeg($this->newImage, $savePath, $imageQuality);\n }\n break;\n\n case 'image/gif':\n // Check PHP supports this file type\n if (imagetypes() & IMG_GIF) {\n imagegif($this->newImage, $savePath);\n }\n break;\n\n case 'image/png':\n $invertScaleQuality = 9 - round(($imageQuality / 100) * 9);\n\n // Check PHP supports this file type\n if (imagetypes() & IMG_PNG) {\n imagepng($this->newImage, $savePath, $invertScaleQuality);\n }\n break;\n }\n\n imagedestroy($this->newImage);\n }", "function save( $format = 'jpg', $filename = NULL, $jpegquality = 100 )\n\t{\n\t\t//if no filename, set up OB to cpature the output\n\t\tif( $filename == NULL )\n\t\t{\n\t\t\t$do_return = true;\n\t\t\tob_start();\n\t\t}\n\t\t\n\t\t//save the image based on supplied format\n\t\tswitch( $format )\n\t\t{\n\t\t\tcase 'jpg':\n\t\t\tcase 'jpeg':\n\t\t\t\t$result = imagejpeg( $this->im, $filename, $jpegquality );\n\t\t\t\tbreak;\n\t\t\tcase 'gif':\n\t\t\t\t$result = imagegif( $this->im, $filename );\n\t\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\t$result = imagepng( $this->im, $filename );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tif( $do_return ) { ob_end_clean(); }\n\t\t\t\tthrow new Exception( 'Image Class: Invalid save format \\''.$format.'\\'' );\n\t\t}\n\t\t\n\t\t//return the image data as needed\n\t\tif( $do_return )\n\t\t{\n\t\t\t$data = ob_get_flush();\n\t\t\treturn $data;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $result;\n\t\t}\n\t}", "public function save($path);", "public function save() {\n\t\t/** @var FieldtypeFile $fieldtype */\n\t\t$fieldtype = $this->field->type;\n\t\treturn $fieldtype->saveFile($this->page, $this->field, $this);\n\t}", "function save($path, $file) {\n // сохраняем миниатюру]\n // создать миниатюру\n // if (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path.'small/small_'.$file)) {\n // return false;\n // }\n // если всё нормально, то\n // сохраняем оригинальный файл\n if(!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path.$file)){\n return false;\n }\n\n // создать миниатюру\n $image = new SimpleImage();\n $image->load($path.$file);\n $image->resize(400, 200);\n $image->save($path.'small/small_'.$file);\n\n return true;\n }", "public function save($filename, $type = false, $quality = 75) {\n\n // Check if we have been sent a file type.\n if (!$type) {\n\n // Attempt to detect the file type from the filename extention.\n $type = substr($filename, -3, 3);\n }\n\n // Detect which type of image we are being asked to output.\n switch (strtolower($type)) {\n case \"png\":\n $result = imagepng($this->current, $filename);\n break;\n case \"gif\":\n $result = imagegif($this->current, $filename);\n break;\n case \"wbmp\":\n $result = imagewbmp($this->current, $filename);\n break;\n case \"xbm\":\n $result = imagexbm($this->current, $filename);\n break;\n case \"jpg\":\n case \"jpeg\":\n default:\n \timageinterlace($this->current, 1);\n $result = imagejpeg($this->current, $filename, $quality);\n break;\n }\n\n // Report on our success.\n return $result;\n }", "function save($show = false)\n {\n if ($show)\n {\n @header('Content-Type: image/' . $this->type);\n }\n \n if (!$this->width && !$this->height) \n {\n $this->width = $this->image_width;\n $this->height = $this->image_height;\n } elseif (is_numeric($this->width) && empty($this->height)) {\n $this->height = round($this->width / ($this->image_width / $this->image_height));\n \n } elseif (is_numeric($this->height) && empty($this->width)) {\n $this->width = round($this->height / ($this->image_height / $this->image_width));\n \n } else {\n if ($this->width <= $this->height) \n {\n $height = round($this->width / ($this->image_width / $this->image_height));\n if ($height != $this->height)\n {\n $percentage = ($this->image_height * 100) / $height;\n $this->image_height = round($this->height * ($percentage / 100));\n }\n } else {\n $width = round($this->height / ($this->image_height / $this->image_width));\n if ($width != $this->width)\n {\n $percentage = ($this->image_width * 100) / $width;\n $this->image_width = round($this->width * ($percentage / 100));\n }\n }\n }\n\n if ($this->crop)\n {\n $this->image_width = $this->width;\n $this->image_height = $this->height;\n }\n\n if ($this->type == 'jpeg')\n {\n $image = imagecreatefromjpeg($this->file);\n }\n \n if ($this->type == 'png')\n {\n $image = imagecreatefrompng($this->file);\n }\n \n if ($this->type == 'gif')\n {\n $image = imagecreatefromgif($this->file);\n }\n \n $new_image = imagecreatetruecolor($this->width, $this->height);\n imagecopyresampled($new_image, $image, 0, 0, \n $this->top, \n $this->left,\n $this->width, \n $this->height, \n $this->image_width,\n $this->image_height);\n\n $name = $show ? null : $this->dir . DIRECTORY_SEPARATOR . $this->name . '.' . $this->ext;\n \n if ($this->type == 'jpeg')\n {\n imagejpeg($new_image, $name, $this->quality);\n }\n \n if ($this->type == 'png')\n {\n imagepng($new_image, $name);\n }\n \n if ($this->type == 'gif')\n {\n imagegif($new_image, $name);\n }\n \n imagedestroy($image);\n imagedestroy($new_image);\n }", "public function save() {\n// is there an image resource and file location to work with?\n if (isset($this->_resource, $this->_file_location)) {\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $this->_file_location);\n break;\n case \"image/png\":\n imagepng($this->_resource, $this->_file_location);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $this->_file_location);\n break;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::save() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }", "public function save( $filename )\n {\n \n }", "public static function save($file)\n {\n //caminho para salvar a imagem\n $target = \"img/prods/\" . $file['name'];\n\n //tipos de arquivos permitidos\n $allowed = ['jpg', 'jpeg', 'png', 'gif'];\n\n //pegando a extensão da imagem passada\n $fileExtension = explode('.', $file['name']);\n $fileExtension = strtolower(end($fileExtension));\n\n //verficação para testar a integridade do arquivo passado\n if ($file['error'] == 0) {\n if ($file['size'] < 7000000) {\n if (in_array($fileExtension, $allowed)) {\n\n //se tudo estiver ok, adicione ele na pasta\n move_uploaded_file($file['tmp_name'], $target);\n }\n }\n }\n }", "function save($filename, $type, $quality) {\r\n return null; //PEAR::raiseError(\"No Save method exists\", true);\r\n }", "public function saveimageAction()\n {\n $response = $this->getResponse();\n\n $userid= $this->params()->fromPost('userid');\n $createdTime= $this->params()->fromPost('createdtime');\n $imageType = $this->params()->fromPost('imagetype');\n $imageType = substr($imageType, -3, 3);\n $AVAorCOV = $this->params()->fromPost('albumtype');\n\n $documentService = $this->getDocumentService();\n\n $successModel = new SuccessModel();\n $result = $successModel->saveNewImageAvatar($userid, $createdTime,$documentService, $imageType, $AVAorCOV );\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }", "private function intern_save ($targetPath = null)\n\t{\n\t\tif ($this->newImage == null) $this->newImage = $this->srcImage;\n\n\t\tif ($targetPath == null) $targetPath = $this->srcPath;\n\t\telse\n\t\t{\n\t\t\tif (Pathfinder::isAbsolute($targetPath)) $targetPath = $targetPath;\n\t\t\t$targetPath = $this->dataRootPath . $this->getRelativePath($targetPath);\n\t\t}\n\n\t\t// create folders if necessary\n\t\t$this->setUpFolder($targetPath);\n\t\t// remove file from folder with same name\n\t\t$this->intern_removePrevious($targetPath);\n\n\t\t// save\n\t\tswitch($this->srcInfo['extension']) {\n\t\t\tcase 'jpg':\n\t\t\tcase 'jpeg':\n\t\t\t\timagejpeg ( $this->newImage, $targetPath);\n\t\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\timagepng ( $this->newImage, $targetPath);\n\t\t\t\tbreak;\n\t\t\tcase 'gif':\n\t\t\t\timagegif ( $this->newImage, $targetPath);\n\t\t}\n\t\t$this->intern_end();\n\t}", "public function saveImage($filename)\n\t{\n\t\timagejpeg( $this->im, \"$filename\", $this->cq );\n\t}", "public function saveImage($fid) {\n $file_usage = \\Drupal::service('file.usage');\n $file = File::load( $fid );\n\n if ($file) {\n\n // set file status permanent\n if(!$file->isPermanent()){\n $file->setPermanent();\n }\n\n // check file usage , if it's empty, add new entry\n $usage = $file_usage->listUsage($file);\n\n if(empty($usage)){\n // let's assume it's image\n $file_usage->add($file,'vegas','image',$fid);\n }\n\n $file->save();\n }\n }", "public function save($target,$file_name)\n\t{\n\t\tif(!$this->_target) return $this->copy($target,$file_name);\n\t\t\n\t\t$path = $this->_prepare_path($target, $file_name); \n\t\t\n\t\tswitch($this->type){\n\t\t\t\tcase IMAGE_TYPE_PNG : imagepng($this->source, $path); break;\n\t\t\t\tcase IMAGE_TYPE_JPG : imagejpeg($this->source, $path); break;\n\t\t\t\tcase IMAGE_TYPE_GIF : imagegif($this->source,$path); break;\n\t\t}\n\t\t\n\t\t\n\t\t\n\n\t}", "public function saveStickerToImage()\n {\n $this->sticker->saveToS3($this->stickerDir . $this->getDriverLogoImageName());\n }", "function save($path, $file) {\n $input = fopen(\"php://input\", \"r\");\n $temp = tmpfile();\n $realSize = stream_copy_to_stream($input, $temp);\n fclose($input);\n\n if ($realSize != $this->getSize()){\n return false;\n }\n\n\n $target = fopen($path.$file, \"w\");\n fseek($temp, 0, SEEK_SET);\n stream_copy_to_stream($temp, $target);\n fclose($target);\n\n // создать миниатюру\n $image = new SimpleImage();\n $image->load($path.$file);\n $image->resizeToHeight(200);\n $image->save($path.'small/small_'.$file);\n ;\n\n return true;\n }", "public function saveFile()\n {\n $newFileName = $this->generateFilename();\n $this->getOwner()->setAttribute($this->attributeName, $newFileName);\n return $this->uploadManager->save($this->getUploadedFileInstance(), $this->getUploadPath(), $newFileName);\n }", "public function saveToFile($name = null)\n {\n // Self Generate File Location\n if (!$name) {\n $name = uniqid() . '.png';\n }\n // Save to File\n file_put_contents($name, base64_decode($this->getImage()));\n return $name;\n }", "public function save($path = 'barcode.png')\n {\n $dir = dirname($path);\n if (!file_exists($dir)) {\n mkdir($dir, 0644, true);\n }\n imagepng($this->_image, $path);\n }", "public function saveAs(string $path): void;", "function imageSaveToFile($file,$quality=0)\n {\n if ($quality == 0) $quality = $this->quality;\n\n if (count($this->error) == 0)\n {\n // no errors, try to save image\n if ($this->imgType == 'gif') $saved = imagegif($this->imgSrc,$file);\n if ($this->imgType == 'jpg') $saved = imagejpeg($this->imgSrc,$file,$quality);\n if ($this->imgType == 'png') $saved = imagepng($this->imgSrc,$file);\n\n if (!$saved)\n {\n // image was not written\n $this->error[] = 'InstantImage: cannot write image to file';\n return false;\n }\n else\n {\n $this->fileToFlush = $file;\n return true;\n }\n }\n else\n {\n // errors, doesn't make sense to save the wrong image\n $this->error[] = 'InstantImage: do not save the image because of errors';\n return false;\n }\n }", "public function saveTo(string $path);", "private function saveAsImage($url, $file, $path,$filename)\n {\n $resource = fopen($path . $filename, 'a');\n fwrite($resource, $file);\n fclose($resource);\n }", "function save ($input) {\r\n // Do your processing\r\n // Save to database of something\r\n //processin here cuz\r\n\r\n// $fp = fopen('images/test.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $input); \r\n// fclose($fp);\r\n\r\n// $fp = fopen('images/len.txt', 'w');//opens file in append mode \r\n// fwrite($fp, strlen($input)); \r\n// fclose($fp);\r\n\r\n $img = str_replace('data:image/png;base64,', '', $input);\r\n $img = str_replace(' ', '+', $img);\r\n\r\n// $fp = fopen('images/img2.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $img); \r\n// fclose($fp);\r\n\r\n $fileData = base64_decode($img);\r\n file_put_contents('images/photo.png',$fileData);\r\n return true;\r\n}", "public function getSavePath() {\n return $this->__imageSavePath;\n }", "public function save($file=null, $quality=null);", "function saveImage($imgurl)\n\t{\n\t\t$name = basename($imgurl);\n\t\tlist($txt, $ext) = explode(\".\", $name);\n\t\t$name = $txt.time();\n\t\t$name = $name.\".\".$ext;\n\t//check if the files are only image / document\n\t\tif($ext == \"jpg\" or $ext == \"png\" or $ext == \"gif\" or $ext == \"doc\" or $ext == \"docx\" or $ext == \"pdf\"){\n\t\t$upload = file_put_contents($path . \"/wp-contents/uploads/\".$name,file_get_contents($imgurl));\n\t\t//check success\n\t\treturn $upload;\n\t\t}\n\t}", "public function saveProduct($img, $request) {\n \n $extension = $img->getClientOriginalExtension();\n \n if ($request->hasFile('file')) {\n $image = $request->file('file')->store('public/profile');\n } else {\n $image = \"\";\n }\n return $image; \n }", "public function save()\n {\n if ($this->createDirectoryStructure($this->getPath())) {\n $content = $this->generateContents();\n file_put_contents($this->getPathname(), $content);\n }\n }", "protected function saveImageFile($data) {\t\t\n\t\t\n\t\t$imginfo = getimagesize($data['tmp_name']);\n\t\t\n\t\t// move the uploaded file into album directory\n\t\t$this->setOriginalFilename($data['name']);\n\t\t$filename = $this->getFilenameOnFilestore();\n\t\t$result = move_uploaded_file($data['tmp_name'], $filename);\n\t\tif (!$result) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public function save()\n {\n App::cliLog(\"Saving to $this->format file\", false);\n\n try {\n call_user_func([$this, 'export' . ucfirst($this->format)]);\n } catch (Exception $e) {\n App::cliLog($e->getMessage());\n }\n }", "public function saving(Model $model)\n {\n $file_name = $model->getAttribute($this->image_attribute_name);\n if (\n (!$file_name) ||\n (!Storage::has($this->getNormalPath(2, $file_name)))\n ) {\n if (\n (Storage::has(\"public/application/{$this->default_image_name}\")) &&\n (!Storage::has($this->getNormalPath(2, $this->default_image_name)))\n ) {\n try {\n /** @var Image $image */\n $image = ImageFacade::make(storage_path(\"app/public/application/{$this->default_image_name}\"));\n $this->loadMultipleImages([$image]);\n $this->saveImages();\n } catch (\\RuntimeException $exception) {\n logger($exception->getMessage());\n }\n }\n $model->setAttribute($this->image_attribute_name, $this->default_image_name);\n }\n }", "public function saveFileToPage() {\n if(!$this->savePage || !$this->saveField) {\n throw new WireException('You must define the savePage and saveField options before trying to save an image field');\n }\n\n $value = $this->value;\n // Move attachment into its own temp/quarantined folder so we can give it a nice file name\n if (is_array($value['tmp_name'])) {\n foreach($value['tmp_name'] as $key => $tempName) {\n $this->addFileToField($value['name'][$key], $tempName);\n }\n } else {\n $this->addFileToField($value['name'], $value['tmp_name']);\n }\n $this->value = $this->savePage->getUnformatted($this->saveField);\n }", "protected function save_image( $image, $file_index, $dir = null, $prefix = '', $output_type = null ) {\r\n\t\t\t// if output type is not set, its the same as the input type\r\n\t\t\tif ( !$output_type ) {\r\n\t\t\t\t$output_type = $this->Files_ready[ $file_index ]['ext'];\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( !empty( $prefix ) ) {\r\n\t\t\t\t// append the prefix to the savename\r\n\t\t\t\t$savename = substr( $this->Files_ready[ $file_index ]['savename'], 0, strrpos( $this->Files_ready[ $file_index ]['savename'], '.' ) ) . $prefix . '.' . $output_type; \r\n\t\t\t} else {\r\n\t\t\t\tif ( $this->Files_ready[ $file_index ]['ext'] !== $output_type ) {\r\n\t\t\t\t\t// change the extension\r\n\t\t\t\t\t$savename = str_replace( $this->Files_ready[ $file_index ]['ext'], $output_type, $this->Files_ready[ $file_index ]['savename'] );\r\n\t\t\t\t} else{\r\n\t\t\t\t\t$savename = $this->Files_ready[ $file_index ]['savename'];\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// set the directory and output path\r\n\t\t\tif ( $dir ) {\r\n\t\t\t\t$output_path = $dir . $savename;\r\n\t\t\t\t$dir = rtrim( $dir, '/' );\r\n\t\t\t} else {\r\n\t\t\t\t$dir = substr( $this->Files_ready[ $file_index ]['path'], 0, strrpos( $this->Files_ready[ $file_index ]['path'], '/' ) );\r\n\t\t\t\t$output_path = $dir . '/' . $savename;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// only save the File when no prefix is given\r\n\t\t\tif ( empty( $prefix ) ) {\r\n\t\t\t\t$this->Files_ready[ $file_index ]['path'] = $output_path;\r\n\t\t\t\t$this->Files_ready[ $file_index ]['dirname'] = $dir;\r\n\t\t\t\t$this->Files_ready[ $file_index ]['savename'] = $savename;\r\n\t\t\t\t$this->Files_ready[ $file_index ]['ext'] = $output_type;\r\n\t\t\t}\r\n\t\t\r\n\t\t\t// output the image to a file\r\n\t\t\tswitch( $output_type ) {\r\n\t\t\t\tcase 'jpg': { imagejpeg( $image, $output_path ); } break;\r\n\t\t\t\tcase 'gif': { imagegif( $image, $output_path ); } break;\r\n\t\t\t\tcase 'png': { imagepng( $image, $output_path ); } break;\r\n\t\t\t\tcase 'gd': { imagegd( $image, $output_path ); } break;\r\n\t\t\t\tcase 'gd2': { imagegd2( $image, $output_path ); } break;\r\n\t\t\t\tcase 'bmp': { imagebmp( $image, $output_path ); } break;\r\n\t\t\t\tcase 'wbmp': { imagewbmp( $image, $output_path ); } break;\r\n\t\t\t\tcase 'webp': { imagewebp( $image, $output_path ); } break;\r\n\t\t\t\tcase 'xbm': { imagexbm( $image, $output_path ); } break;\r\n\t\t\t\tdefault: throw new Exception( 'GD extension cannot create an image from this image type (\"' . htmlspecialchars( $output_type ) . '\")' ); \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// destroy the image ressource to free the ram\r\n\t\t\timagedestroy( $image );\r\n\t\t}", "public function save($img, $pathToSave): string\n {\n $fileName = $this->getHash();\n $fullFileName = $this->generatePath($fileName, $pathToSave);\n\n if ($this->saving($fullFileName, $img)) {\n return $fileName;\n }\n return 'false';\n }", "public function saveToFile($file)\n {\n \n }", "public function saveImage($targetPath = null)\n\t{\n\t\t$this->intern_save($targetPath);\n\t}", "function we_save($resave = 0) {\n\n\t\t// get original width and height of the image\n\t\t$arr = $this->getOrigSize(true, true);\n\t\t$this->setElement(\"origwidth\",isset($arr[0]) ? $arr[0] : 0);\n\t\t$this->setElement(\"origheight\",isset($arr[1]) ? $arr[1] : 0);\n\t\t$docChanged = $this->DocChanged; // will be reseted in parent::we_save()\n\t\tif (parent::we_save($resave)) {\n\t\t\tif($docChanged){\n\t\t\t\t$thumbs = $this->getThumbs();\n\t\t\t\tinclude_once($_SERVER[\"DOCUMENT_ROOT\"].\"/webEdition/we/include/\".\"we_delete_fn.inc.php\");\n\t\t\t\tdeleteThumbsByImageID($this->ID);\n\t\t\t\tif(count($thumbs)){\n\t\t\t\t\tforeach($thumbs as $thumbID) {\n\t\t\t\t\t\t$thumbObj = new we_thumbnail();\n\t\t\t\t\t\t$thumbObj->initByThumbID($thumbID,$this->ID,$this->Filename,$this->Path,$this->Extension,$this->getElement(\"origwidth\"),$this->getElement(\"origheight\"),$this->getDocument());\n\t\t\t\t\t\t$thumbObj->createThumb();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function save_camp_image(){\n\t\n\t\n\t$data = $_POST['data'];\n\tlist($type, $data) = explode(';', $data);\n\tlist(, $data) = explode(',', $data);\n\t$data = base64_decode($data);\t\t\n\t$img_name = 'tshirt'.time().'.png';\n\t\n\t$upload_dir = wp_upload_dir();\t\n\t\n\t$target_path_image = $upload_dir['path'].'/'.$img_name;\n\t\n\tfile_put_contents($target_path_image, $data);\n\t\n\techo json_encode(array('action'=>'done','img'=>$img_name));\t\n\tdie();\n}", "public function save_image($source, $destination, $image_type, $quality){\n switch(strtolower($image_type)){//determine mime type\n case 'image/png':\n imagepng($source, $destination); return true; //save png file\n break;\n case 'image/gif':\n imagegif($source, $destination); return true; //save gif file\n break;\n case 'image/jpeg': case 'image/pjpeg':\n imagejpeg($source, $destination, $quality); return true; //save jpeg file\n break;\n default: return false;\n }\n }", "public final function save() {\n }", "public function save($filename, $content);", "function save_image($inPath, $outPath) {\n $in = fopen ( $inPath, \"rb\" );\n $out = fopen ( $outPath, \"wb\" );\n while ( $chunk = fread ( $in, 8192 ) ) {\n fwrite ( $out, $chunk, 8192 );\n }\n fclose ( $in );\n fclose ( $out );\n}", "function save_image($inPath,$outPath)\n{\n $in= fopen($inPath, \"rb\");\n $out= fopen($outPath, \"wb\");\n while ($chunk = fread($in,8192))\n {\n fwrite($out, $chunk, 8192);\n }\n fclose($in);\n fclose($out);\n}", "private function saveImage($file, $var_image){\n\n //create instance of image from temp upload\n $image = \\Image::make($file->getRealPath());\n\n //save image with thumbnail\n $image->save(public_path() . '/imgs/library/' . $var_image) \n ->resize(200, 200)\n ->save(public_path() . '/imgs/library/thumbnails/thumb-' . $var_image);\n }", "public function export($type = 'jpg', $quality = 50, $path = false) {\n\t\tif(!$this->image) {\n\t\t\ttrigger_error('The image does not exist or is not readable.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\n\t\t// If there is a path, make sure it is a real one.\n\t\tif(!is_null($path)) {\n\t\t\tif($path === false) {\n\t\t\t\t$path = $this->path;\n\t\t\t}\n\n\t\t\t$output_path = pathinfo($path);\n\n\t\t\tif(!$output_path['extension']) {\n\t\t\t\tif(substr($path, -1) !== '/') {\n\t\t\t\t\t$path .= '/';\n\t\t\t\t}\n\t\t\t\t$path .= $this->filename;\n\t\t\t\t$output_path['basename'] = $this->filename;\n\t\t\t}\n\n\t\t\tif(!is_dir($output_path['dirname']) && !is_file($output_path['dirname'])) {\n\t\t\t\tmkdir($output_path['dirname'], 0777, true);\n\t\t\t}\n\t\t}\n\n\t\t// Whether the conversion / output of the image was successful.\n\t\t$save_status = false;\n\n\t\t// Handle output for each type, accounting for whether to output to the screen or a file based on is_null($path).\n\t\tswitch($type) {\n\t\t\tcase 'gif':\n\t\t\t\tif(!is_null($path)) {\n\t\t\t\t\t$path = preg_replace('/(png|jpg|jpeg)$/', 'gif', $path);\n\t\t\t\t} else {\n\t\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\t}\n\t\t\t\t$save_status = imagegif($this->image, $path, round($quality/10));\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\tif(!is_null($path)) {\n\t\t\t\t\t$path = preg_replace('/(gif|jpg|jpeg)$/', 'png', $path);\n\t\t\t\t} else {\n\t\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\t}\n\t\t\t\t$quality = 10-round($quality/10);\n\t\t\t\tif($quality > 9) {\n\t\t\t\t\t$quality = 9;\n\t\t\t\t}\n\t\t\t\tif($quality < 0) {\n\t\t\t\t\t$quality = 0;\n\t\t\t\t}\n\t\t\t\t$save_status = imagepng($this->image, $path, $quality, PNG_FILTER_NONE);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\tcase 'jpeg':\n\t\t\t\tif(!is_null($path)) {\n\t\t\t\t\t$path = preg_replace('/(png|gif)$/', 'jpg', $path);\n\t\t\t\t} else {\n\t\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\t}\n\t\t\t\t$save_status = imagejpeg($this->image, $path, $quality);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\ttrigger_error('The export type is not a valid export type. Use jpg, png, or gif.', E_USER_WARNING);\n\t\t\t\treturn false;\n\t\t\tbreak;\n\t\t}\n\t\tif($save_status) {\n\t\t\treturn $path;\n\t\t} else {\n\t\t\ttrigger_error('The image could not be created.', E_USER_WARNING);\n\t\t\treturn false;\n\t\t}\n\t}", "public function image_save_gd($resource)\n\t{\n\t\tswitch ($this->image_type)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\tif ( ! function_exists('imagegif'))\n\t\t\t\t{\n\t\t\t\t\t$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_gif_not_supported'));\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tif ( ! @imagegif($resource, $this->full_dst_path))\n\t\t\t\t{\n\t\t\t\t\t$this->set_error('imglib_save_failed');\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tif ( ! function_exists('imagejpeg'))\n\t\t\t\t{\n\t\t\t\t\t$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_jpg_not_supported'));\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tif ( ! @imagejpeg($resource, $this->full_dst_path, $this->quality))\n\t\t\t\t{\n\t\t\t\t\t$this->set_error('imglib_save_failed');\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tif ( ! function_exists('imagepng'))\n\t\t\t\t{\n\t\t\t\t\t$this->set_error(array('imglib_unsupported_imagecreate', 'imglib_png_not_supported'));\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\n\t\t\t\tif ( ! @imagepng($resource, $this->full_dst_path))\n\t\t\t\t{\n\t\t\t\t\t$this->set_error('imglib_save_failed');\n\t\t\t\t\treturn FALSE;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->set_error(array('imglib_unsupported_imagecreate'));\n\t\t\t\treturn FALSE;\n\t\t\tbreak;\n\t\t}\n\n\t\treturn TRUE;\n\t}", "public function saveAction()\n {\n $data = $this->getRequest()->getPost();\n if ($data) {\n try {\n if (isset($data['image']['delete'])) {\n $data['image'] = '';\n } else {\n unset($data['image']);\n\n if (isset($_FILES)) {\n if ($_FILES['image']['name']) {\n if ($this->getRequest()->getParam('id')) {\n $model = Mage::getModel('pugnet_uploader/images')->load($this->getRequest()->getParam('id'));\n if ($model->getData('image')) {\n $io = new Varien_Io_File();\n $io->rm(Mage::getBaseDir('media') . DS . implode(DS, explode('/', $model->getData('image'))));\n }\n }\n $path = Mage::getBaseDir('media') . DS . 'uploader' . DS . 'images' . DS;\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(['jpg', 'png', 'gif']);\n $uploader->setAllowRenameFiles(false);\n $uploader->setFilesDispersion(false);\n $destFile = $path . $_FILES['image']['name'];\n $filename = $uploader->getNewFileName($destFile);\n $uploader->save($path, $filename);\n\n $data['image'] = 'uploader/images/' . $filename;\n }\n }\n }\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirectReferer();\n }\n\n try {\n $model = Mage::getModel('pugnet_uploader/images')\n ->addData($data)\n ->setId($this->getRequest()->getParam('id'))\n ->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image was successfully saved'));\n Mage::getSingleton('adminhtml/session')->setItemsData(false);\n $this->_redirectReferer();\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setItemsData($this->getRequest()->getPost());\n $this->_redirectReferer();\n }\n }\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image has not been saved'));\n $this->_redirectReferer();\n }", "static function save($path) {\n \t\n\t\tif(exif_imagetype($_FILES['qqfile']['tmp_name']) == IMAGETYPE_JPEG){\n\t\t\t\n $exif = exif_read_data($_FILES['qqfile']['tmp_name']);\n $ort = isset($exif['Orientation']) ? $exif['Orientation'] : null ;\n $mustRotate = 0;\n $angle = 0;\n\t\t\t\n switch($ort)\n {\n case 3: // 180 rotate left\n $angle = 180;\n $mustRotate = 1;\n break;\n case 6: // 90 rotate right\n $angle = 90;\n $mustRotate = 1;\n break;\n case 8: // 90 rotate left\n $angle = -90;\n $mustRotate = 1;\n break;\n }\n if ($mustRotate){\n $imagick = new \\Imagick();\n $imagick->readImage(realpath($_FILES['qqfile']['tmp_name']));\n $imagick->rotateimage(new \\ImagickPixel(), $angle);\n $imagick->stripImage();\n $imagick->setImageFormat (\"jpeg\");\n if (!$imagick->writeImage($path)) {\n return false;\n }\n } else {\n\t\t\t\t\n if (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path))\n return false;\n }\n } else {\n\t\t\t\n \t\tif (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path)) {\n \treturn false;\n \t\t}\n }\n return true;\n }", "function local_avatars_save_image($user_id, $tmp_image_path, $original_filename = false, $type = false){\n\tlocal_avatars_get_plugin()->file_handler->save_image($user_id, $tmp_image_path, $original_filename, $type);\n}", "function saveResizedImage($format,$imgData,$resizedFilename){\n \tswitch( $format ){\n\t\tcase 1:\n\t\timagegif($imgData, $resizedFilename);\n\t\tbreak;\n\t\tcase 2:\n\t\timagejpeg($imgData, $resizedFilename, 75);\n\t\tbreak;\n\t\tcase 3:\n\t\timagepng($imgData, $resizedFilename, 1);\n\t}\n}", "public function saveFile($file, $file_name, $width = 0, $height = 0)\n {\n // load the image\n $image = new \\UploadImage();\n $image->load($file['tmp_name'], $this->type);\n if ($width != 0 && $height != 0) {\n $image->resize($width, $height);\n }\n $path = \"img/\" . date(\"Y\") . \"/\" . $this->type . \"/\" . $file_name . $image->FileExtension($file[\"type\"]);\n $config = \\Phalcon\\Di::getDefault()->getShared('configuration');\n $image->save(\n $config->imgPath. \"\" . date(\"Y\") . \"/\" . $this->type . \"/\" . $file_name . $image->FileExtension($file[\"type\"])\n );\n $this->image = $path;\n $this->save();\n }", "public function saveToFile() {\n\n $file = $this->getExtractedFile();\n\n $file->close();\n\n $this->extractedFile = false;\n }", "function OnPostForm()\n {\n $this->SaveFile(\"siteCoatUser\", Array(\"extensions\" => \"gif,jpg,jpeg,png\", \"max_height\" => 139, \"max_width\" => 139, \"make_preview\" => \"N\"));\n }", "public function saveImage($img,$folder){\n\n $file_extension = $img->getClientOriginalExtension();\n $file_name = time().'.'.$file_extension;\n $path = $folder;\n $img->move($path,$file_name);\n return $file_name;\n }", "function savefile($sFileName = null)\n\t{\n\t\tif ((isset($sFileName)) && ($sFileName != '')) {\n\t\t\t$this->setLocations($sFileName);\n\t\t}\n\n\t\t$this->saveImage();\n\t}" ]
[ "0.8050701", "0.79795957", "0.7854442", "0.7358189", "0.7263262", "0.720171", "0.7134128", "0.71107423", "0.70981276", "0.7076092", "0.7073501", "0.6989685", "0.68368596", "0.6827663", "0.6791453", "0.6783745", "0.67787135", "0.67497045", "0.6679937", "0.66725683", "0.6664818", "0.6644866", "0.6630739", "0.6621668", "0.6572066", "0.65539", "0.6510593", "0.6465206", "0.6458521", "0.64426565", "0.64317906", "0.64148545", "0.6407314", "0.64005464", "0.6385007", "0.63739115", "0.6332507", "0.631085", "0.63064826", "0.6293922", "0.62934035", "0.6290855", "0.62760633", "0.6272484", "0.6265682", "0.62648326", "0.6258855", "0.6258205", "0.6252847", "0.6251168", "0.6198357", "0.6194405", "0.6190168", "0.6186803", "0.6168998", "0.61657566", "0.6160133", "0.6158514", "0.6143681", "0.6143286", "0.6137109", "0.6127111", "0.6120072", "0.6119564", "0.6112024", "0.6102751", "0.60965043", "0.6076232", "0.6073439", "0.60583276", "0.60461783", "0.6039029", "0.6026807", "0.6021987", "0.6015893", "0.60049826", "0.5985669", "0.5979825", "0.5978028", "0.59758407", "0.5955367", "0.5954578", "0.5953887", "0.5946445", "0.5912171", "0.5909981", "0.5909476", "0.5909015", "0.59082794", "0.590753", "0.5904563", "0.5894561", "0.5888876", "0.58851045", "0.5863164", "0.5844157", "0.58359945", "0.5835499", "0.58284605", "0.5811481", "0.5807366" ]
0.0
-1
Map Body from XML ap newsroom
public function mapNitfField(&$entity, $field, $item_data) { $field_name = $field['id']; if(isset($item_data['data']['item']['renditions']['nitf'])) { $href = $item_data['data']['item']['renditions']['nitf']['href']; $xml_data = $this->apNewsroomContent->getNitfByUrl($href); // parse xml string $xml_data = simplexml_load_string($xml_data); $body = $xml_data->body->{'body.content'}->asXML(); if($body && $entity->hasField($field_name)) { $entity->$field_name->appendItem($body); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getBodyContent() {}", "public function getBody() {\n return $this->get('body', 'news');\n }", "abstract public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody();", "public function getBody() {}", "function xmlbody(){\n\t\t$this->xm(\"<generalinfo>\");\n\t\t$this->p(\"name\",$_SERVER['SERVER_NAME']);\n\t\t$this->p(\"ip_addr\",$_SERVER['SERVER_ADDR'].\":\".$_SERVER['SERVER_PORT']);\n\t\t$this->p(\"host\", $_ENV['HOSTNAME']);\n\t\t$this->p(\"certauth\",$_SERVER['SSL_SERVER_S_DN_OU']);\n\t\t$this->p(\"referer\",$_SERVER ['HTTP_REFERER']);\n\t\t$this->p(\"time\",gmstrftime(\"%b %d %Y %H:%M:%S\").\" GMT\");\n\t\t$this->p(\"apache_admin\",$_SERVER['SERVER_ADMIN']);\n\t\t$this->xm(\"</generalinfo>\");\n\n\t\t// get medcommmons parameters about this instance of central\n\t\t$this->xm(\"<mcinfo>\");\n\t\t$this->p(\"sw_version\",$GLOBALS[\"SW_Version\"]);\n\t\t$this->p(\"sw_revision\",$GLOBALS[\"SW_Revision\"]);\n\t\t$this->p(\"db_connection\",$GLOBALS[\"DB_Connection\"]);\n\t\t$this->p(\"db_database\",$GLOBALS[\"DB_Database\"]);\n\t\t$this->p(\"default_repository\", $GLOBALS['Default_Repository']);\n\t\t$this->xm(\"</mcinfo>\");\n\n\t\t// get record counts from interesting tables\n\t\t$this->xm(\"<tableinfo>\");\n\t\t//\t\tz(\"hipaa\");\n\t\t//\tz(\"hipaa_trace\");\n\t\t$this->z(\"user\");\n\t\t// moved these tables to another database, really should reconnect to the other db to get them\n\n\t\t//\t\tz(\"faxstatus\");\n\t\t//\t\tz(\"ccstatus\");\n\t\t//\t\tz(\"emailstatus\");\n\n\t\t$this->xm(\"</tableinfo>\");\n\t\t$count++;\n\t\t//\n\t\t// return outputs\n\t\t//\n\t\t$this->xmfield(\"status\",\"ok\");\n\t}", "public function parse_body()\n\t{\n\t\tforeach ($this->vars AS $key => $value)\n\t\t{\n\t\t\t$this->body = str_replace('{' . $key . '}', $value, $this->body);\n\t\t}\n\n\t\t// Pas de HTML pour MSN / Jabber\n\t\tif ($this->method == NOTIFY_MSN || $this->method == NOTIFY_JABBER)\n\t\t{\n\t\t\t$this->body = preg_replace('#</?[^>]+?>#si', '', $this->body);\n\t\t\t$this->body = str_replace(array(\"\\r\\n\", \"\\r\"), array(\"\\n\", \"\\n\"), $this->body);\n\t\t\t$this->body = str_replace(\"\\n\", \"\\r\\n\", $this->body);\n\n\t\t\tif ($this->method == NOTIFY_JABBER)\n\t\t\t{\n\t\t\t\t$this->body = htmlspecialchars($this->body);\n\t\t\t}\n\t\t}\n\t}", "public function getBodyTag() {}", "function getSESInfo()\n\t{\n\t\t$objDOM = new DOMDocument(); \n\t\t$objDOM->load(\"http://updates.ungahstudios.com/CMS-NEWS/news.xml\");\n\t\t$news = $objDOM->getElementsByTagName(\"news\"); \n\t\t$sesinfo['title']\t=\t\"\";\n\t\t$sesinfo['text']\t=\t\"\";\n\t\t$sesinfo['date']\t=\t\"\";\n\t\tforeach($news as $value ) \n\t\t{ \n\t\t\t$titles = $value->getElementsByTagName(\"title\"); \n\t\t\t$title = $titles->item(0)->nodeValue; \n\t\t\t$sesinfo['title']\t.=\t$title;\n\n\t\t\t$dates = $value->getElementsByTagName(\"date\"); \n\t\t\t$date = $dates->item(0)->nodeValue; \n\t\t\t$sesinfo['date']\t.=\t$date;\n\t\t\t\n\t\t\t$texts = $value->getElementsByTagName(\"text\"); \n\t\t\t$text = $texts->item(0)->nodeValue; \n\t\t\t$sesinfo['text']\t.=\t$text;\n\n\t\t} \n\t\treturn $sesinfo;\n\t}", "function parseBody() {\r\n $count = count($this->body);\r\n for ($i = 0; $i < $count; $i++) {\r\n if ($this->html)\r\n $content.= \"<b>\";\r\n $content .= $this->body[$i][\"key\"] . ': ';\r\n if ($this->html)\r\n $content.= \"</b>\";\r\n if ($this->html)\r\n $content .= nl2br($this->body[$i][\"value\"]) . \"\\n\";\r\n else\r\n $content .= $this->body[$i][\"value\"];\r\n if ($this->html)\r\n $content.= \"<hr noshade size=1>\\n\";\r\n else\r\n $content.= \"\\n\" . str_repeat(\"-\", 80) . \"\\n\";\r\n }\r\n\r\n $this->body = $content;\r\n }", "public function getSitemapBody()\n\t{\n\t\t$result = array(\n\t\t\t'jd_vars' => $this->jd_vars,\n\t\t\t'posts' => $this->JDBlogPost->getAllPosts(),\n\t\t\t'post_changefreq' => 'monthly',\n\t\t\t'post_priority' => '0.5',\n\t\t\t'cache' => true\n\t\t);\n\n\t\treturn $result;\n\t}", "public function getParsedBody();", "public function get_body()\n {\n }", "abstract function getBody() : string;", "function newsstats_parse_feed( $url ) {\n\n $body = netrics_request_data( $url );\n $articles = array();\n $items = array( 'Error: failed newsstats_parse_feed()' );\n\n if ( $body ) {\n $items = newsstats_get_string_between( $body, '<item>', '</item>' );\n\n if ( $items ) {\n\n foreach ($items as $key => $item) {\n $articles[$key]['title'] = newsstats_get_string_between( $item, '<title>', '</title>' );\n $articles[$key]['url'] = newsstats_get_string_between( $item, '<link>', '</link>' );\n if ( 3 > $key ) {\n break;\n }\n\n }\n\n }\n\n }\n\n return $items;\n\n}", "abstract protected function getHtmlBody();", "function frontpage_news_rss($url) {\n $obj = simplexml_load_file($url);\n\n // If an RSS feed:\n if(!empty($obj->channel)) {\n $description = \"description\";\n $pubDate = \"pubDate\";\n $collect = $obj->channel->item;\n // Else an Atom feed\n } else {\n $description = \"content\";\n $pubDate = \"published\";\n $collect = $obj->entry;\n }\n\n foreach($collect as $item) {\n $news .= \"<div style='border:1px solid #CCC;margin:4px;padding:4px;-moz-border-radius-topright:12px;border-radius-topright:12px;'>\n <a href='\".$item->link.\"'>\".$item->title.\"</a><br />\n <span style='font-size:10px;'>\".date(\"h:i A M jS\",strtotime($item->$pubDate)).\"</span>\n <p>\".$item->$description.\"</p></div>\";\n }\n\n return $news;\n}", "function netrics_parse_xml( $xml ) {\n $xml_arr = explode( '<item>', $xml ); // Make array of XML items.\n $month = date( 'Y-m' );\n\n if ( is_array( $xml_arr ) ) {\n\n $items = array();\n array_shift( $xml_arr ); // Remove first element (<channel>).\n foreach ($xml_arr as $key => $item) {\n $items[$key]['url'] = netrics_get_string_between( '<link>', '</link>', $item );\n $items[$key]['title'] = netrics_get_string_between( '<title>', '</title>', $item );\n $items[$key]['date'] = $month;\n if ( 2 <= $key ) { // Need only 3 articles.\n break;\n }\n\n }\n return $items;\n\n } else {\n return false;\n }\n}", "public function getPressAnnouncementBody()\n {\n if ($this->hasPressAnnouncement()) {\n return $this->getXml()->getElementsByTagName('PressAnnouncementBody')->item(0)->nodeValue;\n }\n return null;\n }", "public function getParsedBody() {}", "public function getBody(){\n return $this->body;\n }", "public function getBodyText();", "function get_info_from_xml($xml_a_traiter)\n{\n\t//Création des tableaux\n\t\t$liste_info['message_id'] = array();\n\t\t$liste_info['isrc'] = array();\n\t\t$liste_info['technicalresourcedetailsreference'] = array();\n\t\t$liste_info['audiocodectype'] = array();\n\t\t$liste_info['bitrate'] = array();\n\t\t$liste_info['url'] = array();\t\t\n\t\t$liste_info['fichier_destination'] = array();\t\n\t\t$liste_info['album_grid'] = array();\t\n\t\t\t\n\t//Reading xml file\t\t\n\t\t$xmlContent = file_get_contents($xml_a_traiter);\t\n\t\tif ($xmlContent == \"\") \n\t\t{\n\t\t\techo \"Fichier XML Vide!\" . \"\\n\";\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$tabXML = array();\n\t\t\t$tabXML = xml2array($xmlContent);\t\n\t\t}\n\t//************************************************************************************************************\t\n\t//Récuperation du MessageId\n\t\tif(isset($tabXML['ernm:PurgeReleaseMessage']))\n\t\t\t$liste_info['message_id'] = $tabXML['ernm:PurgeReleaseMessage']['MessageHeader']['MessageId']['value'];\n\t\telse\n\t\t\t$liste_info['message_id'] = $tabXML['ernm:NewReleaseMessage']['MessageHeader']['MessageId']['value'];\n\t//************************************************************************************************************\n\t//For processing the array in the same manner even if there is one or more sub-block\n\t\tif (isset($tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'][0])) \n\t\t{\n\t\t\t//There are several sub-block\n\t\t\t$ProductInfoSoundRecording = null;\n\t\t\t$ProductInfoSoundRecording = $tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'];\n\t\t}\n\t\telse \n\t\t{\n\t\t\t//There is one sub-block\n\t\t\t$ProductInfoSoundRecording = null;\n\t\t\t$ProductInfoSoundRecording[0] = $tabXML['ernm:NewReleaseMessage']['ResourceList']['SoundRecording'];\n\t\t}\n\t\t\n\t//************************************************************************************************************\t\n\t$nb_SoundRecording = count($ProductInfoSoundRecording);\n\tfor($element=0;$element<$nb_SoundRecording;$element++)\n\t{\t\n\t\t$info_track_tmp1['SoundRecording_SoundRecordingId_ISRC'] \t\t\t\t\t\t\t= $ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value'];\n\t\t$info_track_tmp1['SoundRecording_ResourceReference'] \t\t\t\t\t\t\t\t= $ProductInfoSoundRecording[$element]['ResourceReference']['value'];\n\n\t\t//************************************************************************************************************\n\t\t//For processing the array in the same manner even if there is one or more sub-block\t\t\t\n\t\t\tif (isset($ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'][0])) \n\t\t\t{\n\t\t\t\t//There are several sub-block\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = null;\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = $ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'];\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t//There is one sub-block\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails = null;\n\t\t\t\t$ProductInfoTechnicalSoundRecordingDetails[0] = $ProductInfoSoundRecording[$element]['SoundRecordingDetailsByTerritory']['TechnicalSoundRecordingDetails'];\n\t\t\t}\t\t\n\t\t//************************************************************************************************************\n\t\t$nb_TechnicalSoundRecordingDetails = count($ProductInfoTechnicalSoundRecordingDetails);\n\t\t\n\t\tfor($y=0;$y<$nb_TechnicalSoundRecordingDetails;$y++)\n\t\t{\n\t\t\tif(isset($ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value']))\n\t\t\t{\n\t\t\t\tarray_push($liste_info['isrc'],$ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value']);\n\t\t\t\tarray_push($liste_info['technicalresourcedetailsreference'],$ProductInfoTechnicalSoundRecordingDetails[$y]['TechnicalResourceDetailsReference']['value']);\n\t\t\t\tarray_push($liste_info['audiocodectype'],$ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value']);\n\t\t\t\tarray_push($liste_info['bitrate'],$ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value']);\t\t\t\n\t\t\t\tarray_push($liste_info['url'],$ProductInfoTechnicalSoundRecordingDetails[$y]['File']['URL']['value']);\t\t\t\n\t\t\t\tarray_push($liste_info['fichier_destination'],$ProductInfoTechnicalSoundRecordingDetails[$y]['TechnicalResourceDetailsReference']['value'].\"_\".$ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value'].\"_\".$ProductInfoTechnicalSoundRecordingDetails[$y]['BitsPerSample']['value'].\"_\".$ProductInfoSoundRecording[$element]['SoundRecordingId']['ISRC']['value'].\".\".strtolower($ProductInfoTechnicalSoundRecordingDetails[$y]['AudioCodecType']['value']));\t\t\t\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t//************************************************************************************************************\t\n\t\t//For processing the array in the same manner even if there is one or more sub-block\n\t\t\tif (isset($tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'][0])) \n\t\t\t{\n\t\t\t\t//There are several sub-block\n\t\t\t\t$ProductInfoRelease = null;\n\t\t\t\t$ProductInfoRelease = $tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'];\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\t//There is one sub-block\n\t\t\t\t$ProductInfoRelease = null;\n\t\t\t\t$ProductInfoRelease[0] = $tabXML['ernm:NewReleaseMessage']['ReleaseList']['Release'];\n\t\t\t}\n\t\t//************************************************************************************************************\t\n\t\t$nb_Release = count($ProductInfoRelease);\n\t\tfor($element=0;$element<$nb_Release;$element++)\n\t\t{\n\t\t\tif($ProductInfoRelease[$element]['ReleaseType']['value']==\"Album\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"Single\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"Bundle\" or $ProductInfoRelease[$element]['ReleaseType']['value']==\"ClassicalAlbum\")\n\t\t\t{\n\t\t\t\t$liste_info['album_grid'] = $ProductInfoRelease[$element]['ReleaseId']['GRid']['value'];\n\t\t\t\t$liste_info['globaloriginalreleasedate'] = $ProductInfoRelease[$element]['GlobalOriginalReleaseDate']['value'];\n\t\t\t}\n\t\t}\n\t//************************************************************************************************************\n\n\treturn $liste_info;\n}", "private static function provideRSSContent()\n\t{\n\t\treturn simplexml_load_file(self::RSS_FEED_URL);\n\t}", "public function posts()\r\n{\r\n\r\n $data['noticias'] = $this->news->all();\r\n\r\n\r\n return response()->view('www/sitemap',$data)->header('Content-Type', 'text/xml');\r\n\r\n\r\n}", "protected function parseResponse()\n {\n $data = simplexml_load_string($this->body);\n \n $this->data = $data;\n }", "function getBody($uid, $imap) {\r\n\t$body = get_part($imap, $uid, \"TEXT/HTML\");\r\n\t// if HTML body is empty, try getting text body\r\n\tif ($body == \"\") { $body = get_part($imap, $uid, \"TEXT/PLAIN\"); }\r\n\treturn $body;\r\n}", "protected function parseBody(\\SimpleXMLElement $body, array &$data) {\n $data['parsed'] = $body;\n\n $namespaces = $body->getDocNamespaces();\n if (isset($namespaces[''])) {\n // Account for the default namespace being defined and PHP not being able to handle it :(\n $body->registerXPathNamespace('ns', $namespaces['']);\n $prefix = 'ns:';\n } else {\n $prefix = '';\n }\n\n if ($tempXml = $body->xpath(\"//{$prefix}Code[1]\")) {\n $data['code'] = (string) $tempXml[0];\n }\n\n if ($tempXml = $body->xpath(\"//{$prefix}Message[1]\")) {\n $data['message'] = (string) $tempXml[0];\n }\n\n $tempXml = $body->xpath(\"//{$prefix}RequestId[1]\");\n if (empty($tempXml)) {\n $tempXml = $body->xpath(\"//{$prefix}RequestID[1]\");\n }\n if (isset($tempXml[0])) {\n $data['request_id'] = (string) $tempXml[0];\n }\n }", "public function getBody(): string;", "public function getBody(): string;", "public function getBody()\r\n {\r\n // TODO: Implement getBody() method.\r\n }", "abstract public function getDataprotXML();", "public function getBodyAttribute()\n {\n $value = $this->getAttribute('content');\n $format = $this->attributes['format'];\n\n return StoryFormat::driver($format)->parse($value);\n }", "public function parsePageNews()\n {\n $this->pageNews = $this->dom->find('div[class=PageActualites]', 0);\n\n return $this;\n }", "public function getBody()\n {\n // TODO: Implement getBody() method.\n }", "function create_content($title, $body, $link, $uid){\n\t// creating a new object $node and setting its 'type' and uid property\n\t$values = array(\n\t 'type' => 'news',\n\t 'uid' => $uid,\n\t 'status' => 1,\n\t 'comment' => 1,\n\t 'promote' => 0,\n\t);\n\t$entity = entity_create('node', $values);\n\n\t$ewrapper = entity_metadata_wrapper('node', $entity);\n\n\t$ewrapper->title->set($title);\n\n\t$ewrapper->body->set(array('value' => $body));\n\n\t$ewrapper->field_link->set($link);\n\n\t$entity->field_my_date[LANGUAGE_NONE][0] = array(\n\t 'value' => date('Y-m-d H:i:s.'),\n\t 'timezone' => 'UTC',\n\t 'timezone_db' => 'UTC',\n\t );\n\n\t$ewrapper->save();\n}", "function _worx_news_node_info() {\n $items = array(\n 'news' => array(\n 'name' => t('News'),\n 'module' => 'features',\n 'description' => t('Create News articles to keep your visitors up to date with all the new information you have to share with them.'),\n 'has_title' => '1',\n 'title_label' => t('Headline'),\n 'has_body' => '1',\n 'body_label' => t('Article'),\n 'min_word_count' => '0',\n 'help' => '',\n ),\n );\n return $items;\n}", "function filtrarMensage($msg) {\n $INI = strpos($msg, '<?xml');\n $FIN = strpos($msg, ':Envelope>');\n return substr($msg, $INI, ($FIN + strlen(':Envelope>')) - $INI);\n }", "function _ec_news_node_info() {\n $items = array(\n 'news' => array(\n 'name' => t('News'),\n 'module' => 'features',\n 'description' => '',\n 'has_title' => '1',\n 'title_label' => t('Title'),\n 'has_body' => '1',\n 'body_label' => t('Body'),\n 'min_word_count' => '0',\n 'help' => '',\n ),\n 'news_feed' => array(\n 'name' => t('News Feed'),\n 'module' => 'features',\n 'description' => t('Feed which generates nodes of type \"news\". It is created by the \"master\" importer and contains a link to the remote news feed at the Master Template.'),\n 'has_title' => '1',\n 'title_label' => t('Title'),\n 'has_body' => '0',\n 'body_label' => '',\n 'min_word_count' => '0',\n 'help' => '',\n ),\n );\n return $items;\n}", "private function _populateNews()\n {\n return $this->news->create(\n $this->newsData['title'], \n $this->newsData['content'], \n $this->newsData['created_by']\n );\n }", "function ting_openformat_feed_set_rss_items($xml,$query) {\n $items = ting_openformat_feed_parse_result($xml);\n $title = $query;\n $description = t('feed_from_bibliotek',array(),array('context'=>'feeds'));\n $url = url(NULL, array('absolute'=>TRUE));\n $link = $url;\n if(empty($items)){\n return NULL;\n }\n return theme('ting_openformat_rss_feed', array('items' => $items, 'title' => $title, 'description' => $description, 'link' => $link));\n}", "public function parse();", "public function parse();", "public function parse();", "public static function newSitemapDocument()\n {\n return simplexml_load_string('<?xml version=\"1.0\" encoding=\"UTF-8\"?>' .\n '<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" />');\n }", "public function index()\n {\n $error = \"\";\n $url = \"http://feeds.skynews.com/feeds/rss/uk.xml\";\n try{\n $xml = simplexml_load_file($url);\n \n for($i = 0; $i <= $xml->channel->item->count(); $i++){\n news::updateOrCreate(['title' => !empty($xml->channel->item[$i]->title)?$xml->channel->item[$i]->title:\"\",\n 'link' => !empty($xml->channel->item[$i]->link)?$xml->channel->item[$i]->link:\"\",\n 'description' => !empty($xml->channel->item[$i]->description)?$xml->channel->item[$i]->description:\"\",\n 'pubdate' => !empty($xml->channel->item[$i]->pubDate)?$xml->channel->item[$i]->pubDate:\"\",\n 'media' => !empty($xml->channel->item[$i]->enclosure['url'])?$xml->channel->item[$i]->enclosure['url']:\"\"\n ]);\n }\n }catch(\\Exception $e){\n $error = $e->getMessage().\"at line \".$e->getLine();\n }\n $news = news::orderBy('pubdate','desc')->get();\n return view('news',['news'=>$news,'error'=>$error]);\n }", "function contents($parser, $data){\n global $current_tag, $xml_picture_key, /*$xml_name_key, $xml_size_key,*/ $xml_link_key, $counter, $featured_array;\n switch($current_tag){\n case $xml_picture_key:\n $featured_array[$counter]->picture = $data;\n break;\n /*case $xml_name_key:\n $featured_array[$counter]->name = $data;\n break;\n\t\t\tcase $xml_size_key:\n $featured_array[$counter]->size = $data;\n break;*/\n case $xml_link_key:\n $featured_array[$counter]->link = $data;\n $counter++;\n break;\n }\n }", "public function getBodyObject()\r\n {\r\n }", "public function body() { return $this->_m_body; }", "public function body() { return $this->_m_body; }", "function http_get_body(){\n\n // read content from body\n $content = file_get_contents('php://input');\n\n // check content encoding\n switch(http_get_content_encoding()){\n\n // json content encoding\n case \"json\": {\n\n // return content as json\n return json_decode($content);\n }\n\n // xml content encoding\n case \"xml\": {\n\n // return content as xml\n return new SimpleXMLElement($content);\n }\n }\n}", "protected function getSystemNews() {}", "protected function getBodyTagAttributes() {}", "protected function getBodyTagAttributes() {}", "protected function getBodyTagAttributes() {}", "public function arrayfromtags() {\n\t\t$item = array();\n\t\t// Find all article blocks\n\t\tforeach($this->_html->find('div#col_a') as $article) {\n\t\t\t$item['name'] = $article->find('strong', 0)->plaintext;\n\t\t\t$item['ville'] = $article->find('li.ville', 0)->plaintext;\n\t\t\t$item['adresse'] = $article->find('li.adresse', 0)->plaintext;\n\t\t\t$item['next'] = \"next\";\n\t\t}\n\t\t$articles[] = $item;\n\t\t//print_r($articles);\n\t\tforeach ($articles as $value) {\n\t\t\tarray_push($_SESSION['mail_list'], $value);\n\t\t}\n\t\t\n\t}", "function rssreader_last5news($where, $who, $site) {\r\n\t$module = 'rssreader';\r\n\t$data = html_entity_decode( file_get_contents( $site ) );\r\n\t//$data = mb_convert_encoding( $data, 'utf-8', 'utf-8,iso-8859-1,iso-8859-15' );\r\n\t$data = mb_convert_encoding( $data, 'utf-8' );\r\n\t$data = utf8_decode( $data );\r\n\t$data = str_replace('&','&amp;',str_replace('&amp;','&',$data));\r\n\t$data = preg_replace('#<([^@ :/?]+@[^>]+)>#i','\"$1\"',$data);\r\n\t$data = preg_replace('#<([^@ :/?]+) at ([^@ :/?]+) dot ([^>]+)>#i','\"$1@$2.$3\"',$data);\r\n\t$data = preg_replace('#<([^@ :/?]+) at ([^>]+)>#i','\"$1@$2.$3\"',$data);\r\n\t$valid = true;\r\n\ttry {\r\n\t\t$dom = $GLOBALS['modules'][$module]['functions']['XmlLoader']( $data );\r\n\t}\r\n\tcatch( DOMException $e ) {\r\n\t\tprint($e.\"\\n\");\r\n\t\t$valid = false;\r\n\t}\r\n\tif( $valid === false ) {\r\n\t\tsay( $where, $who, 'xml non valide' );\r\n\t\treturn false;\r\n\t}\r\n\t$allitems = $dom->getElementsByTagName( 'item' );\r\n\tfor($i = 0 ; $i < 5 && $i < $allitems->length ; $i++) {\r\n\t\tsay( $where, $who, $allitems->item( $i )->getElementsByTagName( 'title' )->item( 0 )->nodeValue . \"\\r\\n\" );\r\n\t}\r\n\treturn true;\r\n}", "abstract public function getRequestBody();", "function getBody() {\n\t\treturn $this->getData('body');\n\t}", "function getBody() {\n\t\treturn $this->getData('body');\n\t}", "function tidy_get_body(tidy $object) {}", "function getValues($url)\r\n {\r\n $ch = curl_init();\r\n curl_setopt($ch,CURLOPT_URL,$url);\r\n curl_setopt($ch, CURLOPT_POST, false);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $html = curl_exec($ch);\r\n curl_close($ch);\r\n \r\n $DOM=new DOMDocument;\r\n libxml_use_internal_errors(true);\r\n $DOM->loadHTML($html);\r\n $elements=$DOM->getElementsByTagName('p');\r\n $titles=$DOM->getElementsByTagName('title');\r\n\r\n //For Title\r\n for ($i=0; $i < $titles->length; $i++) { \r\n # code...\r\n $s3[$i]=$titles->item($i)->nodeValue;\r\n }\r\n\r\n $title = implode(\"\",$s3); \r\n \r\n if($title == 'The Nation')\r\n {\r\n $title = 'Image News!';\r\n }\r\n\r\n \r\n // For Image\r\n $string_file=file_get_contents($url);\r\n preg_match('/ <img itemprop=\"image\" id=\"news_detail_img_thumb\" name=\"news_detail_img_thumb\" border=\"0\" src=\"(.*?).jpg\" alt=\"epaper\" \\/> / ', $string_file,$img);\r\n \r\n if(!isset($img[0]))\r\n {\r\n preg_match('/ <img id=\"news_detail_img_thumb\" name=\"news_detail_img_thumb\" border=\"0\" src=\"(.*?).jpg\" alt=\"epaper\" \\/> / ', $string_file,$img2);\r\n $image_temp=$img2[0];\r\n }\r\n else\r\n {\r\n $image_temp=$img[0];\r\n }\r\n\r\n $doc = new DOMDocument();\r\n $doc->loadHTML($image_temp);\r\n $imageTags = $doc->getElementsByTagName('img');\r\n $image=\"\";\r\n foreach($imageTags as $images) {\r\n $image = $images->getAttribute('src');\r\n }\r\n \r\n\r\n // For Content\r\n $s = array();\r\n \r\n for ($i=0; $i < $elements->length; $i++) { \r\n # code...\r\n if(preg_match('/[^NIPCO House, 4 - Shaharah e Fatima Jinnah,lahore, Pakistan Tel: +92 42 36367580 | Fax : +92 42 36367005]+/', $elements->item($i)->getAttribute('style'), $match)){\r\n $s[$i] = $elements->item($i)->nodeValue.\" \";\r\n }\r\n }\r\n $content = implode(\"\",$s);\r\n if($content==null)\r\n {\r\n $content = 'No Detailed Content Available! Content is not available in either Newspaper';\r\n }\r\n return array($title,$image,$content);\r\n }", "function lit_rss($fichier,$champs) {\n // on lit le fichier\n if($chaine = @implode(\"\",@file($fichier))) {\n // on explode sur <item>\n $tmp = preg_split(\"/<\\/?\".\"item\".\">/\",$chaine);\n // pour chaque <item>\n for($i=1;$i<sizeof($tmp)-1;$i+=2)\n // on lit les champs demand? <champ>\n foreach($champs as $champ) {\n $tmp2 = preg_split(\"/<\\/?\".$champ.\">/\",$tmp[$i]);\n // on ajoute au tableau\n $tmp3[$i-1][] = @$tmp2[1];\n }\n // et on retourne le tableau\n return $tmp3;\n }\n}", "public function get_contents($params)\n\t{\n\t\t$data = array();\n\t\t$theVillaData = new DOMDocument();\n\t\t$xcache = VILLA_XML_PATH.$params['theme'].'/'.$params['cacheName'].'.xml.cache';\n\t\t$theVillaData->load($xcache);\n\t\t\n\t\t/* \n\t\t\tStart Parse XML Data \n\t\t*/\n\t\t\n\t\t/* Check if content is for mobile or for desktop site */\n\t\tif( !$params['ismobile'] ): /* Site is desktop/laptop environment */\n\t\t\t$villaData = $theVillaData->getElementsByTagName('Content');\n\t\t\t$d = 0;\n\t\t\tforeach ($villaData as $vData):\n\t\t\t\t$data[$d]['pageTitle'] = $vData->getAttribute('desc');\n\t\t\t\t$data[$d]['contentid'] = $vData->getAttribute('contentid');\n\t\t\t\t$data[$d]['contenttypeid'] = $vData->getAttribute('contenttypeid');\n\t\t\t\t$data[$d]['desc'] = (string) trim(html_entity_decode($vData->getElementsByTagName('Description')->item(0)->nodeValue));\n\t\t\t\t$villaSubContents = $vData->getElementsByTagName('SubContent');\n\t\t\t\t$s = 0;\n\t\t\t\tforeach ($villaSubContents as $subContents):\n\t\t\t\t\t$data[$d]['SubContents'][$s]['Heading'] = (string) trim($subContents->getElementsByTagName('Heading')->item(0)->nodeValue);\n\t\t\t\t\t$data[$d]['SubContents'][$s]['Description'] = (string) trim(html_entity_decode($subContents->getElementsByTagName('Description')->item(0)->nodeValue));\n\t\t\t\t\t$pageImages = $subContents->getElementsByTagName('Image');\n\t\t\t\t\t$i = 0;\n\t\t\t\t\tforeach ($pageImages as $pageImage):\n\t\t\t\t\t\t$data[$d]['SubContents'][$s]['Image'][$i]['Caption'] = (string) trim($pageImage->getElementsByTagName('Caption')->item(0)->nodeValue);\n\t\t\t\t\t\t$data[$d]['SubContents'][$s]['Image'][$i]['ThumbSizeUrl'] = (string) trim($pageImage->getElementsByTagName('ThumbSizeUrl')->item(0)->nodeValue);\n\t\t\t\t\t\t$data[$d]['SubContents'][$s]['Image'][$i]['FullSizeUrl'] = (string) trim($pageImage->getElementsByTagName('FullSizeUrl')->item(0)->nodeValue);\n\t\t\t\t\t\t$i++;\n\t\t\t\t\tendforeach;\n\t\t\t\t\t$s++;\n\t\t\t\tendforeach;\n\t\t\t\t$d++;\n\t\t\tendforeach;\n\t\t\t$pageData = $this->xSearch($data, 'contenttypeid', $params['content']);\n\t\t\treturn $pageData;\n\t\telse: /* Site is tablet/mobile environment */\n\t\t\t$mobileData = $theVillaData->getElementsByTagName('ExtraInfo');\n\t\t\tforeach ($mobileData as $mData):\n\t\t\t\t$g = 0;\n\t\t\t\t$mG = array();\n\t\t\t\t$mobileImages = $mData->getElementsByTagName('Images');\n\t\t\t\tforeach ($mobileImages as $mblImages):\n\t\t\t\t\t$mblGallery = $mblImages->getElementsByTagName('Gallery');\n\t\t\t\t\tforeach ($mblGallery as $mi) :\n\t\t\t\t\t\t$Imgs = $mi->getElementsByTagName('Image');\n\t\t\t\t\t\tforeach ($Imgs as $Img):\n\t\t\t\t\t\t\t$mG[$g]['Caption'] = $Img->getElementsByTagName('Caption')->item(0)->nodeValue;\n\t\t\t\t\t\t\t$mG[$g]['ThumbSizeUrl'] = $Img->getElementsByTagName('ThumbSizeUrl')->item(0)->nodeValue;\n\t\t\t\t\t\t\t$mG[$g]['FullSizeUrl'] = $Img->getElementsByTagName('FullSizeUrl')->item(0)->nodeValue;\n\t\t\t\t\t\t\t$g++;\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\n\t\t\t\t$data['VillaName'] = $mData->getElementsByTagName('VillaName')->item(0)->nodeValue;\n\t\t\t\t$data['SubLocation'] = $mData->getElementsByTagName('SubLocation')->item(0)->nodeValue;\n\t\t\t\t$data['Location'] = $mData->getElementsByTagName('Location')->item(0)->nodeValue;\n\t\t\t\t$data['Country'] = $mData->getElementsByTagName('Country')->item(0)->nodeValue;\n\t\t\t\t$data['ShortDesc'] = (string) trim(html_entity_decode($mData->getElementsByTagName('ShortDesc')->item(0)->nodeValue));\n\t\t\n\t\t\t\t$gpsCoordinates = $mData->getElementsByTagName('GPSCoordinates');\n\t\t\t\tforeach ($gpsCoordinates as $gps):\n\t\t\t\t\t$data['contenttypeid'] = $gps->getAttribute('contenttypeid');\n\t\t\t\t\t$decimal = $gps->getElementsByTagName('Decimal');\n\t\t\t\t\tforeach ($decimal as $value):\n\t\t\t\t\t\t$data['Latitude'] = $value->getElementsByTagName('Latitude')->item(0)->nodeValue;\n\t\t\t\t\t\t$data['Longitude'] = $value->getElementsByTagName('Longitude')->item(0)->nodeValue;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\n\t\t\t\t$rooms = $mData->getElementsByTagName('Rooms');\n\t\t\t\tforeach ($rooms as $room):\n\t\t\t\t\t$rm = $room->getElementsByTagName('Room');\n\t\t\t\t\tforeach ($rm as $r):\n\t\t\t\t\t\t$data['RoomName'] = $r->getElementsByTagName('RoomName')->item(0)->nodeValue;\n\t\t\t\t\t\t$data['MinRate'] = $r->getElementsByTagName('MinRate')->item(0)->nodeValue;\n\t\t\t\t\t\t$data['MaxRate'] = $r->getElementsByTagName('MinRate')->item(0)->nodeValue;\n\t\t\t\t\tendforeach;\n\t\t\t\tendforeach;\n\t\t\tendforeach;\n\t\t\t$data['mobileImages'] = $mG;\n\t\t\treturn $data;\n\t\tendif;\n\t\t/* End check if content is mobile or desktop site */\n\t\t\n\t\t/* \n\t\t\tEnd Parse XML Data \n\t\t*/\n\t\t\n\t}", "abstract protected function createDefaultBody();", "function Feed($title, $link, $body) {\n return\n'<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n<feed xmlns=\"http://www.w3.org/2005/Atom\">\n <title>'. $title . '</title>\n <link href=\"' . $link . '\" />\n ' . $body . '\n</feed>\n';\n}", "public function getNews()\r\n\t{\r\n\t\treturn $this->makeRequest('/news');\r\n\t}", "protected function rss()\n {\n $return = array();\n foreach ($this->xml->channel->item as $item) {\n $callbackReturn = $this->applyCallbacks($item);\n $return[] = array_merge($callbackReturn, array(\n 'service' => $this->settings['service'],\n 'type' => $this->settings['type'],\n 'stamp' => (int) strtotime($item->pubDate),\n 'text' => (string) $item->title,\n 'url' => (string) $item->link,\n 'resource' => $this->settings['resource_name'],\n ));\n }\n\n return $return;\n }", "protected function parse() {}", "public function getBodyContents()\n {\n return ($this->payload != null) \n ? $this->payload : URLUtils::formURLEncodeMap($this->bodyParams); \n }", "private function load(){\n\n $xml = simplexml_load_string($this->response);\n if($xml){\n if(!$this->isResponseSuccessFull($xml)) {\n\n $item = $xml->Items->Item;\n\n $this->data['title'] = $item->ItemAttributes->Title->__toString();\n $this->data['ean'] = $item->ItemAttributes->EAN->__toString();\n $this->data['brand'] = $item->ItemAttributes->Brand->__toString();\n $this->data['picture'] = $item->SmallImage->URL->__toString();\n $this->data['asin'] = $item->ASIN->__toString();\n $this->data['price'] = round(((int)$item->ItemAttributes->ListPrice->Amount->__toString()) / 100,2);\n }\n }else{\n $this->errorMessage[] = 'can not load xml.';\n }\n }", "private function processBody($text) {\n $text = $this->processImages($text);\n $text = $this->processLinks($text);\n return $text->html();\n }", "public function getBody()\n {\n return null;\n }", "public function getBody($name = \"\"){\n if($name) {\n return isset($this->body[$name]) ? $this->body[$name] : null;\n }\n else{\n return $this->body;\n }\n }", "public function getBody()\n {\n return $this->getAttribute('body', false, null);\n }", "public function getBody(){\n return $this->body;\n }", "public function getParsedBodyAttribute()\n {\n return (new Parsedown())->text(htmlspecialchars($this->attributes['body']));\n }", "public function getBodyElement()\n {\n return $this->body;\n }", "function sumac_decodeDocumentContent($document)\n{\n\t$documentContent = \"\";\n\t$topNode = $document->documentElement;\n\t$nodeAtts = $topNode->attributes;\n\tforeach ($nodeAtts as $att)\n\t{\n\t\t$decoded = urldecode($att->nodeValue);\n\t\t$decoded = iconv('UTF-8','ISO-8859-1//TRANSLIT',$decoded);\n\t\tif ($att->nodeValue != $decoded)\n\t\t{\n//echo 'top element attr: ' . $att->nodeValue . ' decoded to ' . $decoded. '<br />';\n\t\t\t$decoded = str_replace('&','&amp;',$decoded);\n\t\t\t$att->nodeValue = $decoded;\n\t\t\t$documentContent .= $decoded . '<br />';\n\t\t}\n\t}\n//then decode any text and any attributes for the lower levels\n\t$documentContent .= sumac_decodeNodeChildrenContent($topNode);\n\n//echo '<br />Decoded document: ' . $documentContent . '<br />';\n}", "function read_Content() {\n\n\t\tglobal $xml;\n\t\tglobal $test;\n\t\t$i = 0;\n\t\t\n\t\tforeach ($xml as $content):\n\t\n\t\t\t\n\t\t\tif ($test == \"pizza\"){\n\t\t\t\t\n\t\t\t\t$typ = $xml->category[$i]->attributes();\n\t\t\t\tif ($typ == 'pizza'){\n\t\t\t\t\techo \"Pizza Nr. \" . $i . \": <br>\";\n\t\t\t\t\t\n\t\t\t\t\t$name = $xml->category[$i]->name;\n\t\t\t\t\t$size = $xml->category[$i]->name->attributes();\n\t\t\t\t\t$price = $xml->category[$i]->price;\n\t\t\t\t\techo $name . \"<br>\";\n\t\t\t\t\techo \"Price: \" . $price . \"$<br>\";\n\t\t\t\t\techo \"Size: \" . $size . \"<br>----------------------------<br>\";\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif ($test == \"spaghetti or ziti\"){\n\t\t\t\t\t\n\t\t\t\t$typ = $xml->category[$i]->attributes();\n\t\t\t\tif ($typ == 'spaghetti or ziti'){\n\t\t\t\t\t\t\n\t\t\t\t\techo \"Dish Nr. \" . $i . \": <br>\";\n\t\t\t\t\t$name = $xml->category[$i]->name;\n\t\t\t\t\t$size = $xml->category[$i]->name->attributes();\n\t\t\t\t\t$price = $xml->category[$i]->price;\n\t\t\t\t\techo $name . \"<br>\";\n\t\t\t\t\techo \"Price: \" . $price . \"$<br>\";\n\t\t\t\t\techo \"Size: \" . $size . \"<br>\";\n\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\n\t\t\t$i++;\n\t\tendforeach;\t\n\t\t\n\t}", "public function rss()\r\n{\r\n\r\n $data['noticias'] = $this->news->all();\r\n\r\n\r\n return response()->view('www/rss',$data)->header('Content-Type', 'application/rss+xml');\r\n\r\n\r\n}", "public function parse($document)\n {\n }", "function rssreader_lastnews($where, $who, $site) {\r\n\t$module = 'rssreader';\r\n\t$data = html_entity_decode( file_get_contents( $site ) );\r\n\t//$data = mb_convert_encoding( $data, 'utf-8', 'utf-8,iso-8859-1,iso-8859-15' );\r\n\t$data = mb_convert_encoding( $data, 'utf-8' );\r\n\t$data = utf8_decode( $data );\r\n\t$data = str_replace('&','&amp;',str_replace('&amp;','&',$data));\r\n\t$data = preg_replace('#<([^@ :/?]+@[^>]+)>#i','\"$1\"',$data);\r\n\t$data = preg_replace('#<([^@ :/?]+) at ([^@ :/?]+) dot ([^>]+)>#i','\"$1@$2.$3\"',$data);\r\n\t$data = preg_replace('#<([^@ :/?]+) at ([^>]+)>#i','\"$1@$2.$3\"',$data);\r\n\t$valid = true;\r\n\ttry {\r\n\t\t$dom = $GLOBALS['modules'][$module]['functions']['XmlLoader']( $data );\r\n\t}\r\n\tcatch( DOMException $e ) {\r\n\t\tprint($e.\"\\n\");\r\n\t\t$valid = false;\r\n\t}\r\n\tvar_dump( $valid );\r\n\tif( $valid === false ) {\r\n\t\tsay( $where, $who, 'xml non valide' );\r\n\t\treturn false;\r\n\t}\r\n\t$allitems = $dom->getElementsByTagName( 'item' );\r\n\tsay( $where, $who, $allitems->item( 0 )->getElementsByTagName( 'title' )->item( 0 )->nodeValue . \"\\r\\n\" );\r\n\treturn true;\r\n}", "protected abstract function _body_from_payload ($payload);", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "abstract public function parse();", "public static function parse(string $xml): array {\n $root = new \\SimpleXMLElement($xml);\n $tag = $root->getName();\n if ($tag !== 'PubmedArticle') {\n throw new \\Exception(\"Expected 'PubmedArticle' but got '$tag' instead.\");\n }\n $citation = $root->MedlineCitation;\n if (empty($citation)) {\n throw new \\Exception('MedlineCitation block not found.');\n }\n $article = $citation->Article;\n if (empty($article)) {\n throw new \\Exception(\"Article block not found.\");\n }\n $journal = $article->Journal;\n if (empty($journal)) {\n throw new \\Exception('Journal block not found.');\n }\n $journal_info = $citation->MedlineJournalInfo;\n if (empty($journal_info)) {\n throw new \\Exception('MedlineJournalInfo block not found.');\n }\n $title = trim($article->ArticleTitle ?? '');\n if (!empty($title)) {\n $title_xml = $article->ArticleTitle->asXML();\n $title = preg_replace('#<\\s*/?\\s*ArticleTitle[^>]*>#', '', $title_xml);\n $node = \\dom_import_simplexml($article->ArticleTitle);\n $text = $node->textContent ?? '';\n ebms_debug_log(\"title textContent=$text\", 3);\n $search_title = trim(substr(self::normalize($text), 0, 512));\n ebms_debug_log(\"search_title=$search_title\", 3);\n }\n else {\n $search_title = '';\n }\n $authors = [];\n $last_author_name = NULL;\n if (!empty($article->AuthorList->Author)) {\n foreach ($article->AuthorList->Author as $author) {\n $collective_name = trim($author->CollectiveName ?? '');\n $last_name = trim($author->LastName ?? '');\n $first_name = trim($author->ForeName ?? '');\n $initials = trim($author->Initials ?? '');\n $author_values = [];\n $display_name = '';\n if (!empty($last_name)) {\n $display_name = $author_values['last_name'] = $last_name;\n }\n if (!empty($first_name)) {\n $author_values['first_name'] = $first_name;\n }\n if (!empty($initials)) {\n $author_values['initials'] = $initials;\n $display_name .= \" $initials\";\n }\n if (!empty($collective_name)) {\n $author_values['collective_name'] = $collective_name;\n if (empty($display_name)) {\n $display_name = $collective_name;\n }\n }\n $author_values['display_name'] = $display_name;\n $author_values['search_name'] = $last_author_name = self::normalize($display_name);\n $authors[] = $author_values;\n }\n }\n\n $abstract = [];\n if (!empty($article->Abstract->AbstractText)) {\n foreach ($article->Abstract->AbstractText as $node) {\n $text = trim($node ?? '');\n if (!empty($text)) {\n $text_xml = $node->asXML();\n $text = preg_replace('#<\\s*/?\\s*AbstractText[^>]*>#', '', $text_xml);\n $paragraph = ['paragraph_text' => $text];\n $label = trim($node['Label'] ?? '');\n if (!empty($label)) {\n $paragraph['paragraph_label'] = $label;\n }\n $abstract[] = $paragraph;\n }\n }\n }\n\n $journal_issue = $journal->JournalIssue;\n $pub_date = $journal_issue->PubDate;\n $pub_year = trim($pub_date->Year ?? '');\n $pub_month = trim($pub_date->Month ?? '');\n $pub_day = trim($pub_date->Day ?? '');\n $pub_season = trim($pub_date->Season ?? '');\n $medline_date = trim($pub_date->MedlineDate ?? '');\n $date_values = [];\n $year = NULL;\n if (!empty($pub_year)) {\n if (preg_match('/^\\d\\d\\d\\d$/', $pub_year)) {\n $year = (int) $pub_year;\n }\n $date_values['year'] = $pub_year;\n }\n if (!empty($medline_date)) {\n $date_values['medline_date'] = $medline_date;\n if (empty($year)) {\n $words = preg_split('/[\\s,]+/', $medline_date);\n $matches = [];\n if (preg_match('/^\\d{4}-(\\d{4})$/', $words[0], $matches)) {\n $year = (int) $matches[1];\n }\n elseif (preg_match('/\\d{4}$/', $words[0])) {\n $year = (int) $words[0];\n }\n elseif (count($words) > 1 && preg_match('/\\d{4}$/', end($words))) {\n $year = (int) end($words);\n }\n }\n }\n if (!empty($pub_month)) {\n $date_values['month'] = $pub_month;\n }\n if (!empty($pub_day)) {\n $date_values['day'] = $pub_day;\n }\n if (!empty($pub_season)) {\n $date_values['season'] = $pub_season;\n }\n\n $types = [];\n if (!empty($article->PublicationTypeList->PublicationType)) {\n foreach ($article->PublicationTypeList->PublicationType as $type) {\n $type = trim($type ?? '');\n if (!empty($type)) {\n $types[] = $type;\n }\n }\n }\n\n $comments_corrections = [];\n if (!empty($citation->CommentsCorrectionsList->CommentsCorrections->PMID)) {\n foreach ($citation->CommentsCorrectionsList->CommentsCorrections->PMID as $pmid) {\n $pmid = trim($pmid ?? '');\n if (!empty($pmid)) {\n $comments_corrections[] = $pmid;\n }\n }\n }\n\n $values = [\n 'title' => $title,\n 'search_title' => $search_title,\n 'authors' => $authors,\n 'source' => 'Pubmed',\n 'source_id' => trim($citation->PMID ?? ''),\n 'source_journal_id' => trim($journal_info->NlmUniqueID ?? ''),\n 'source_status' => trim($citation['Status'] ?? ''),\n 'journal_title' => trim($journal->Title ?? ''),\n 'brief_journal_title' => trim($journal_info->MedlineTA ?? ''),\n 'volume' => trim($journal_issue->Volume ?? ''),\n 'issue' => trim($journal_issue->Issue ?? ''),\n 'pagination' => trim($article->Pagination->MedlinePgn ?? ''),\n 'abstract' => $abstract,\n 'pub_date' => $date_values,\n 'year' => $year,\n 'types' => $types,\n 'comments_corrections' => $comments_corrections,\n 'last_author_name' => $last_author_name,\n ];\n if (empty($values['source_id'])) {\n throw new \\Exception('Missing PMID.');\n }\n return $values;\n }", "private function yoast_news() {\n\t\t$extra_links = '<li class=\"facebook\"><a href=\"https://www.facebook.com/yoast\">' . __( 'Like Yoast on Facebook', 'helpscout-docs-api' ) . '</a></li>';\n\t\t$extra_links .= '<li class=\"twitter\"><a href=\"https://twitter.com/yoast\">' . __( 'Follow Yoast on Twitter', 'helpscout-docs-api' ) . '</a></li>';\n\t\t$extra_links .= '<li class=\"email\"><a href=\"https://yoast.com/newsletter/\">' . __( 'Subscribe by email', 'helpscout-docs-api' ) . '</a></li>';\n\n\t\t$this->rss_news( 'https://yoast.com/feed/', __( 'Latest news from Yoast', 'helpscout-docs-api' ), $extra_links );\n\t}" ]
[ "0.5839852", "0.5822978", "0.5806103", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5671267", "0.5538214", "0.54985", "0.5326871", "0.5302773", "0.52695423", "0.52340686", "0.5218425", "0.5162339", "0.5146098", "0.51381934", "0.5135648", "0.51286536", "0.5122504", "0.5106316", "0.5088669", "0.50687695", "0.5061522", "0.50609773", "0.5056851", "0.50509876", "0.5029218", "0.502462", "0.50069803", "0.49872234", "0.49850392", "0.49850392", "0.4968701", "0.49428385", "0.48989058", "0.4877036", "0.48763874", "0.48702094", "0.4859855", "0.4858415", "0.48513955", "0.4842453", "0.48325926", "0.48080498", "0.48080498", "0.48080498", "0.48074394", "0.47994632", "0.47923428", "0.4787381", "0.47850376", "0.47850376", "0.47796494", "0.47775236", "0.47737393", "0.47737393", "0.47737393", "0.47733143", "0.47581607", "0.47451082", "0.47325113", "0.47325113", "0.47324747", "0.47206548", "0.47135618", "0.47114727", "0.470904", "0.47048652", "0.46882617", "0.4685443", "0.46802637", "0.46802053", "0.46768478", "0.4671001", "0.46691763", "0.46639872", "0.465589", "0.46545452", "0.4649586", "0.46461737", "0.46460626", "0.46457428", "0.46398777", "0.46375844", "0.46373484", "0.46363685", "0.4634661", "0.4634661", "0.4634661", "0.4634661", "0.46320453", "0.4626894" ]
0.0
-1
Map paragraphs type field.
public function mapParagraphsType(&$entity, $field, $item_data) { $field_name = $field['id']; foreach ($field['paragraph_list'] as $para_type => $para_fields) { $paragraph = $this->entityTypeManager ->getStorage('paragraph') ->create(['type' => $para_type]); foreach ($para_fields['fields'] as $key => $para_field) { $this->resolveFieldTypeMapping($paragraph, $para_field, $item_data); } if(!empty($paragraph) && $entity->hasField($field_name)) { $entity->$field_name->appendItem($paragraph); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected function AssignPageTypeFields() {\n $this->AddField('showmap', self::DT_BOOLEAN, true);\n $this->AddField('mapaddress', self::DT_STRING);\n }", "function get_parade_parallax_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Background', 'parade_background', 'File'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Enable parallax', 'parade_enable_parallax', 'Boolean'],\n ['Minimum height', 'parade_minimum_height', 'Number (integer)'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Anchor', 'Above', 'Plain text'],\n ['Background', 'Above', 'URL to file'],\n ['Color scheme', 'Above', 'Label'],\n ['Enable parallax', 'Above', 'Boolean'],\n ['Minimum height', 'Above', 'Unformatted'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_paragraphs_types_list() {\n return [\n ['', 'Chart box', 'chart_box', ''],\n ['', 'Header', 'header', ''],\n ['', 'Images', 'images', ''],\n ['', 'Locations', 'locations', ''],\n ['', 'Parallax', 'parallax', ''],\n ['', 'Simple', 'simple', ''],\n ['', 'Social links', 'social_links', ''],\n ['', 'Text & image', 'image_text', ''],\n ['', 'Text box', 'text_box', ''],\n ['', 'Text boxes', 'text_boxes', ''],\n ];\n}", "function get_parade_locations_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Geofield', 'parade_geofield', 'Geofield'],\n ['Map markers', 'parade_location', 'Text (plain)'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Geofield', '- Hidden -', 'Leaflet aggregated map'],\n ['Text', '- Hidden -', 'Default'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Map markers', 'Above', 'Plain text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Inline', 'Plain text'],\n ['Geofield', 'Above', 'Leaflet aggregated map'],\n ['Map markers', 'Above', 'Plain text'],\n ['Text', 'Above', 'Default'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_field_mapping_types() {\n return drupal_map_assoc([\n 'string',\n 'keyword',\n 'date',\n 'long',\n 'double',\n 'boolean',\n 'ip',\n 'object',\n 'nested',\n 'geo_point',\n 'geo_shape',\n 'completion',\n ]);\n}", "function get_parade_simple_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Content', 'parade_text', 'Text (formatted, long)'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Content', '- Hidden -', 'Default'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'inverse' => [\n ['Content'],\n ['Content', '- Hidden -', 'Default'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Content', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_text_box_paragraphs_type_data() {\n $fields = [\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Image', 'parade_image', 'Image'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Image', '- Hidden -', 'Image'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'custom' => [\n ['Content'],\n ['Image', '- Hidden -', 'Image'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['No field is displayed.'],\n ['Call to action', 'Above', 'Call to action'],\n ['Image', 'Above', 'URL to image'],\n ['Text', 'Above', 'Default'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_social_links_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Social links', 'parade_social_link', 'Link'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Social links', '- Visually Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_images_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Images', 'parade_images', 'Image'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Images', '- Hidden -', 'Image'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Images', 'Above', 'Image'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "protected function fieldmap() {\n \n $this->message(__METHOD__);\n\n // column name?\n if (($t = $this->peek()) == EPL_T_IDENTIFIER) {\n $this->map['name'] = $this->p->value;\n $this->next();\n $t = $this->peek();\n }\n\n // primitve data type?\n if ($t == EPL_T_DATA_TYPE) {\n return $this->primitive();\n }\n\n // has or composed_of?\n if ($t == EPL_T_HAS || $t == EPL_T_COMPOSED_OF) {\n return $this->relationship();\n }\n\n // error o.w.\n $this->syntax_error(\"Invalid var @orm tag: \" . $this->getInput());\n\n return false;\n }", "function get_parade_text_boxes_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Boxes', 'parade_paragraphs', 'Entity reference revisions'],\n ['Boxes per row', 'parade_boxes_per_row', 'Number (integer)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Description', 'parade_text', 'Text (formatted, long)'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Description', '- Hidden -', 'Default'],\n ['Boxes', '- Hidden -', 'Rendered entity'],\n ['Call to action', 'Above', 'Call to action'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'custom' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Boxes', '- Hidden -', 'Rendered entity'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Call to action', 'Above', 'Call to action'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['Description', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Boxes per row', 'Above', 'Unformatted'],\n ['Call to action', 'Above', 'Call to action'],\n ['Boxes', 'Above', 'Rendered entity'],\n ['Description', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function getPType(){\n\treturn 'normal';\n}", "function get_parade_header_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Background', 'parade_background', 'File'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Enable parallax', 'parade_enable_parallax', 'Boolean'],\n ['Lead text', 'parade_lead_text', 'Text (plain, long)'],\n ['Slogan', 'parade_secondary_title', 'Text (plain)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Slogan', '- Hidden -', 'Plain text'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Lead text', '- Hidden -', 'Plain text'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Background', 'Above', 'URL to file'],\n ['Color scheme', 'Above', 'Label'],\n ['Enable parallax', 'Above', 'Boolean'],\n ],\n // @todo: Preview.\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "function get_parade_image_text_paragraphs_type_data() {\n $fields = [\n ['Anchor', 'parade_anchor', 'Text (plain)'],\n ['Call to action', 'parade_call_to_action', 'Link'],\n ['Color scheme', 'parade_color_scheme', 'Entity reference'],\n ['Image', 'parade_image', 'Image'],\n ['Layout', 'parade_layout', 'Entity reference'],\n ['Text', 'parade_text', 'Text (formatted, long)'],\n ['Title', 'parade_title', 'Text (plain)'],\n ['View mode', 'parade_view_mode', 'View Mode Selector'],\n ];\n\n $views = [\n 'default' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Image', '- Hidden -', 'Image'],\n ['Text', '- Hidden -', 'Default'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'inverse' => [\n ['Content'],\n ['Title', '- Hidden -', 'Plain text'],\n ['Text', '- Hidden -', 'Default'],\n ['Image', '- Hidden -', 'Image'],\n ['Call to action', '- Hidden -', 'Link'],\n ['Anchor', 'Above', 'Plain text'],\n ['Color scheme', 'Above', 'Label'],\n ['Layout', 'Above', 'Label'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n 'preview' => [\n ['Top'],\n ['Title', 'Inline', 'Plain text'],\n ['First'],\n ['Layout', 'Above', 'Label'],\n ['Color scheme', 'Above', 'Label'],\n ['Second'],\n ['Anchor', 'Above', 'Plain text'],\n ['Call to action', 'Above', 'Call to action'],\n ['Image', 'Above', 'URL to image'],\n ['Text', 'Above', 'Default'],\n ['View mode', 'Above', 'Selected view mode name as text'],\n ],\n ];\n\n $forms = [];\n\n return [\n 'fields' => $fields,\n 'views' => $views,\n 'forms' => $forms,\n ];\n}", "public function getTypeMapper();", "function _token_rules_map_type($type) {\r\n if (($data_type = rules_get_data_types($type)) && isset($data_type['token type'])) {\r\n return $data_type['token type'];\r\n }\r\n return $type;\r\n}", "public static function post_type(){}", "public static function fieldTypes()\n {\n $types = [\n 'label' => _MA_XMARTICLE_FIELDTYPE_LABEL,\n 'vs_text' => _MA_XMARTICLE_FIELDTYPE_VSTEXT,\n 's_text' => _MA_XMARTICLE_FIELDTYPE_STEXT,\n 'm_text' => _MA_XMARTICLE_FIELDTYPE_MTEXT,\n 'l_text' => _MA_XMARTICLE_FIELDTYPE_LTEXT,\n 'text' => _MA_XMARTICLE_FIELDTYPE_TEXT,\n 'select' => _MA_XMARTICLE_FIELDTYPE_SELECT,\n 'select_multi' => _MA_XMARTICLE_FIELDTYPE_SELECTMULTI,\n 'radio_yn' => _MA_XMARTICLE_FIELDTYPE_RADIOYN,\n 'radio' => _MA_XMARTICLE_FIELDTYPE_RADIO,\n 'checkbox' => _MA_XMARTICLE_FIELDTYPE_CHECKBOX,\n 'number' => _MA_XMARTICLE_FIELDTYPE_NUMBER\n ];\n\n return $types;\n }", "function hook_acquia_contenthub_field_type_mapping_alter(array &$mapping) {\n $mapping['my_custom_field'] = 'array<string>';\n}", "protected function getMapping($type)\n {\n switch ($type) {\n case 'article':\n return [\n 'txtArtikel' => 'name',\n 'txtshortdescription' => 'description',\n 'txtlangbeschreibung' => 'descriptionLong',\n 'txtshippingtime' => 'shippingTime',\n 'txtzusatztxt' => 'additionalText',\n 'txtkeywords' => 'keywords',\n 'txtpackunit' => 'packUnit',\n ];\n case 'variant':\n return [\n 'txtshippingtime' => 'shippingTime',\n 'txtzusatztxt' => 'additionalText',\n 'txtpackunit' => 'packUnit',\n ];\n case 'link':\n return [\n 'linkname' => 'description',\n ];\n case 'download':\n return [\n 'downloadname' => 'description',\n ];\n case 'config_countries':\n return [\n 'countryname' => 'name',\n 'notice' => 'description',\n ];\n case 'config_units':\n return [\n 'description' => 'name',\n ];\n case 'config_dispatch':\n return [\n 'dispatch_name' => 'name',\n 'dispatch_description' => 'description',\n 'dispatch_status_link' => 'statusLink',\n ];\n default:\n return false;\n }\n }", "protected abstract function generateParagraphTypeBaseFields(Row $row);", "function register_field_type_info($info)\n {\n }", "public function getDataWithTypeField() {}", "abstract protected function post_type();", "public static function getTypeMap() {\n return [\n 'charge_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'amount' => self::FIELD_INT,\n 'description' => self::FIELD_STRING,\n 'charge_date' => self::FIELD_EPOCH,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "public function setType(){\n switch($this->security){\n case 'H':\n case 'L':\n case '0.0':\n $typeId = 2; // k-space\n break;\n case 'A':\n $typeId = 3; // a-space\n break;\n default:\n $typeId = 1; // w-space\n }\n\n /**\n * @var $type MapTypeModel\n */\n $type = $this->rel('typeId');\n $type->getById($typeId);\n $this->typeId = $type;\n }", "function getPType() {\n return 'inline';\n }", "function getParagraphsFields(): array {\n $database = \\Drupal::database();\n\n $query = $database->select('paragraphs_item_field_data', 'p');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->addField('p', 'parent_field_name', 'parent_field_name');\n $result = $query->distinct()->execute()->fetchAll();\n\n return $result;\n}", "function get_field_types()\n {\n }", "protected function parseHelloFields($type)\n {\n }", "public function processParagraphField($field,$trainee,$nid,$action) {\n\t $entity_type_id = 'paragraph';\n $bundle = 'food_chart';\n foreach ($this->entityManager->getFieldDefinitions($entity_type_id, $bundle) as $field_name => $field_definition) {\n if (!empty($field_definition->getTargetBundle())) {\n //$bundleFields[$entity_type_id][$field_name]['type'] = $field_definition->getType();\n $bundleFields[$entity_type_id][$field_name]['label'] = $field_definition->getLabel();\n $bundleFields[$entity_type_id][$field_name]['allowed_values'] = $field_definition->getSettings()['allowed_values'];\n\t if(!empty($field_definition->getDescription())) {\n\t $descArr = explode('|', $field_definition->getDescription());\n\t\t$bundleFields[$entity_type_id][$field_name]['description'] = trim($descArr[0]);\n\t\t$bundleFields[$entity_type_id][$field_name]['minChecked'] = (int)trim($descArr[1]);\n\t }\n\t else {\n\t\t$bundleFields[$entity_type_id][$field_name]['description'] = '';\n\t\t//$bundleFields[$entity_type_id][$field_name]['minChecked'] = '';\n\t }\n }\n }\n\t \n\t \n\t $paragraph_id = '';\n\t $paragraph_data = '';\n\t if($action != 'add') {\n\t\t $db_table_name = 'node__'.$field;\n\t\t $connection = $this->connection;\n\t\t $chart_query = $connection->select($db_table_name, 'fi');\n\t\t $chart_query->fields('fi', ['field_food_items_target_id']);\n\t\t $chart_query->join('node__field_tagged_trainee', 'tt', 'tt.entity_id = fi.entity_id');\n\t\t $chart_query->join('paragraphs_item', 'pi', 'pi.id = fi.field_food_items_target_id');\n\t\t $chart_query->condition('tt.field_tagged_trainee_target_id', $trainee);\n\t\t $chart_query->condition('tt.entity_id', $nid);\n\t\t $paragraph_id = $chart_query->execute()->fetchField();\n\t\t if(!empty($paragraph_id)) {\n\t\t $paragraph_data = $this->entityManager->getStorage('paragraph')->load($paragraph_id);\n\t\t }\n\t }\n\t $food_chart_form = [];\n\t foreach($bundleFields['paragraph'] as $field_name => $field_data) {\n\t $selected_values = '';\n\t $selected_values_arr = [];\n\t $options = [];\n\t if($paragraph_data) {\n\t\t$selected_values = $paragraph_data->$field_name->getValue();\n\t\tif(count($selected_values)) {\n\t\t foreach($selected_values as $values) {\n\t $selected_values_arr[] = $values['value'];\n\t\t }\n\t\t}\n\t\telse if($action == 'detail' && count($selected_values) == 0) {\n\t\t continue;\n\t\t}\n\t }\n\t foreach($field_data['allowed_values'] as $key => $value) {\n\t\tif(in_array($key, $selected_values_arr)) {\n\t\t $selected = true;\n\t\t}\n\t\telse {\n\t $selected = false;\n\t\t}\n\t\tif($action == 'detail') {\n\t if($selected == false) {\n\t\t continue;\n\t\t }\n\t\t $ui_readonly = true;\n\t }\n\t else {\n\t\t $ui_readonly = false;\n\t }\n\t\t$options[] = [\n\t\t 'name' => \"$key\",\n\t\t 'value' => $value,\n\t\t 'selected' => $selected\n\t\t];\n\t }\n\t \n\t $food_chart_form[] = [\n\t 'identifier' => 'multicheckbox',\n\t\t'label' => $field_data['label'],\n\t\t'value' => true,\n\t\t'name' => $field_name,\n\t\t'options' => $options,\n\t\t'collections' => [\n\t\t 'type' => 'multicheckbox',\n\t\t],\n\t\t'ui' => [ 'class' => \"col-sm-12\",\n\t\t 'required' => true,\n\t\t\t\t 'readonly' => $ui_readonly\n\t\t ]\n\t ];\n\t if(isset($field_data['minChecked']) && !empty($field_data['minChecked'])) {\n\t\t$food_chart_form[0]['collections']['minChecked'] = $field_data['minChecked'];\n\t\tif($action != 'detail') {\n\t\t $food_chart_form[0]['validations'][0] = [\n\t\t 'name' => 'requireCheckboxToBeChecked',\n 'message' => $field_data['description'],\n 'validator' => 'custom'\t\t \n\t\t ];\n\t\t}\n\t }\n\t \n\t }\n\t return $food_chart_form;\n }", "private function post_types() {\n\t\t$this->section_data['general_post_types'] = array(\n\t\t\t'name' \t\t\t\t\t=> 'general_post_types',\n\t\t\t'label' \t\t\t\t=> __( 'Post types', 'fixedtoc' ),\n\t\t\t'default' \t\t\t=> array( 'post', 'page' ),\n\t\t\t'type' \t\t\t\t\t=> 'multi_checkbox',\n\t\t\t'choices'\t\t\t\t=> $this->obj_field_data->get_posttype_choices(),\n\t\t\t'des'\t\t\t\t\t\t=> __( 'Check the post types to be applied. Multiple choice.', 'fixedtoc' )\n\t\t);\n\t}", "function kato_policy_print_type(){\n\tif(function_exists('the_field')){\n\t\t$type = get_field('type');\n\t\t$field = get_field_object('type');\n\t\t$label = $field['choices'][ $type ];\n\t\tprint '<li class=\"meta-type type-' . $type . '\">';\n\t\tprint $label;\n\t\tprint '</li>';\n\t}\n}", "function get_field_type($field)\n\t{\n\t\tif( $field == \"usr_email\" )\n\t\t\treturn \"email\";\n\t\telse if( $field == \"usr_cod_postal\" )\n\t\t\treturn \"number\";\n\t\telse\n\t\t\treturn \"text\";\n\t}", "private function get_article_type() {\n\t\treturn [ '@type' => $this->get_post_meta( 'type' ) ];\n\t}", "public function fieldTypes($fieldName, $type, $parameters = \"\") {\r\n $this->fieldType[$fieldName] = array(\r\n \"type\" => strtoupper($type),\r\n \"parameters\" => $parameters\r\n );\r\n return $this;\r\n }", "public static function form(&$type)\n\t{\n\t\tif (!isset(self::$type[$type]))\n\t\t{\n\t\t\t$type = self::TEXT;\n\t\t}\n\n\t\tforeach (array_keys(self::$type[$type]) AS $key)\n\t\t{\n\t\t\tFsb::$tpl->set_switch('profile_field_' . $key);\n\t\t}\n\t}", "function getFieldsTypes()\n {\n return array(\n'id' =>'integer',\n'paypalid'=>'string',\n'notifyid'=>'string',\n\n\t\t\t\n\t );\n }", "public static function load_post_data($type,$ptype,$pid)\t{\t\t\t\t\t\n\t\t\n\t\t\tglobal $wpdb;\n\t\t\t\n\t\t\tif($type == \"post\"){\n\t\t\t\t$cond =\"post_type != '\". self::$post_type.\"' AND post_type != 'page'\";\n\t\t\t\t$id = \"id_post\";\n\t\t\t} elseif ($type == \"page\") {\n\t\t\t\t$cond =\"post_type != '\". self::$post_type.\"' AND post_type != 'post'\";\n\t\t\t\t$id = \"id_page\";\n\t\t\t}\n\t\t\t$dis = \"\";\n\t\t\tif($type != $ptype){$dis = \"disabled\";}\n\t\t\t\n\t\t\t$sql = \"SELECT * \n FROM \" . $wpdb->prefix . \"posts \n WHERE \".$cond.\" AND post_status = 'publish'\n ORDER BY post_title ASC;\";\t\t\t\n\t\t\t\t\t\t\n\t\t\t$post_all = $wpdb->get_results($sql);\n\t\t\t$html = \"\";\t\t\t\n\t\t\tif(!empty($post_all)){\n\t\t\t\t\t\n\t\t\t\t\t$ctr = 1;\n $html = '<select id=\"'.$id.'\" style=\"width:280px;\" '.$dis.'>';\n\t\t\t\t\tforeach($post_all as $key => $val){ \n\t\t\t\t\t\t\t$sel = \"\";\n\t\t\t\t\t\t\tif($type == $ptype && $pid == $val->ID){$sel = \"selected\";}\n\t\t\t \t\t$html = $html . '<option value=\"'.$val->ID.'\" '.$sel.'>'.$val->post_title . \"</option>\";\t\t\n\t\t\t\t\t}\n\t\t\t\t\t$html = $html . '</select>';\n\t\t\t}\n\t\t\t\n\t\t\treturn $html;\n\t\t}", "function pa_type_DEP_130707() \n\t\t\t{\n\t\t\t\t$edit_pid = (int)UTIL::get_post('edit_pid');\n\t\t\t\t//-- haben wir keine edit-id, gibts eine seiten-tabelle zur auswahl\n\t\t\t\tif (!$edit_pid) return $this->pa();\n\t\t\t\t$this->set_var('edit_pid', $edit_pid);\n\t\t\t\t//-- der seitenpfad erscheint immer\n\t\t\t\t$this->set_var('show_path',$this->show_path($edit_pid));\n\t\t\t\t//-- vorhandene module lesen\n\t\t\t\t$mods = $this->MC->get_mods();\n\t\t\t\t//-- auslesen, fuer welche module rechte vergeben wurden\n\t\t\t\t$known_mods = $this->MC->get_page_mods($edit_pid);\n\t\t\t\t//-- seitenbaum auslesen\n\t\t\t\t$root_id = (int)$this->root_id;\n\t\t\t\t$set = new NestedSet();\n\t\t\t\t$set->set_table_name($this->mod_tbl);\n\t\t\t\t$nodes = $set->getNodes($root_id, '*', $this->DB->table_restriction($this->mod_tbl));\n\t\t\t\t$this->set_var('page_nodes', $nodes);\n\t\t\t\t$this->set_var('known_mods', $known_mods);\n\t\t\t\t$this->set_var('mod_list', $mods);\n\t\t\t\t$this->set_var('table_name', $this->mod_tbl);\n\t\t\t\t$this->set_var('title',e::o('v_title_2'));\n\t\t\t\t$this->OPC->generate_view($this->tpl_dir . 'pa_type.php');\n\t\t\t}", "public function post_type( $key ) {\n\t\t$this->data['post_type'] = $key;\n\t\t$this->post_type_key = $key;\n\t}", "public function setTyp( $type );", "function _db_process_field($field) {\n\n if (!isset($field['size'])) {\n $field['size'] = 'normal';\n }\n\n // Set the correct database-engine specific datatype.\n if (!isset($field['mysql_type'])) {\n $map = db_type_map();\n $field['mysql_type'] = $map[$field['type'] .':'. $field['size']];\n }\n\n if ($field['type'] == 'serial') {\n $field['auto_increment'] = TRUE;\n }\n\n return $field;\n}", "public function setTypes(){\n $this->var = false;\n $this->symb = false;\n $this->label = false;\n $type = '';\n \n //Ulozi postupne do jednotlivych promennych jestli dany argument odpovida nejakemu danemu vzoru a pote v podminkach rozhodneme typ argumentu (ktery na konci funkce ulozime do typu) a take jestli je argument var, symb, label nebo type\n $var = preg_match(\"/^(TF|LF|GF)@((\\p{L}|-|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n $int = preg_match(\"/^int@([\\+\\-])?([0-9])*$/u\", $this->arg);\n $bool = preg_match(\"/^bool@(true|false)$/u\", $this->arg);\n $string = preg_match(\"/^string@(\\p{L}|[^(\\w\\\\\\)]|\\d|[_]|\\\\\\\\([0-9][0-9][0-9]))*$/u\", $this->arg);\n $nil = preg_match(\"/^nil@nil$/u\", $this->arg);\n $label = preg_match(\"/^((\\p{L}|[_$&%*!?])(\\p{L}|-|[_$&%*!?]|[0-9])*)$/u\", $this->arg);\n if($var){\n $type = \"var\";\n $this->var = true;\n $this->symb = true;\n }\n if($int){\n $type = \"int\";\n $this->symb = true;\n }\n if($bool){\n $type = \"bool\";\n $this->symb = true;\n }\n if($string){\n $type = \"string\";\n $this->symb = true;\n }\n if($nil){\n $type = \"nil\";\n $this->symb = true;\n }\n if($label){\n if(preg_match(\"/^(int|bool|string)$/u\", $this->arg)){\n $this->type_type = true;\n }\n $type = \"label\";\n $this->label = true; \n }\n if(!($var||$int||$bool||$string||$nil||$label)){\n fwrite(STDERR, \"CHYBA \".ERROR_23.\" - spatny argument\\n\");\n exit(ERROR_23);\n }\n $this->setType($type);\n }", "abstract protected function mapRule($field, $rule, $params, $message, $fieldType);", "function getFieldType() {\n\t\treturn 'field';\n\t}", "public function createPostTypes()\n {\n }", "function pg_field_type($result, $field_number)\n{\n}", "public function add_pod_type( $data ) {\n\n\t\t$data['pod'] = __( 'Advanced Content Type (separate from WP, blank slate, in its own table)', 'pods' );\n\n\t\treturn $data;\n\t}", "function get_field_type($name)\n {\n }", "public function mapTextTypeField(&$entity, $field, $item_data) {\n $field_name = $field['id'];\n $mapping_index = explode('.',$field['path']);\n // Loop for value.\n\n $field_value = $item_data['data'];\n for ($i = 0; $i < count($mapping_index); $i++) {\n if(isset($field_value[$mapping_index[$i]])) {\n $field_value = $field_value[$mapping_index[$i]];\n }\n }\n if(is_string($field_value) && $entity->hasField($field_name)) {\n $entity->$field_name->appendItem($field_value);\n }\n }", "public function install_pt_fieldtypes()\n {\n // Run all the time, make sure these tables are updated.\n $field_types = array('matrix', 'playa', 'assets');\n\n require_once PATH_THIRD .'publisher/libraries/Publisher/Publisher_fieldtype.php';\n\n foreach ($field_types as $field_type)\n {\n $class_name = 'Publisher_'. $field_type;\n\n // Initialize the fieldtype class, and set necessary properties\n require_once PATH_THIRD .'publisher/libraries/Publisher/fieldtypes/'. $class_name .'.php';\n ee()->$class_name = new $class_name();\n ee()->$class_name->install();\n }\n\n ee()->session->set_flashdata('message_success', lang('publisher_install_pt_success'));\n ee()->publisher_helper_url->redirect(ee()->publisher_helper_cp->mod_link('settings'));\n }", "function db_type_map() {\n // Put :normal last so it gets preserved by array_flip. This makes\n // it much easier for modules (such as schema.module) to map\n // database types back into schema types.\n $map = array(\n 'varchar:normal' => 'VARCHAR',\n 'char:normal' => 'CHAR',\n\n 'text:tiny' => 'TINYTEXT',\n 'text:small' => 'TINYTEXT',\n 'text:medium' => 'MEDIUMTEXT',\n 'text:big' => 'LONGTEXT',\n 'text:normal' => 'TEXT',\n\n 'serial:tiny' => 'TINYINT',\n 'serial:small' => 'SMALLINT',\n 'serial:medium' => 'MEDIUMINT',\n 'serial:big' => 'BIGINT',\n 'serial:normal' => 'INT',\n\n 'int:tiny' => 'TINYINT',\n 'int:small' => 'SMALLINT',\n 'int:medium' => 'MEDIUMINT',\n 'int:big' => 'BIGINT',\n 'int:normal' => 'INT',\n\n 'float:tiny' => 'FLOAT',\n 'float:small' => 'FLOAT',\n 'float:medium' => 'FLOAT',\n 'float:big' => 'DOUBLE',\n 'float:normal' => 'FLOAT',\n\n 'numeric:normal' => 'DECIMAL',\n\n 'blob:big' => 'LONGBLOB',\n 'blob:normal' => 'BLOB',\n\n 'datetime:normal' => 'DATETIME',\n );\n return $map;\n}", "public static function getTypeMap() {\n return [\n 'session_id' => self::FIELD_INT,\n 'user_id' => self::FIELD_INT,\n 'session_string' => self::FIELD_STRING,\n 'create_date' => self::FIELD_EPOCH,\n 'update_date' => self::FIELD_EPOCH,\n ];\n }", "function _simplerdf_content_mappers_default_fields($content_field) {\n $field = array(\n 'title' => $content_field['widget']['label'],\n );\n return array($content_field['field_name'] => $field);\n}", "public function init_fields() {\n $fields = [];\n\n $fields['type'] = [\n 'type' => Controls_Manager::TEXT,\n 'label' => __('Text', 'chaman_addons')\n ];\n\n return $fields;\n }", "function acf_register_field_type_info($info)\n{\n}", "protected function findType() {\n switch ($this->part->type) {\n case IMAP::ATTACHMENT_TYPE_MESSAGE:\n $this->type = 'message';\n break;\n case IMAP::ATTACHMENT_TYPE_APPLICATION:\n $this->type = 'application';\n break;\n case IMAP::ATTACHMENT_TYPE_AUDIO:\n $this->type = 'audio';\n break;\n case IMAP::ATTACHMENT_TYPE_IMAGE:\n $this->type = 'image';\n break;\n case IMAP::ATTACHMENT_TYPE_VIDEO:\n $this->type = 'video';\n break;\n case IMAP::ATTACHMENT_TYPE_MODEL:\n $this->type = 'model';\n break;\n case IMAP::ATTACHMENT_TYPE_TEXT:\n $this->type = 'text';\n break;\n case IMAP::ATTACHMENT_TYPE_MULTIPART:\n $this->type = 'multipart';\n break;\n default:\n $this->type = 'other';\n break;\n }\n }", "function acadp_get_custom_field_types() {\n\n\t$types = array(\n\t\t'text' => __( 'Text', 'advanced-classifieds-and-directory-pro' ),\n\t\t'textarea' => __( 'Text Area', 'advanced-classifieds-and-directory-pro' ),\n\t\t'select' => __( 'Select', 'advanced-classifieds-and-directory-pro' ),\n\t\t'checkbox' => __( 'Checkbox', 'advanced-classifieds-and-directory-pro' ),\n\t\t'radio' => __( 'Radio Button', 'advanced-classifieds-and-directory-pro' ),\n\t\t'url' => __( 'URL', 'advanced-classifieds-and-directory-pro' )\n\t);\n\n\t// Return\n\treturn apply_filters( 'acadp_custom_field_types', $types );\n\n}", "public function set_typeNum()\n {\n // init the map\n $this->initVarTypeNum();\n }", "function ppom_has_field_by_type( $product_id, $field_type ) {\n\t\n\t$ppom\t\t= new PPOM_Meta( $product_id );\n\tif( ! $ppom->fields ) return '';\n\t\n\t$fields_found = array();\n\tforeach($ppom->fields as $field) {\n\t\t\n\t\tif( !empty($field['type']) && $field['type'] == $field_type ) {\n\t\t\t$fields_found[] = $field;\n\t\t}\n\t}\n\t\n\treturn $fields_found;\n}", "function poi_post_type() {\n\n\t$labels = array(\n\t\t'name' => _x( 'poi Types', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'poiType', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'poi', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'poi Type', 'text_domain' ),\n\t\t'archives' => __( 'poi Archives', 'text_domain' ),\n\t\t'attributes' => __( 'poi Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent poi', 'text_domain' ),\n\t\t'all_items' => __( 'All poi', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New poi', 'text_domain' ),\n\t\t'add_new' => __( 'Add New', 'text_domain' ),\n\t\t'new_item' => __( 'New poi', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit poi', 'text_domain' ),\n\t\t'update_item' => __( 'Update poi', 'text_domain' ),\n\t\t'view_item' => __( 'View poi', 'text_domain' ),\n\t\t'view_items' => __( 'View pois', 'text_domain' ),\n\t\t'search_items' => __( 'Search poi', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into poi', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this poi', 'text_domain' ),\n\t\t'items_list' => __( 'pois list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'pois list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter pois list', 'text_domain' ),\n\t);\n\t$rewrite = array(\n\t\t'slug' => 'poi',\n\t\t'with_front' => true,\n\t\t'pages' => true,\n\t\t'feeds' => true,\n\t);\n\t$args = array(\n\t\t'label' => __( 'poiType', 'text_domain' ),\n\t\t'description' => __( 'poi Type Description', 'text_domain' ),\n\t\t'labels' => $labels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'trackbacks', 'revisions', 'custom-fields', 'page-attributes', 'post-formats' ),\n\t\t'taxonomies' => array( 'category', 'post_tag' ),\n\t\t'hierarchical' => true,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 5,\n\t\t'menu_icon' => 'dashicons-editor-customchar',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => true,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'rewrite' => $rewrite,\n\t\t'capability_type' => 'post',\n\t\t'show_in_rest' => true,\n\t);\n\tregister_post_type( 'poi_type', $args );\n\n}", "public function create_post_types() {\n }", "protected function _assignTypesToField($types)\n\t{\n\t\t$field = $this->_record;\n\n\t\t/**\n\t\t * Override 'types' for core fields, since the core field must be assigned to all types\n\t\t * but alllow core fields 'voting', 'favourites, to selectively assigned to types\n\t\t */\n\t\tif ($field->iscore && !in_array($field->field_type, array('voting', 'favourites'), true))\n\t\t{\n\t\t\t$query = $this->_db->getQuery(true)\n\t\t\t\t->select('id')\n\t\t\t\t->from('#__flexicontent_types');\n\n\t\t\t$types = $this->_db->setQuery($query)->loadColumn();\n\t\t}\n\n\t\t/**\n\t\t * Store field to types relations\n\t\t * Try to avoid unneeded deletion and insertions\n\t\t */\n\n\t\t// First, delete existing types assignments no longer used by the field\n\t\t$query = $this->_db->getQuery(true)\n\t\t\t->delete('#__flexicontent_fields_type_relations')\n\t\t\t->where('field_id = ' . (int) $field->id);\n\n\t\tif (!empty($types))\n\t\t{\n\t\t\t$query->where('type_id NOT IN (' . implode(', ', $types) . ')');\n\t\t}\n\n\t\t$this->_db->setQuery($query)->execute();\n\n\t\t// Second, find type assignments of the field that did not changed\n\t\t$query = $this->_db->getQuery(true)\n\t\t\t->select('type_id')\n\t\t\t->from('#__flexicontent_fields_type_relations')\n\t\t\t->where('field_id = ' . (int) $field->id);\n\n\t\t$used = $this->_db->setQuery($query)->loadColumn();\n\n\t\t// Third, insert only the new records\n\t\tforeach ($types as $type)\n\t\t{\n\t\t\tif (!in_array($type, $used))\n\t\t\t{\n\t\t\t\t// Get last position of each field in each type\n\t\t\t\t$query = $this->_db->getQuery(true)\n\t\t\t\t\t->select('MAX(ordering) as ordering')\n\t\t\t\t\t->from('#__flexicontent_fields_type_relations')\n\t\t\t\t\t->where('type_id = ' . (int) $type);\n\n\t\t\t\t$ordering = $this->_db->setQuery($query)->loadResult();\n\n\t\t\t\t// Insert new type assignment using the next available ordering\n\t\t\t\t$ordering += 1;\n\n\t\t\t\t$query = $this->_db->getQuery(true)\n\t\t\t\t\t->insert('#__flexicontent_fields_type_relations')\n\t\t\t\t\t->columns(array(\n\t\t\t\t\t\t$this->_db->quoteName('field_id'),\n\t\t\t\t\t\t$this->_db->quoteName('type_id'),\n\t\t\t\t\t\t$this->_db->quoteName('ordering')\n\t\t\t\t\t))\n\t\t\t\t\t->values(\n\t\t\t\t\t\t(int) $field->id . ' , ' .\n\t\t\t\t\t\t(int) $type . ' , ' .\n\t\t\t\t\t\t(int) $ordering\n\t\t\t\t\t);\n\n\t\t\t\t$this->_db->setQuery($query)->execute();\n\t\t\t}\n\t\t}\n\t}", "protected function processField($field) {\n if (!isset($field['size'])) {\n $field['size'] = 'normal';\n }\n // Set the correct database-engine specific datatype.\n if (!isset($field['sqlsrv_type'])) {\n $map = $this->getFieldTypeMap();\n $field['sqlsrv_type'] = $map[$field['type'] . ':' . $field['size']];\n }\n if ($field['type'] == 'serial') {\n $field['identity'] = TRUE;\n }\n return $field;\n }", "protected function handleFieldTypes($field, $fieldData)\n {\n switch ($field->type) {\n // Untranslatable fields. These do not include the\n // actual label in the page data.\n case 'suggest':\n case 'radio':\n case 'checkboxes':\n return;\n\n case 'array':\n case 'collection':\n case 'list':\n case 'tags':\n case 'checkbox':\n $this->fields = (new ArrayField($this->fields))->map($fieldData);\n break;\n\n case 'table':\n case 'replicator':\n $this->fields = (new ReplicatorField($this->fields))->map($fieldData);\n break;\n\n // \"Default\" fields include:\n // - Bard\n // - Regular string values\n default:\n $this->fields = (new StringField($this->fields))->map($fieldData);\n break;\n }\n }", "public function getLabelPrepType()\n {\n return $this->_fields['LabelPrepType']['FieldValue'];\n }", "public function getFieldMapping($field) {\n // Support of the custom data types. When such is implemented the type is\n // stored in the $field['real_type'] and the $field['type'] contains the\n // fallback type that will be used if the custom one is not supported.\n $field_type = (isset($field['real_type'])) ? $field['real_type'] : $field['type'];\n $type = search_api_extract_inner_type($field_type);\n\n switch ($type) {\n case 'text':\n return array(\n 'type' => 'string',\n 'boost' => $field['boost'],\n );\n\n case 'uri':\n case 'string':\n case 'token':\n return array(\n 'type' => 'string',\n 'index' => 'not_analyzed',\n );\n\n case 'integer':\n case 'duration':\n return array(\n 'type' => 'integer',\n );\n\n case 'boolean':\n return array(\n 'type' => 'boolean',\n );\n\n case 'decimal':\n return array(\n 'type' => 'float',\n );\n\n case 'date':\n return array(\n 'type' => 'date',\n 'format' => 'date_time',\n );\n\n case 'location':\n return array(\n 'type' => 'geo_point',\n 'lat_lon'=> TRUE,\n );\n\n default:\n return NULL;\n }\n }", "public function get_field_map( $name ) {\n\t\tif ( in_array( $name, [ 'post_title', 'post_content', 'post_excerpt' ], true ) ) {\n\t\t\tif ( isset( $this->field_map['post'][ $name ] ) ) {\n\t\t\t\treturn $this->field_map['post'][ $name ];\n\t\t\t}\n\t\t} else {\n\t\t\tif ( isset( $this->field_map['postmeta'][ $name ] ) ) {\n\t\t\t\treturn $this->field_map['postmeta'][ $name ];\n\t\t\t}\n\t\t}\n\t}", "function getType()\t { return $this->type;\t }", "public function get_persontype_info($post_id, $persontype = 1, $type = '_billing') {\n\n\t\t$WooCommerceNFeFormat = new WooCommerceNFeFormat;\n\n\t\tif ( $persontype == 3 && $type == '_shipping' ) {\n\t\t\t$persontype = $this->detect_persontype($post_id, '_billing');\n\t\t\t$type = '_billing';\n\t\t}\n\n\t\tif ( $persontype == 1 ) {\n\n\t\t\t// Full name and CPF\n\t\t\t$person_info['nome_completo'] = get_post_meta($post_id, $type.'_first_name', true).' '.get_post_meta($post_id, $type.'_last_name', true);\n\t\t\t$person_info['cpf'] = $WooCommerceNFeFormat->cpf(get_post_meta($post_id, $type.'_cpf', true));\n\n\t\t} elseif ( $persontype == 2 ) {\n\n\t\t\t// Razao Social, CNPJ and IE\n\t\t\t$person_info['razao_social'] = get_post_meta($post_id, $type.'_company', true);\n\t\t\t$person_info['cnpj'] = $WooCommerceNFeFormat->cnpj(get_post_meta($post_id, $type.'_cnpj', true));\n\t\t\t$person_info['ie'] = str_replace(array('-','.',','), '', get_post_meta($post_id, $type.'_ie', true));\n\n\t\t}\n\n\t\treturn $person_info;\n\n\t}", "function process_type(&$list)\n{\n\tforeach ($list as $index => $row) {\n\t\tif ($row['climb_type'] == 'Lead')\n\t\t\t$list[$index]['climb_type'] = 'L';\n\t\telse\n\t\t\t$list[$index]['climb_type'] = '';\n\t}\n}", "public function meta_type();", "function editTypeOfArea($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$pType = $this->modify(mysqli_real_escape_string($conn, $data['pType']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($pType)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $pType)) {\n\t\t\t\t\tif($this->length($pType, 25, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_p_type', $pType, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "private function _columnTypeTranslation($type) {\n $map = array(\n 'datetime' => 'timestamp',\n );\n if(!empty($map[$type])) {\n return $map[$type];\n }\n return $type;\n }", "private function adjust_field_types() {\n // Adjust int fields.\n $ft = array('id', 'course', 'context', 'file', 'cropx', 'cropy', 'scalex', 'scaley', 'height', 'width', 'rotate');\n foreach ($ft as $f) {\n $this->$f = ($this->$f === null) ? null : (int)$this->$f;\n }\n }", "protected function metaFieldDefinitions()\n {\n return [\n [\n \"name\" => \"type\",\n \"required\" => true,\n \"type\" => \"string\",\n \"label\" => \"Field type\",\n \"editable\" => false,\n ],\n [\n \"name\" => \"label\",\n \"type\" => \"string\",\n \"label\" => \"Label\"\n ],\n [\n \"name\" => \"protected\",\n \"type\" => \"boolean\",\n \"default\" => false,\n \"editable\" => false,\n \"label\" => \"Schema protected\"\n ],\n [\n \"name\" => \"editable\",\n \"type\" => \"boolean\",\n \"default\" => true,\n \"label\" => \"Field value can be altered\",\n \"editable\" => false\n ],\n [\n \"name\" => \"description\",\n \"type\" => \"string\",\n \"label\" => \"Description\"\n ],\n [\n \"name\" => \"required\",\n \"type\" => \"boolean\",\n \"label\" => \"Required\",\n \"default\" => false\n ],\n [\n \"name\" => \"mode\",\n \"type\" => \"option\",\n \"label\" => \"Data mode\",\n \"options\" => \"prefer_local|Use local data, failing that use external data\\nprefer_external|Use external data, failing that use local data\\nonly_local|Only use local data\\nonly_external|Only use external data\"\n ],\n [\n \"name\" => \"script\",\n \"type\" => \"string\", # should be a special type later on.\n \"label\" => \"Calculated value script\",\n # \"config\" => $documentRevision->configRecordType()\n ],\n [\n \"name\" => \"external_column\",\n \"type\" => \"string\",\n \"label\" => \"External data column\"\n ],\n [\n \"name\" => \"external_table\",\n \"type\" => \"string\",\n \"label\" => \"External Data Table\"\n ],\n [\n \"name\" => \"external_key\",\n \"type\" => \"string\",\n \"label\" => \"External Data Key\"\n ],\n [\n \"name\" => \"external_local_key\",\n \"type\" => \"string\",\n \"label\" => \"External Data Local Key\"\n ],\n [\n \"name\" => \"prefix\",\n \"type\" => \"string\",\n \"label\" => \"Prefix text\"\n ],\n [\n \"name\" => \"suffix\",\n \"type\" => \"string\",\n \"label\" => \"Suffix text\"\n ]\n\n ];\n }", "public function getType() {\n return $this->field->type;\n }", "public function getFieldType(){\n \treturn $this->field_type;\n }", "function repairParagraph(string $parent_type, string $parent_field_name, int $parent_id, int $paragraph_id) {\n global $updates;\n $database = \\Drupal::database();\n $entity_type_manager = \\Drupal::entityTypeManager();\n $parent_storage = $entity_type_manager->getStorage($parent_type);\n $parent = $parent_storage->load($parent_id);\n $parent_field = $parent->get($parent_field_name);\n $parent_field_value = $parent_field->getValue();\n\n foreach ($parent_field_value as $delta => $value) {\n if ((int) $value['target_id'] === $paragraph_id) {\n $revision_id = (int) $value['target_revision_id'];\n logMessage(\"$parent_type #{$parent_id}->$parent_field_name [$delta] points to revision #$revision_id of paragraph #$paragraph_id.\");\n\n // Check the corresponding row in the paragraphs_item table.\n $query = $database->select('paragraphs_item', 'p');\n $query->addField('p', 'id', 'id');\n $query->addField('p', 'revision_id', 'revision_id');\n $query->condition('id', $paragraph_id);\n $row = $query->execute()->fetchObject();\n $row_revision_id = (int) $row->revision_id;\n if ($revision_id === $row_revision_id) {\n logMessage(\"paragraphs_item row for $paragraph #$paragraph_id also points to revision #$revision_id... no action needed.\");\n }\n else {\n logMessage(\"paragraphs_item row for $paragraph #$paragraph_id points to revision #$row_revision_id... updating.\");\n $query = $database->update(\"paragraphs_item\");\n $query->fields([\n \"revision_id\" => $revision_id,\n ]);\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $row_revision_id);\n $query->execute();\n $updates['node']['items'][] = $parent_id;\n $updates['paragraphs_item']['items'][] = $paragraph_id;\n }\n\n // Check the corresponding row in the paragraphs_item_field_data table.\n $query = $database->select('paragraphs_item_field_data', 'p');\n $query->addField('p', 'id', 'id');\n $query->addField('p', 'revision_id', 'revision_id');\n $query->addField('p', 'parent_id', 'parent_id');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->condition('id', $paragraph_id);\n $row = $query->execute()->fetchObject();\n $row_revision_id = (int) $row->revision_id;\n $row_parent_id = (int) $row->parent_id;\n $row_parent_type = $row->parent_type;\n if ($parent_type !== $row_parent_type) {\n throw new \\Exception(\"paragraphs_item_field_data #$paragraph_id is pointing to $row_parent_type (expected: $parent_type). Something is terribly wrong!\");\n }\n else if ($revision_id === $row_revision_id && $parent_id === $row_parent_id) {\n logMessage(\"paragraphs_item_field_data row for $paragraph #$paragraph_id also points to revision #$revision_id and is parented by $parent_type #$parent_id... no action needed.\");\n }\n else {\n logMessage(\"paragraphs_item_field_data row for $paragraph #$paragraph_id points to revision #$row_revision_id (should be $revision_id) and parent $parent_type #$row_parent_id (should be #$parent_id)... updating.\");\n $query = $database->update(\"paragraphs_item_field_data\");\n $query->fields([\n \"revision_id\" => $revision_id,\n \"parent_id\" => $parent_id,\n ]);\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $row_revision_id);\n $query->condition('parent_id', $row_parent_id);\n $query->execute();\n $updates['node']['items'][] = $parent_id;\n $updates['paragraphs_item_field_data']['items'][] = $paragraph_id;\n }\n\n // Check the corresponding row in the paragraphs_item_revision_field_data table.\n $query = $database->select('paragraphs_item_revision_field_data', 'p');\n $query->addField('p', 'id', 'id');\n $query->addField('p', 'revision_id', 'revision_id');\n $query->addField('p', 'parent_id', 'parent_id');\n $query->addField('p', 'parent_type', 'parent_type');\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $revision_id);\n $row = $query->execute()->fetchObject();\n $row_revision_id = (int) $row->revision_id;\n $row_parent_id = (int) $row->parent_id;\n $row_parent_type = $row->parent_type;\n if ($parent_type !== $row_parent_type) {\n throw new \\Exception(\"paragraphs_item_revision_field_data #$paragraph_id is pointing to $row_parent_type (expected: $parent_type). Something is terribly wrong!\");\n }\n else if ($parent_id === $row_parent_id) {\n logMessage(\"paragraphs_item_revision_field_data row for $paragraph #$paragraph_id @ revision #$revision_id is parented by $parent_type #$parent_id... no action needed.\");\n }\n else {\n logMessage(\"paragraphs_item_revision_field_data row for $paragraph #$paragraph_id @ revision #$revision_id is parented by $parent_type #$row_parent_id (should be #$parent_id)... updating.\");\n $query = $database->update(\"paragraphs_item_revision_field_data\");\n $query->fields([\n \"parent_id\" => $parent_id,\n ]);\n $query->condition('id', $paragraph_id);\n $query->condition('revision_id', $row_revision_id);\n $query->condition('parent_id', $row_parent_id);\n $query->execute();\n $updates['node']['items'][] = $parent_id;\n $updates['paragraphs_item_revision_field_data']['items'][] = $paragraph_id;\n }\n\n }\n }\n}", "public function getTypeMap()\n {\n }", "protected function _prepare_post_type($post_type, $fields)\n {\n }", "function registerFieldType($name, $type);", "function apply_note_types() {\r\n\t\t\r\n\t\t$count = 0;\r\n\t\tpreg_match_all('/<part([^\\-][^<>]*?)>(.*?)<\\/part>/is', $this->code, $part_matches, PREG_OFFSET_CAPTURE);\r\n\t\t$part_counter = sizeof($part_matches[0]) - 1;\r\n\t\twhile($part_counter > -1) {\r\n\t\t\t$part = $part_matches[0][$part_counter][0];\r\n\t\t\t$part_offset = $part_matches[0][$part_counter][1];\r\n\t\t\t$part_length = strlen($part);\r\n\t\t\tpreg_match('/<beat\\-type>(.*?)<\\/beat\\-type>/is', $part, $beat_type_matches);\r\n\t\t\t$beat_type = $beat_type_matches[1];\r\n\t\t\tpreg_match('/<divisions>(.*?)<\\/divisions>/is', $part, $divisions_matches);\r\n\t\t\t$divisions = $divisions_matches[1];\r\n\t\t\tpreg_match_all('/<note(.*?)<\\/note>/is', $part, $note_matches, PREG_OFFSET_CAPTURE);\r\n\t\t\t$note_counter = sizeof($note_matches[0]) - 1;\r\n\t\t\twhile($note_counter > -1) {\r\n\t\t\t\t$note = $note_matches[0][$note_counter][0];\r\n\t\t\t\t$note_offset = $note_matches[0][$note_counter][1];\r\n\t\t\t\t$note_length = strlen($note);\r\n\t\t\t\tpreg_match('/<duration([^<>]*?)>(.*?)<\\/duration>/is', $note, $duration_matches);\r\n\t\t\t\t$duration = $duration_matches[2];\r\n\t\t\t\t$note_type = ReTidy::duration_to_note_type($duration, $beat_type, $divisions);\r\n\t\t\t\t$part = substr($part, 0, $note_offset) . '<note' . $note_matches[1][$note_counter][0] . '<type>' . $note_type . '</type>\r\n</note>' . substr($part, $note_offset + $note_length);\r\n\t\t\t\t$count++;\r\n\t\t\t\t$note_counter--;\r\n\t\t\t}\r\n\t\t\t$this->code = substr($this->code, 0, $part_offset) . $part . substr($this->code, $part_offset + $part_length);\r\n\t\t\t$part_counter--;\r\n\t\t}\r\n\t\t$this->logMsgIf('note types applied', $count);\r\n\t}", "function is_field_type($name)\n {\n }", "abstract public function field_props();", "public static function getPpType() {\n return self::PP_TYPE_NAME;\n }", "public function typeText() {\n $params = $this->types();\n return isset($params[$this->type]) ? $params[$this->type] : '';\n }", "function map_field($field){\n $str= $field->to_str();\n //\n //return field to str\n return $str;\n }", "protected function addPostTypeConfigs()\n {\n // TODO: add post type configs\n }", "function people_post_type() {\n\n\t/***************************************************************\n\t *\n\t OUR PEOPLE\n\t *\n\t***************************************************************/\n\n\t$peopleLabels = array(\n\t\t'name' => _x( 'Our People', 'Post Type General Name', 'text_domain' ),\n\t\t'singular_name' => _x( 'Our People', 'Post Type Singular Name', 'text_domain' ),\n\t\t'menu_name' => __( 'Our People', 'text_domain' ),\n\t\t'name_admin_bar' => __( 'Our People', 'text_domain' ),\n\t\t'archives' => __( 'Our People Archives', 'text_domain' ),\n\t\t'attributes' => __( 'Our People Attributes', 'text_domain' ),\n\t\t'parent_item_colon' => __( 'Parent Our People:', 'text_domain' ),\n\t\t'all_items' => __( 'All Our People', 'text_domain' ),\n\t\t'add_new_item' => __( 'Add New Person', 'text_domain' ),\n\t\t'add_new' => __( 'Add New Person', 'text_domain' ),\n\t\t'new_item' => __( 'New Person', 'text_domain' ),\n\t\t'edit_item' => __( 'Edit Person', 'text_domain' ),\n\t\t'update_item' => __( 'Update Person', 'text_domain' ),\n\t\t'view_item' => __( 'View Person', 'text_domain' ),\n\t\t'view_items' => __( 'View Our People', 'text_domain' ),\n\t\t'search_items' => __( 'Search Our People', 'text_domain' ),\n\t\t'not_found' => __( 'Not found', 'text_domain' ),\n\t\t'not_found_in_trash' => __( 'Not found in Trash', 'text_domain' ),\n\t\t'featured_image' => __( 'Featured Image', 'text_domain' ),\n\t\t'set_featured_image' => __( 'Set featured image', 'text_domain' ),\n\t\t'remove_featured_image' => __( 'Remove featured image', 'text_domain' ),\n\t\t'use_featured_image' => __( 'Use as featured image', 'text_domain' ),\n\t\t'insert_into_item' => __( 'Insert into Person', 'text_domain' ),\n\t\t'uploaded_to_this_item' => __( 'Uploaded to this Person', 'text_domain' ),\n\t\t'items_list' => __( 'Our People list', 'text_domain' ),\n\t\t'items_list_navigation' => __( 'Our People list navigation', 'text_domain' ),\n\t\t'filter_items_list' => __( 'Filter Our People list', 'text_domain' ),\n\t);\n\t$peopleArgs = array(\n\t\t'label' => __( 'Our People', 'text_domain' ),\n\t\t'description' => __( 'Post Type Description', 'text_domain' ),\n\t\t'labels' => $peopleLabels,\n\t\t'supports' => array( 'title', 'editor', 'thumbnail' ),\n\t\t// 'taxonomies' => array( 'team_categories' ),\n\t\t//'rewrite' => array( 'slug' => 'team-archive' ),\n\t\t'rewrite' => true,\n\t\t'hierarchical' => false,\n\t\t'public' => true,\n\t\t'show_ui' => true,\n\t\t'show_in_menu' => true,\n\t\t'menu_position' => 20,\n\t\t'menu_icon' => 'dashicons-groups',\n\t\t'show_in_admin_bar' => true,\n\t\t'show_in_nav_menus' => true,\n\t\t'show_in_rest' => true,\n\t\t'can_export' => true,\n\t\t'has_archive' => false,\n\t\t'exclude_from_search' => false,\n\t\t'publicly_queryable' => true,\n\t\t'capability_type' => 'page',\n\t);\n\n\tregister_post_type( 'people', $peopleArgs );\n\t/* this adds your post categories to your custom post type */\n\t// register_taxonomy_for_object_type( 'team_categories', 'team' );\n\n}", "public function createParagraph($type, array $values) {\n $paragraph = Paragraph::create(['type' => $type]);\n\n foreach ($values as $value) {\n $paragraph->set($value['field'], $value['value']);\n }\n\n // Migrate all paragraphs as unpublished.\n $paragraph->set('status', FALSE);\n $paragraph->save();\n return $paragraph;\n }", "public function type() { return $this->post->post_type; }", "function entity_type_translate($entity_type)\n{\n $data = entity_type_translate_array($entity_type);\n if (!is_array($data)) { return NULL; }\n\n return array($data['table'], $data['id_field'], $data['name_field'], $data['ignore_field'], $data['entity_humanize']);\n}", "function set_post_type($post_id = 0, $post_type = 'post')\n {\n }", "abstract protected function initializeMappedTypes();", "public function metadata($type);", "function register_field_type($class)\n {\n }", "public function getFieldMapping($field_name);", "function acf_get_field_types_info($args = array())\n{\n}" ]
[ "0.65844107", "0.642111", "0.6331055", "0.6232043", "0.61252964", "0.6047966", "0.6020479", "0.60180247", "0.5920896", "0.5803017", "0.5786175", "0.57659286", "0.57164115", "0.5693756", "0.5614692", "0.5495104", "0.54725546", "0.5463364", "0.5426758", "0.5426067", "0.5420295", "0.5410994", "0.5375527", "0.53623605", "0.5354347", "0.5350357", "0.5337907", "0.53084344", "0.5306281", "0.5294976", "0.52265924", "0.51621175", "0.5140229", "0.5095608", "0.5087024", "0.50852543", "0.50757813", "0.50729793", "0.5066569", "0.5059691", "0.5058819", "0.50568956", "0.5052525", "0.5037914", "0.50331706", "0.5024033", "0.5023316", "0.5023234", "0.5023135", "0.49815354", "0.49778357", "0.49734774", "0.49632525", "0.49590403", "0.4953666", "0.49365807", "0.49300838", "0.49299875", "0.49208304", "0.49196506", "0.49169037", "0.49081647", "0.49038795", "0.48957056", "0.48885098", "0.48802817", "0.4872967", "0.48635396", "0.4861271", "0.48554426", "0.48546767", "0.48513904", "0.48442116", "0.48438", "0.4820827", "0.48189616", "0.48165807", "0.4810926", "0.48070383", "0.48041368", "0.48009977", "0.4800874", "0.47912443", "0.47906289", "0.47894225", "0.47838223", "0.47819737", "0.47750747", "0.47726488", "0.47699", "0.4761807", "0.47601607", "0.4757179", "0.47558582", "0.4752916", "0.475195", "0.47432828", "0.47338322", "0.4731577", "0.473108" ]
0.7100973
0
Generate table structure for listing.
public function getTable($decodedJsonFeedData) { $header = [ 'headline' => t('Headline'), 'item_id' => t('Item Id'), 'version_created' => t('Version Created'), 'clone' => t('Clone'), ]; $rows = []; if(isset($decodedJsonFeedData['data']['items'])) { $items = $decodedJsonFeedData['data']['items']; foreach ($items as $key => $item) { $item = $item['item']; $clone_buttons = $this->getCloneButton($item['altids']['itemid']); $rows[$key] = [ 'headline' => [ 'data' => isset($item['headline']) ? $item['headline'] : '' ], 'item_id' => [ 'data' => isset($item['altids']['itemid']) ? $item['headline'] : '' ], 'version_created' => [ 'data' => isset($item['versioncreated']) ? $this->dateFormatter->format(strtotime($item['versioncreated']), 'custom', 'm/d/Y h:ia') : '' ], 'clone' => [ 'data' => !empty($clone_buttons) ? $clone_buttons : '' ], ]; } } return [ '#type' => 'table', '#prefix' => '<div id="ap-news-table-list" class="table-feed-list">', '#suffix' => '</div>', '#header' => $header, '#rows' => $rows, '#footer' =>$this->getFooter($decodedJsonFeedData), '#empty' => t('No result found.'), ]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function prepare_table()\n {\n global $g_dirs;\n\n $l_dao = new isys_cmdb_dao($this->database);\n $l_quicky = new isys_ajax_handler_quick_info();\n\n $l_table = \"<table width=\\\"100%\\\" class=\\\"report_listing\\\">\";\n\n foreach ($this->m_its_arr as $l_obj_id => $l_title) {\n unset($this->m_obj_arr);\n $l_table .= \"<tr style=\\\"\\\"><td onclick=\\\"collapse_it_service('\" . $l_obj_id . \"')\\\" id=\\\"\" . $l_obj_id . \"\\\" class=\\\"report_listing\\\"><img id=\\\"\" . $l_obj_id .\n \"_plusminus\\\" src=\\\"\" . $g_dirs[\"images\"] . \"dtree/nolines_plus.gif\\\" class=\\\"vam\\\">\";\n\n $l_table .= $l_quicky->get_quick_info($l_obj_id, $l_dao->get_obj_name_by_id_as_string($l_obj_id), C__LINK__OBJECT);\n\n $l_table .= \"<img src=\\\"\" . $g_dirs[\"images\"] . \"ajax-loading.gif\\\" id=\\\"ajax_loading_view_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\" class=\\\"vam\\\" /></td></tr>\";\n\n $l_table .= \"<tr id=\\\"childs_\" . $l_obj_id . \"\\\" style=\\\"display:none;\\\"><td><div id=\\\"childs_content_\" . $l_obj_id . \"\\\"></div>\";\n $l_table .= \"</td></tr>\";\n }\n\n $l_table .= \"</table>\";\n\n return $l_table;\n }", "public function generateList()\n {\n // Set page record in header\n $this->pageRecord = BackendUtility::getRecordWSOL('pages', $this->id);\n $hideTablesArray = GeneralUtility::trimExplode(',', $this->hideTables);\n\n $backendUser = $this->getBackendUser();\n\n // pre-process tables and add sorting instructions\n $tableNames = array_flip(array_keys($GLOBALS['TCA']));\n foreach ($tableNames as $tableName => &$config) {\n $hideTable = false;\n\n // Checking if the table should be rendered:\n // Checks that we see only permitted/requested tables:\n if ($this->table && $tableName !== $this->table\n || $this->tableList && !GeneralUtility::inList($this->tableList, $tableName)\n || !$backendUser->check('tables_select', $tableName)\n ) {\n $hideTable = true;\n }\n\n if (!$hideTable) {\n // Don't show table if hidden by TCA ctrl section\n // Don't show table if hidden by pageTSconfig mod.web_list.hideTables\n $hideTable = $hideTable\n || !empty($GLOBALS['TCA'][$tableName]['ctrl']['hideTable'])\n || in_array($tableName, $hideTablesArray, true)\n || in_array('*', $hideTablesArray, true);\n // Override previous selection if table is enabled or hidden by TSconfig TCA override mod.web_list.table\n if (isset($this->tableTSconfigOverTCA[$tableName . '.']['hideTable'])) {\n $hideTable = (bool)$this->tableTSconfigOverTCA[$tableName . '.']['hideTable'];\n }\n }\n if ($hideTable) {\n unset($tableNames[$tableName]);\n } else {\n if (isset($this->tableDisplayOrder[$tableName])) {\n // Copy display order information\n $tableNames[$tableName] = $this->tableDisplayOrder[$tableName];\n } else {\n $tableNames[$tableName] = [];\n }\n }\n }\n unset($config);\n\n $orderedTableNames = GeneralUtility::makeInstance(DependencyOrderingService::class)\n ->orderByDependencies($tableNames);\n\n foreach ($orderedTableNames as $tableName => $_) {\n // check if we are in single- or multi-table mode\n if ($this->table) {\n $this->iLimit = isset($GLOBALS['TCA'][$tableName]['interface']['maxSingleDBListItems'])\n ? (int)$GLOBALS['TCA'][$tableName]['interface']['maxSingleDBListItems']\n : $this->itemsLimitSingleTable;\n } else {\n // if there are no records in table continue current foreach\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)\n ->getQueryBuilderForTable($tableName);\n $queryBuilder->getRestrictions()\n ->removeAll()\n ->add(GeneralUtility::makeInstance(DeletedRestriction::class))\n ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));\n $queryBuilder = $this->addPageIdConstraint($tableName, $queryBuilder);\n $firstRow = $queryBuilder->select('uid')\n ->from($tableName)\n ->execute()\n ->fetch();\n if (!is_array($firstRow)) {\n continue;\n }\n $this->iLimit = isset($GLOBALS['TCA'][$tableName]['interface']['maxDBListItems'])\n ? (int)$GLOBALS['TCA'][$tableName]['interface']['maxDBListItems']\n : $this->itemsLimitPerTable;\n }\n if ($this->showLimit) {\n $this->iLimit = $this->showLimit;\n }\n // Setting fields to select:\n if ($this->allFields) {\n $fields = $this->makeFieldList($tableName);\n $fields[] = 'tstamp';\n $fields[] = 'crdate';\n $fields[] = '_PATH_';\n $fields[] = '_CONTROL_';\n if (is_array($this->setFields[$tableName])) {\n $fields = array_intersect($fields, $this->setFields[$tableName]);\n } else {\n $fields = [];\n }\n } else {\n $fields = [];\n }\n\n // Finally, render the list:\n $this->HTMLcode .= $this->getTable($tableName, $this->id, implode(',', $fields));\n }\n }", "public function ListTable()\n {\n echo $this->ListTableText();\n }", "public function buildListLayout(): void\n {\n $this->addColumn('name', 3)\n ->addColumn('pseudo', 3)\n ->addColumn('role_id', 3)\n ->addColumn('created_at', 3);\n }", "public function build_table()\n {\n if (count($this->properties) > 0)\n {\n foreach ($this->properties as $property => $values)\n {\n $contents = array();\n $contents[] = $property;\n \n if (! is_array($values))\n {\n $values = array($values);\n }\n \n if (count($values) > 0)\n {\n foreach ($values as $value)\n {\n $contents[] = $value;\n }\n }\n \n $this->addRow($contents);\n }\n \n $this->setColAttributes(0, array('class' => 'header'));\n }\n else\n {\n $contents = array();\n $contents[] = Translation::get('NoResults', null, Utilities::COMMON_LIBRARIES);\n $row = $this->addRow($contents);\n $this->setCellAttributes($row, 0, 'style=\"font-style: italic;text-align:center;\" colspan=2');\n }\n }", "public function listing() {\n return array(\n '#header' => array($this->t('Title'), $this->t('Description'), $this->t('Operations')),\n '#type' => 'table',\n ) + $this->listingLevel($this->paymentStatusManager->hierarchy(), 0);\n }", "function Render()\n\t{\n\t\t$strTableName = $this->_strName;\n\t\t$strVixenTable = \"Vixen.table.{$strTableName}\";\n\n\t\techo \"\n<script type='text/javascript'>\n\t{$strVixenTable} = Object();\n\t{$strVixenTable}.collapseAll = TRUE;\n\t{$strVixenTable}.linked = TRUE;\n\t{$strVixenTable}.totalRows = 0;\n\t{$strVixenTable}.row = Array();\n</script>\";\n\t\t\t\n\t\t\n\t\t$strPageSize = $this->_intPageSize > 0 ? \" page_size='{$this->_intPageSize}' \" : \"\";\n\n\t\techo \"<table border='0' cellpadding='3' cellspacing='0' class='Listing' width='100%' id='$strTableName'$strPageSize>\\n\";\n\t\t\n\t\t// Build headers\n\t\techo \"<tr class='First'>\\n\";\n\t\t$intHeaderCount = 0;\n\t\t$intSortLimit = ($this->_bolSortable && is_array($this->_arrSortFields)) ? count ($this->_arrSortFields) : -1;\n\t\tforeach ($this->_arrHeader AS $objField)\n\t\t{\n\t\t\t$strAlign = $this->_arrAlignments[$intHeaderCount];\n\t\t\t$strSortLabel = \"\";\n\t\t\tif ($intHeaderCount <= $intSortLimit)\n\t\t\t{\n\t\t\t\tif ($this->_arrSortFields[$intHeaderCount] !== NULL)\n\t\t\t\t{\n\t\t\t\t\t$strSortLabel = \" TABLE_SORT='\" . $this->_arrSortFields[$intHeaderCount] . \"' \";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$strSortLabel = \" NO_TABLE_SORT='1' \";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \" <th width='{$this->_arrWidths[$intHeaderCount]}' align='$strAlign'$strSortLabel>\". $objField .\"</th>\\n\";\n\t\t\t$intHeaderCount++;\n\t\t}\n\t\techo \"</tr>\\n\";\n\t\t\n\t\t// Build rows\n\t\t$intRow = -1;\n\t\tforeach ($this->_arrRows AS $objRow)\n\t\t{\n\t\t\t$intRow++;\n\t\t\t$strClass = ($intRow % 2) ? 'Odd' : 'Even';\n\t\t\t$strStyle = \"\";\n\t\t\t\n\t\t\tif (isset($objRow['OnClick']))\n\t\t\t{\n\t\t\t\t// Escape special chars\n\t\t\t\t$strOnClick = \"onclick='\". htmlspecialchars($objRow['OnClick'], ENT_QUOTES) .\"'\";\n\t\t\t\t$strStyle .= \"cursor:pointer;\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$strOnClick = \"\";\n\t\t\t}\n\t\t\t\n\t\t\techo \"<tr id='\" . $strTableName . \"_\" . $intRow . \"' class='$strClass' $strOnClick style='$strStyle'>\\n\";\n\t\t\t\n\t\t\t$intColCount = 0;\n\t\t\t// Build fields\n\t\t\tforeach ($objRow['Columns'] as $objField)\n\t\t\t{\n\t\t\t\t$strWidth = '';\n\t\t\t\t// Work out which width to use\n\t\t\t\t//TODO! After setting the widths once in the header, you shouldn't have to set them again, but we are anyway.\n\t\t\t\t//This could cut down the size of the html file generated\n\t\t\t\t/*if (isset($objRow['Widths']))\n\t\t\t\t{\n\t\t\t\t\t// Use the width specific to this row and column\n\t\t\t\t\t$strWidth = \"width='\". $objRow['Widths'][$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Use the general width of this column\n\t\t\t\t\t$strWidth = \"width='\". $this->_arrWidths[$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t// Work out which alignment to use\n\t\t\t\tif (isset($objRow['Alignments']))\n\t\t\t\t{\n\t\t\t\t\t// Use the alignment specific to this row and column\n\t\t\t\t\t$strAlignment = \"align='\". $objRow['Alignments'][$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Use the general alignment of this column\n\t\t\t\t\t$strAlignment = \"align='\". $this->_arrAlignments[$intColCount] .\"'\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Work out how many columns, this column spans\n\t\t\t\t$strColSpan = \"\";\n\t\t\t\tif (isset($objRow['ColSpans']))\n\t\t\t\t{\n\t\t\t\t\t// colspan values have been declared for this row\n\t\t\t\t\t$strColSpan = \"colspan='\". $objRow['ColSpans'][$intColCount] .\"'\";\n\t\t\t\t\t\n\t\t\t\t\t// If using ColSpans do not use row widths\n\t\t\t\t\t$strWidth = \"\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\techo \"<td $strWidth $strAlignment $strColSpan>\";\n\t\t\t\techo \"$objField\";\n\t\t\t\techo \"</td>\\n\";\n\t\t\t\t$intColCount++;\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Build detail\n\t\t\tif ($this->_bolDetails)\n\t\t\t{\n\t\t\t\techo \"</tr>\";\n\t\t\t\techo \"<tr>\";\n\t\t\t\techo \"<td colspan=\". count($this->_arrHeader) .\" style='padding: 0px 1px 1px 1px;'>\";\n\t\t\t\techo \"<div id='\" . $strTableName . \"_\" . $intRow . \"DIV-DETAIL' style='display: block; overflow:hidden;'>\";\n\t\t\t\techo $objRow['Detail'];\n\t\t\t\techo \"</div>\";\n\t\t\t\techo \"</td>\\n\";\n\t\t\t}\n\t\t\t\n\t\t\t// Build tooltip\n\t\t\tif ($this->_bolToolTips)\n\t\t\t{\n\t\t\t\techo \"</tr>\";\n\t\t\t\techo \"<tr>\";\n\t\t\t\techo \"<td colspan=4 style='padding-top: 0px; padding-bottom: 0px'>\";\n\t\t\t\techo \"<div id='\" . $strTableName . \"_\" . $intRow . \"DIV-TOOLTIP' style='display: none;'>\";\n\t\t\t\techo $objRow['ToolTip'];\n\t\t\t\techo \"</div>\\n\";\n\t\t\t\techo \"</td>\";\n\t\t\t}\n\t\t\n\t\t\techo \"\\n<script type='text/javascript'>\";\n\t\t\techo \"objRow = Object();\\n\";\n\t\t\t\n\t\t\techo \"objRow.selected = false;\\n\";\n\t\t\techo \"objRow.up = true;\\n\";\n\n\t\t\tif ($this->_bolLinked)\n\t\t\t{\n\t\t\t\tif (is_array($objRow['Index']))\n\t\t\t\t{\n\t\t\t\t\t// add Indexes to objRow\n\t\t\t\t\techo \"objIndex = Object();\";\n\t\t\t\t\t\n\t\t\t\t\tforeach ($objRow['Index'] as $strIndexName=>$arrValues)\n\t\t\t\t\t{\n\t\t\t\t\t\techo \"objIndex.{$strIndexName} = Array();\";\n\t\t\t\t\t\tforeach ($arrValues as $strValue)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\techo \"objIndex.{$strIndexName}.push('$strValue');\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\techo \"objRow.index = objIndex;\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\techo \"{$strVixenTable}.row.push(objRow);\\n\";\n\t\t\techo \"</script>\\n\";\n\t\t\techo \"</tr>\\n\";\n\t\t}\n\t\t$intRowCount = $intRow + 1;\n\t\techo \"</table>\\n\";\n\t\t\n\t\techo \"<script type='text/javascript'>{$strVixenTable}.totalRows = $intRowCount;</script>\\n\";\t\n\t\t\n\t\tif ($this->_bolRowHighlighting)\n\t\t{\n\t\t\t// The following \"Vixen.AddCommand\" method breaks down when you try dynamicly inserting a VixenTable into\n\t\t\t// the DOM, because AddCommand only triggers the command when the body.onload event is triggered\n\t\t\t//echo \"<script type='text/javascript'>Vixen.AddCommand('Vixen.Highlight.Attach','\\'$strTableName\\'', $intRowCount);</script>\";\n\t\t\techo \"<script type='text/javascript'>Vixen.Highlight.Attach('$strTableName');</script>\";\n\t\t}\n\t\t\n\t\tif ($this->_bolToolTips)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>Vixen.Tooltip.Attach('$strTableName');</script>\";\n\t\t}\n\t\t\n\t\tif ($this->_bolDetails)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>Vixen.Slide.Attach('$strTableName', TRUE);</script>\\n\";\n\t\t}\n\t\t\n\t\tif ($this->_bolLinked)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>\";\n\t\t\techo \"{$strVixenTable}.linked = TRUE;\";\n\t\t\t\n\t\t\techo \"objLink = Object();\\n\";\n\t\t\t\n\t\t\tforeach ($this->_arrLinkedTables AS $strTableName=>$arrIndexes)\n\t\t\t{\n\t\t\t\techo \"objLink.{$strTableName} = Array();\\n\";\n\t\t\t\tforeach ($arrIndexes AS $strIndex)\n\t\t\t\t{\n\t\t\t\t\techo \"objLink.{$strTableName}.push('$strIndex');\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\techo \"{$strVixenTable}.link = objLink;\\n\";\n\t\t\t\n\t\t\techo \"</script>\\n\";\n\t\t\t\t/*'link':\n\t\t\t{\n\t\t\t\t'AccountInvoices' :\n\t\t\t\t[\n\t\t\t\t\t'Invoice'\n\t\t\t\t]\n\t\t\t},*/\n\t\t}\n\t\t\n\t\tif ($this->_bolSortable)\n\t\t{\n\t\t\techo \"<script type='text/javascript'>Vixen.TableSort.prepare('$strTableName');</script>\\n\";\n\t\t}\n\t}", "public static function generate_index_table() {\n global $PAGE;\n\n $headers = array(\n get_string('table_header_request', 'local_extension'),\n get_string('table_header_items', 'local_extension'),\n get_string('table_header_requestdate', 'local_extension'),\n get_string('table_header_statushead', 'local_extension'),\n );\n\n $columns = array('request', 'date', 'items', 'status');\n\n $table = new \\flexible_table('local_extension_summary');\n $table->define_columns($columns);\n $table->define_headers($headers);\n\n $table->define_baseurl($PAGE->url);\n $table->set_attribute('id', 'local_extension_table');\n $table->set_attribute('class', 'generaltable admintable');\n $table->setup();\n\n return $table;\n }", "public function write() {\n\t\t$table = '<table '.$this->addHTML.'>';\n\t\tif(!is_null($this->tableInfo['head'])) {\n\t\t\t$table .= '<thead><tr>';\n\t\t\tforeach($this->tableInfo['head'] as $value) {\n\t\t\t\t$table .= '<th>'.$value.'</th>';\n\t\t\t}\n\t\t\tif($this->crud) {\n\t\t\t\t\t$table .= '<th>Options</th>';\t\n\t\t\t}\n\t\t\t$table .= '</tr></thead>';\n\t\t}\n\t\t$table .= '<tbody>';\n\t\tif(isset($this->tableInfo['rows'])) {\n\t\t\tforeach($this->tableInfo['rows'] as $row) {\n\t\t\t\t$table .= '<tr>';\n\t\t\t\tforeach($row as $key => $column) {\n\t\t\t\t\tif(($key != $this->crud_id) OR $this->show_crud_id) {\n\t\t\t\t\t\t$table .= '<td>'.$column.'</td>';\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($this->crud && isset($row[$this->crud_id])) {\n\t\t\t\t\t$table .= '<td>';\n\t\t\t\t\t$table .= '<a href=\"'.$this->crudPath.'Details/'.$row[$this->crud_id].'\" title=\"Details\"><i class=\"fa fa-search\"></i></a> | ';\n\t\t\t\t\t$table .= '<a href=\"'.$this->crudPath.'Edit/'.$row[$this->crud_id].'\" title=\"Edit\"><i class=\"fa fa-wrench\"></i></a> | ';\n\t\t\t\t\t$table .= '<a href=\"'.$this->crudPath.'Delete/'.$row[$this->crud_id].'\" title=\"Delete\"><i class=\"fa fa-trash\"></i></a>';\n\t\t\t\t\t$table .= '</td>';\n\t\t\t\t}\n\t\t\t\t$table .= '</tr>';\n\t\t\t}\n\t\t} else {\n\t\t\t$table .= '<tr>';\n\t\t\t$table .= '<td>';\n\t\t\t$table .= 'No Data to show here.';\n\t\t\t$table .= '</td>';\n\t\t\t$table .= '</tr>';\t\n\t\t}\n\t\t\n\t\t$table .= '</tbody></table>';\n\t\treturn $table;\n\t}", "public function table()\n\t{\n\t\t$sql = '\n\t\t\tselect \n\t\t\t\tid, \n\t\t\t\tname, \n\t\t\t\tenable \n\t\t\tfrom \n\t\t\t\tfile \n\t\t\twhere \n\t\t\t\tuser = ?';\n\n\t\t$results = DB::select($sql, [Auth::id()]);\n\n\t\treturn Datatable::collection(new Collection($results))\n\t\t\t->showColumns('name')\n\t\t\t->addColumn('enable', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/edit&ID=\".$model->id.\"&EN=\".$model->enable).'\">'.$model->enable.'</a>';\n\t\t\t})\n\t\t\t->addColumn('remove', function($model) \n\t\t\t{\n\t\t\t\treturn '<a href=\"'.url(\"/file/delete&ID=\".$model->id).'\"><i class=\"fa fa-times\"></i></a>';\n\t\t\t})\n ->searchColumns('name')\n ->orderColumns('enable', 'name')\n ->make();\n\t}", "public static function listTable() {\n self::init();\n $columns = self::getListTableColumns();\n $columnsData = array();\n\n foreach($columns as $key => $value)\n $columnsData[$key] = $value['label'];\n\n new AdminListTable(\n self::$table,\n array(\n 'singular' => 'Log',\n 'plural' => 'Logs',\n ),\n array(\n 'columns' => $columnsData,\n 'orderby' => 'date_time',\n 'order' => 'desc',\n 'search' => array(\n 'date_time',\n ),\n 'sortable' => array(\n 'date_time' => 'date_time',\n ),\n 'per_page' => 40,\n )\n );\n }", "function as_table() \n {\n #$str = \"<table> \\n\";\n $str = \"\";\n foreach(get_object_vars($this) as $name => $obj) \n {\n if ($obj != NULL) \n {\n $str .= \"<tr>\\n\\t<td>\".$obj->label().\"</td>\\n\\t\";\n $str .= \"<td>\".$obj.\"</td>\\n</tr>\\n\";\n }\n }\n #$str .= \"</table>\\n\";\n return $str;\n }", "public function listTable()\n {\n // Searching the data\n $vehicles = Vehicle::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'vehicles' => $vehicles,\n ];\n\n //dd($data);\n\n return $data;\n }", "public function GenerateStructure() {\n // WRITE CONSTRUCTOR\n $this->writeLine(\n sprintf(\n '$return = new pdoMap_Dao_Metadata_Table(\n \\'%1$s\\',\\'%2$s\\',\\'%3$s\\',\n \\'%4$s\\',\\'%5$s\\',\\'%6$s\\');',\n $this->name, // adapter name\n $this->getTableName(), // table name\n $this->entity->getClassName(), // entity class name\n $this->getInterface(), // interface service name\n $this->getAdapterClassName(), // adapter class name (if set)\n $this->getUse() // database connection\n )\n );\n // WRITE PROPERTIES\n $this->entity->GenerateProperties(); \n $this->writeLine('return $return;');\n }", "public function print_table_description()\n {\n }", "public static function create_table_head()\n\t{\n\t\t\n\t\tif (!static::$columns)\n\t\t{\n\t\t\treturn static::$template['wrapper_start'].'<tr><th>No columns config</th></tr>'.static::$template['wrapper_end'];\n\t\t}\n\n\t\t$table_head = static::$template['wrapper_start'];\n\t\t$table_head .= '<tr>';\n\t\t\n\t\tforeach(static::$columns as $column)\n\t\t{\n\t\t\t$sort_key \t= (is_array($column) ? isset($column[1]) ? $column[1] : strtolower($column[0]) : $column);\n\t\t\t$col_attr\t= (is_array($column) && isset($column[2]) ? $column[2] : array());\n\t\t\t\n\t\t\t$new_direction = static::$direction;\n\t\t\t\n\t\t\tif(static::$sort_by == $sort_key)\n\t\t\t{\n\t\t\t\t$active_class_name = static::$template['col_class_active'].' '.static::$template['col_class_active'].'_'.$new_direction;\n\t\t\t\tif(isset($col_attr['class']))\n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] .= ' '.$active_class_name;\n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t$col_attr['class'] = $active_class_name;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$new_direction = (static::$direction == 'asc' ? 'desc' : 'asc');\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(is_array($column) && (!isset($column[1]) || isset($column[1]) && $column[1] !== false)){\n\t\t\t\t\n\t\t\t\t$url \t\t\t= rtrim(static::$base_url, '/').(static::$current_page ? '/'.static::$current_page : '');\n\t\t\t\t$url \t\t\t.= '/'.$sort_key.static::$uri_delimiter.$new_direction;\n\t\t\t\t\n\t\t\t\t$cell_content \t= rtrim(static::$template['link_start'], '> ').' href=\"'.$url.'\">';\n\t\t\t\t$cell_content \t.= $column[0];\n\t\t\t\t$cell_content \t.= static::$template['link_end'];\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tif(is_array($column))\n\t\t\t\t{\n\t\t\t\t\t$column = $column[0];\n\t\t\t\t}\n\t\t\t\t$cell_content = static::$template['nolink_start'].$column.static::$template['nolink_end'];\t\n\t\t\t}\n\t\t\t\n\t\t\t$table_head .= html_tag(static::$template['col_tag'], $col_attr, $cell_content);\n\t\t\t\n\t\t}\n\t\t\n\t\t$table_head .= '</tr>';\n\t\t$table_head .= static::$template['wrapper_end'];\n\n\t\treturn $table_head;\n\t}", "function make_table($table) {\n return print_table($table, true);\n}", "public function show_table_sturcture()\n\t{\n\t\t$str_input_html = \"\";\n\t\t$table = \"default_module_test\";\n\t\t$table = $this->db->escape_str($table);\n\t\t//$sql = \"DESCRIBE `$table`\";\n\t\t//$desc = $this->db->where('Field','sorts')->query($sql)->row();\n\t\t$desc = Easy_Database_Manage::get_table_desc($table);\n\t\techo \"<pre>\";\n\t\techo print_r($desc);\n\t\techo \"</pre>\";\n\t\n\t}", "function makeTable($netid, $pass) {\r\n $dataJSON = getOwlspaceData($netid,$pass, 1);\r\n\r\n $returnString = \"\";\r\n\r\n $data = json_decode($dataJSON, true);\r\n\r\n $keys = array_keys($data);\r\n\r\n echo '<table class=\"table\">';\r\n // go through and make table\r\n foreach (array_keys($data) as $index => $classKey) {\r\n foreach (array_keys($data[$classKey]) as $index => $assignmentKey) {\r\n echo '<tr>';\r\n echo '<td>', $classKey, '</td>';\r\n echo '<td>', $assignmentKey, '</td>';\r\n echo '<td>', $data[$classKey][$assignmentKey], '</td>';\r\n echo '</tr>';\r\n }\r\n }\r\n echo '</table>';\r\n\r\n \r\n }", "public function renderTable()\n {\n $get = new GetBag();\n\n $type = $get->fetchEscape('type', $this->db);\n\n /**\n * Column order.\n */\n $order = $get->fetch('order');\n $order = $order[0]['column'];\n switch ($order) {\n case 0:\n $order = 'id';\n break;\n case 1:\n $order = 'date';\n break;\n default:\n $order = 'id';\n }\n\n $direction = $get->fetch('order');\n $direction = $direction[0]['dir'];\n\n /**\n * Total.\n */\n $total = 0;\n $queryTotal = \"SELECT COUNT(*) as `count` FROM `film_review` WHERE `status` = '{$type}'\";\n $result = $this->db->query($queryTotal);\n if ($row = $result->fetch_assoc()) {\n $total = $row['count'];\n }\n\n /**\n * Page offset.\n */\n $length = $get->fetchInt('length');\n $offset = $get->fetchInt('start');\n\n $order = $this->db->real_escape_string($order);\n $direction = $this->db->real_escape_string($direction);\n\n $query = \"SELECT t1.`id`, t1.`status`, t1.`filmId`, t1.`userId`, t1.`name`, t1.`text`, t1.`date`, t2.`login` \n FROM `film_review` as `t1` LEFT JOIN `user` as `t2` ON t1.`userId` = t2.`id` WHERE t1.`status` = '{$type}'\";\n $query .= \" ORDER BY t1.`{$order}` {$direction} LIMIT {$offset}, {$length}\";\n\n $data = [];\n $result = $this->db->query($query);\n while ($row = $result->fetch_assoc()) {\n $login = $row['login'];\n if (empty($login)) {\n $login = $row['name'];\n }\n \n $item[0] = $row['id'];\n $item[1] = $this->formatDate($row['date'], true);\n $item[2] = $row['userId'];\n $item[3] = $row['text'];\n $item[4] = $row['filmId'];\n $item[5] = $login;\n\n $data[] = $item;\n }\n\n $data = [\n 'draw' => $get->fetchInt('draw'),\n 'recordsTotal' => $total,\n 'recordsFiltered' => $total,\n 'data' => $data\n ];\n\n return json_encode($data);\n }", "abstract protected function _listTables();", "public function listTable()\n {\n // Searching the data\n $places = Place::orderBy('id', 'ASC')\n ->get();\n\n // Setting the list in $data array\n $data = [\n 'places' => $places,\n ];\n\n //dd($data);\n\n return $data;\n }", "function listTables();", "function make_table($query) {\r\n\t\techo \"<table><tr>\";\r\n\t\t$row = mysqli_fetch_assoc($query);\r\n\t\tforeach ($row as $attr => $value) {\r\n\t\t\techo \"<th>$attr</th>\";\r\n\t\t}\r\n\t\techo \"</tr>\";\r\n\t\twhile ($row = mysqli_fetch_assoc($query)) { \r\n\t\t\techo \"<tr>\";\r\n\t\t\tforeach($row as $value) {\r\n\t\t\t\techo \"<td>$value</td>\";\r\n\t\t\t}\r\n\t\t\techo \"</tr>\";\r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "function toTable($data)\n{\n//print_r($data);\n\t$keys = $data[0];\n\t$keys = array_flip($keys);\n\t$result = \"<table>\\n\\t<tr>\";\n\tforeach($keys as $key)\n\t{\n\t\t$result .= '<th>' . $key . '</th>';\n\t}\n\t$result .= \"</tr>\\n\";\n\t$counter = 0;\n\tforeach($data as $item)\n\t{\n\t\t$counter++;\n\t\tif ($counter % 2 == 1)\n\t\t{\n\t\t\t$result .= \"\\t<tr>\";\n\t\t} else\n\t\t{\n\t\t\t$result .= \"\\t<tr class=\\\"odd\\\">\";\n\t\t}\n\t\tforeach($item as $value)\n\t\t{\n\t\t\t$result .= '<td>' . $value . '</td>';\n\t\t}\n\t\t$result .= \"</tr>\\n\";\n\t}\n\t$result .= \"</table>\\n\";\n\treturn $result;\n}", "public static function list() {\n self::init();\n $columns = self::getListTableColumns();\n $columns = array_map(function($object) {\n return $object['label'];\n }, $columns);\n $columns = array_values($columns);\n\n $columnsSql = implode(', ', self::$listTableColumnsKeys);\n $data = self::$wpdb->get_results(\n self::$wpdb->prepare(\n \"SELECT {$columnsSql}\n FROM \" . self::$table . \"\n ORDER BY id ASC\"\n )\n );\n return $data;\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora aterizare</th>\";\n\t\techo \"<th>De la</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_aterizare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"de_la\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "public function tableWizard() {}", "public function getListingInfoTable(){\n return [\n /** STATUS **/\n [\n 'title' => $this->app->lang->translate('admin_bar_status'),\n 'value' => $this->listing->status,\n 'link' => false\n ],\n /** Duplicates **/\n [\n 'title' => $this->app->lang->translate('admin_bar_duplicates'),\n 'value' => $this->getDuplicatesInfo()['title'],\n 'link' => $this->getDuplicatesInfo()['link']\n ],\n /** Last updated **/\n [\n 'title' => $this->app->lang->translate('admin_bar_last_updated'),\n 'value' => \\Lib\\Dates::formatToTpl($this->listing->date_update),\n 'link' => $this->app->urlFor('cp.listings_changelog', ['set_domain'=>true]).'?filter[listing_id]='.$this->listing->getId(),\n /** CP changelog of this listing **/\n 'linkTitle'=>$this->app->lang->translate('admin_bar_cp_changelog'),\n 'target'=>'_blank'\n ],\n /** Claimed **/\n [\n 'title' => $this->app->lang->translate('admin_bar_claimed'),\n 'value' => $this->alternateValue($this->listing->claimed),\n 'link' => false\n ],\n /** User **/\n [\n 'title' => $this->app->lang->translate('admin_bar_user'),\n 'value' => $this->listing->user->user_email.' ('.$this->listing->user_id.')',\n 'link' => $this->app->urlFor('cp.users_edit', ['id' => $this->listing->user_id, 'set_domain'=>true]),\n /** CP Edit User Page **/\n 'linkTitle'=>$this->app->lang->translate('admin_bar_user_cp_edit_user_page'),\n 'target'=>'_blank'\n ],\n /** User Country **/\n [\n 'title' => $this->app->lang->translate('admin_bar_user_country'),\n 'value' => $this->getUserCountryInfo($this->listing->user),\n 'link' => false\n ],\n /** Remaining listings **/\n [\n 'title' => $this->app->lang->translate('admin_bar_remaining_listings'),\n 'value' => $this->redirectStatus['count'],\n 'link' => false\n ],\n\n ];\n }", "public function displayAll() {\n \t\n \techo \"<table border=1>\";\n\t\techo \"<tr>\";\n\t\techo \"<th>Id</th>\";\n\t\techo \"<th>Ora decolare</th>\";\n\t\techo \"<th>Destinatia</th>\";\n\t\techo \"<th>Compania</th>\";\n\t\techo \"</tr>\";\n\n\t\tforeach($this->findAll() as $k => $zbor){ //parcugem arrayul pe linie\n\t\t\techo \"<tr>\";\n\n\t\t\techo \"<td> \" . $zbor[\"id\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"ora_decolare\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"destinatia\"] . \"</td>\";\n\t\t\techo \"<td> \" . $zbor[\"compania\"] . \"</td>\";\n\t\t\t\n\t\t\techo \"</tr>\";\n\t\t}\n\n\t\techo \"</table>\";\n }", "function BeginIncidentTable() {\n $headings = array(\"Year\", \"Section\", \"Description\", \"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\", \"Count\");\n echo \"<table class='sortable' align='center' cellpadding='5' border=1>\";\n echo \"<tr>\";\n foreach ($headings as $heading) {\n echo \"<th>$heading</th>\";\n }\n echo \"</tr>\";\n}", "public function indexTable()\n {\n $this->paginate = array('all', 'order' => array('modified' => 'desc'));\n $contentVariableTables = $this->paginate('ContentVariableTable');\n $this->set(compact('contentVariableTables', $contentVariableTables));\n }", "function viewTable($parks)\n{\n return formatTable($parks);\n}", "protected function getTableStructure($table)\r\n\t{\r\n\t\treturn \"\\t<create><![CDATA[\".parent::getTableStructure($table).\"]]></create>\\n\";\r\n\t}", "function create_table_list(){\n $tables = \"{$this->table_name}\";\n if(isset($this->joined_tables) && count($this->joined_tables)){\n foreach($this->joined_tables as $t){\n if(array_key_exists('TABLE', $t) && array_key_exists('ON', $t)){\n $type = (array_key_exists('TYPE', $t)? $t['TYPE']: \"INNER JOIN\");\n $tables .= \" $type {$t['TABLE']} ON {$t['ON']}\";\n }\n }\n }\n return $tables;\n }", "public function generate_screen() {\n\t\t\t$bootstrap = new HTMLWriter();\n\t\t\t$content = '';\n\t\t\t$columns = array_keys($this->json['columns']);\n\t\t\t$count = 0; \n\t\t\t$array = array(); \n\t\t\tforeach ($this->json['columns'] as $column) {\n\t\t\t\tif ($column['sortavailable'] == 'n') { $array[] = $count; }\n\t\t\t\t$count++;\n\t\t\t}\n\t\t\t\n\t\t\t$tb = new Table(\"class=table table-striped table-bordered table-condensed table-excel|id=table\");\n\t\t\t$tb->tablesection('thead');\n\t\t\t\t$tb->tr();\n\t\t\t\tforeach($this->json['columns'] as $column) {\n\t\t\t\t\t$class = DplusWire::wire('config')->textjustify[$column['headingjustify']];\n\t\t\t\t\t$tb->th(\"class=$class\", $column['heading']);\n\t\t\t\t}\n\t\t\t$tb->closetablesection('thead');\n\t\t\t$tb->tablesection('tbody');\n\t\t\t\tforeach ($this->json['data']['lots'] as $lot) {\n\t\t\t\t\t$tb->tr();\n\t\t\t\t\tforeach($columns as $column) {\n\t\t\t\t\t\t$class = DplusWire::wire('config')->textjustify[$this->json['columns'][$column]['datajustify']];\n\t\t\t\t\t\t$tb->td(\"class=$class\", $lot[$column]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t$tb->closetablesection('tbody');\n\t\t\t$content = $tb->close();\n\t\t\treturn $content;\n\t\t}", "private function create_product_list_detail_table(){\n\t\tglobal $wpdb;\n\n\t\t$table_name = $wpdb->prefix . 'product_list_detail';\n\t\tif($wpdb->get_var(\"SHOW TABLES LIKE '$table_name'\") != $table_name) {\n\t\t\t$charset_collate = $wpdb->get_charset_collate();\n\t\t\t$sql = \"CREATE TABLE $table_name (\n\t\t\t\t\t `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t `product_list_id` INTEGER UNSIGNED NOT NULL,\n\t\t\t\t\t `product_id` INTEGER UNSIGNED NOT NULL,\n\t\t\t\t\t `cantidad` INTEGER UNSIGNED DEFAULT 1,\n\t\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t\t)\n\t\t\t\t\t$charset_collate;\";\n\n\t\t\trequire_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n\t\t\tdbDelta( $sql );\n\t\t}\n\t}", "private function _generateList()\t{\n\t\tglobal $TCA;\n\n\n\t\t$this->pidSelect = 'pid='.intval($this->id);\n\n\n\t\t$this->tablesInSysFolder = array();\n\t\t\t// Traverse the TCA table array:\n\t\tforeach ($TCA as $tableName => $value) {\n\n\t\t\t// Load full table definitions:\n\t\t\tt3lib_div::loadTCA($tableName);\n\n\t\t\t// for later ... Don't show table if hidden by TCA ctrl section\n\t\t\t// $hideTable = $GLOBALS['TCA'][$tableName]['ctrl']['hideTable'] ? TRUE : FALSE;\n\n\t\t\t/* Setting fields to select: */\n\t\t\t$fields = $this->_makeFieldList($value,$tableName);\n\n\t\t\t/* get user defined columns ... for each table listet in a SysFolder */\n\t\t\tif( isset($this->parentObject->settings['SysFolderContentListAdditionalColumns'][$tableName]) ){\n\n\t\t\t\t$sqlRaw = preg_replace('~[^a-z0-9_,]+~i','',$this->parentObject->settings['SysFolderContentListAdditionalColumns'][$tableName]);\n\t\t\t\t$sqlRawE = t3lib_div::trimExplode(',',$sqlRaw,1);\n\t\t\t\t$fields = array_merge($fields,$sqlRawE);\n\t\t\t}\n\n\t\t\t$orderBy = isset($value['ctrl']['sortby']) ? 'ORDER BY '.$value['ctrl']['sortby'] : ( isset($value['ctrl']['default_sortby']) ? $value['ctrl']['default_sortby'] : 'ORDER BY uid desc' );\n\n\t\t\t$queryParts = array(\n\t\t\t\t'SELECT' => implode(',',$fields),\n\t\t\t\t'FROM' => $tableName,\n\t\t\t\t'WHERE' => $this->pidSelect,\n\t\t\t\t'GROUPBY' => '',\n\t\t\t\t'ORDERBY' => $GLOBALS['TYPO3_DB']->stripOrderBy($orderBy),\n\t\t\t\t'LIMIT' => '0,10'\n\t\t\t);\n\n\t\t\t$result = $GLOBALS['TYPO3_DB']->exec_SELECT_queryArray($queryParts);\n\t\t\t$dbCount = $GLOBALS['TYPO3_DB']->sql_num_rows($result);\n\n\t\t\t$accRows = false;\n\t\t\tif( $dbCount ){\n\t\t\t\t$this->tablesInSysFolder[$tableName] = array(\n\t\t\t\t\t'TotalItems'=>$this->_getTotalItems($queryParts),\n\t\t\t\t);\n\t\t\t\t$accRows = array();\t// Accumulate rows here\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result))\t{\n\t\t\t\t\t// In offline workspace, look for alternative record:\n\t\t\t\t\t// t3lib_BEfunc::workspaceOL($table, $row, $GLOBALS['BE_USER']->workspace, TRUE);\n\n\t\t\t\t\tif (is_array($row))\t{\n\t\t\t\t\t\t$accRows = true;\n\t\t\t\t\t\t$this->tablesInSysFolder[$tableName][] = $row;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$GLOBALS['TYPO3_DB']->sql_free_result($result);\n\t\t\t} /* endif $dbCount */\n\n\n\t\t}/* endforeach */\n\n\t}", "protected function generateTable(){\n\t\t$columns = $this->getConfig()->getColumns();\n\t\t$columns['magento_entity_id'] = array('type' => 'int');\n\n\t\t$sql = 'CREATE TABLE ' . $this->_table . '(';\n\n\t\tforeach ($columns as $name => $params) {\n\t\t\t$type = $this->getConfig()->getTypeForDatabase($params['type'], $name);\n\t\t\t$value = isset($params['default']) ? $params['default'] : 'NULL';\n\t\t\tif ($value != 'NULL') {\n\t\t\t\t$value = 'DEFAULT ' . $value;\n\t\t\t}\n\t\t\t$primary = isset($params['primary']) && $params['primary'] ? ' PRIMARY KEY' : '';\n\n\t\t\t$sql .= \"\\n\" . $name . \" \" . $type . \" \" . $value . $primary . \",\";\n\t\t}\n\t\t$sql = substr($sql, 0, -1) . ') ENGINE=InnoDB DEFAULT CHARSET=utf8;' . \"\\n\";\n\n\t\treturn $sql;\n\t}", "function print_pure_table($query_result, $headers) {\n echo \"<table class=\\\"pure-table pure-table-bordered\\\">\";\n if ($headers) {\n echo $headers;\n } else {\n echo \"<thead><tr>\";\n for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n $fieldname = pg_field_name($query_result, $i);\n echo \"<th>$fieldname</th>\";\n }\n echo \"</tr></thead>\";\n }\n \n echo \"<tbody>\";\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</tbody>\";\n echo \"</table>\";\n }", "public function listtabelAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('%');\n }", "public function getListOfTables() {}", "public function table()\n\t{\n\t\t$this->datatables->select('testcat.test_id AS test_id, testcat_id, gender, age, score, percentile, percentile.id AS id');\n\t\t$this->datatables->from('percentile');\n\t\t$this->datatables->join('testcat', 'testcat.id = percentile.testcat_id');\n\n\t\t$this->datatables->edit_column('test_id', '$1', 'test_get_link_by_id(test_id)');\n\t\t$this->datatables->edit_column('testcat_id', '$1', 'testcat_get_link_by_id(testcat_id)');\n\t\t$this->datatables->edit_column('gender', '$1', 'gender(gender)');\n\t\t$this->datatables->edit_column('id', '$1', 'percentile_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "public function tableList()\n {\n $list = (self::MODEL)::with(['cliente', 'endereco'])\n ->join('clientes', 'clientes.id', '=', 'pedidos.cliente_id')\n ->leftJoin('pedido_notas', 'pedido_notas.pedido_id', '=', 'pedidos.id')\n ->orderBy('pedidos.created_at', 'DESC');\n\n $list = $this->handleRequest($list);\n\n return $this->listResponse(OrderTransformer::tableList($list));\n }", "protected function setupListOperation()\n {\n CRUD::column('key')->label('ID key')->type('text');\n CRUD::column('name')->label('Nom')->type('text')->limit(200);\n }", "public function auto_build_list_tbody($data){\r\n\t\t$list_tbody = \"<tbody>\";\r\n\t\t$i = 1;\r\n\t\tforeach ($data as $row) {\r\n\t\t\t$list_tbody .= '<tr>' .\r\n\t\t\t\t\"<td>\" . $i++ . \"</td>\";\r\n\t\t\tforeach ($this->model->table_fields as $list_field) {\r\n\t\t\t\tif ($list_field->get_visible_grid()) {\r\n\t\t\t\t\t//if($list_field->get_type()==Column::$COLUMN_TYPE_SELECT)\r\n\t\t\t\t\tif ($list_field->get_foreing_key()) {\r\n\t\t\t\t\t\t$select_data = $list_field->get_fk_entity()->get_select_data($row[$list_field->get_name()]);\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . $select_data[0]['name'] . \"</td>\";\r\n\t\t\t\t\t} else if ($list_field->get_type() == Column::$COLUMN_TYPE_PASS) {\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . (str_repeat('*', strlen($row[$list_field->get_name()]))) . \"</td>\";\r\n\t\t\t\t\t} else if (Column::$COLUMN_TYPE_ICONPICKER) {\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . $row[$list_field->get_name()] .\r\n\t\t\t\t\t\t\t\" <i class='\" . $row[$list_field->get_name()] . \"'></i></td>\";\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$list_tbody .= \"<td>\" . $row[$list_field->get_name()] . \"</td>\";\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$list_tbody .= \"<td class='text-center'>\" . ($this->model->crud_config['can_update'] ?\r\n\t\t\t\t\t\tComponent::edit_button($this->model->table_name, $row[$this->model->id_field]) : '') . \r\n\t\t\t\t\t($this->model->crud_config['can_delete'] ?\r\n\t\t\t\t\t\tComponent::delete_button($this->model->table_name, $row[$this->model->id_field]) : '') .\r\n\t\t\t\t\"</td>\" .\r\n\t\t\t\t\"</tr>\";\r\n\r\n\t\t}\r\n\t\treturn $list_tbody . \"</tbody>\";\r\n\t}", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<tr class='exTableRow'>\\n\";\n\t\techo \"<th class='exTableColLineNum'>Item #</th>\\n\";\n\t\techo \"<th class='exTableColDesc'>Description of Work</th>\\n\";\n\t\techo \"<th class='exTableColAmount'>Amount</th>\\n\";\n\t\techo \"</tr>\\n\";\n\t}", "public function table()\n\t{\n\t\t$this->datatables->select('experiment_id, user_id_caller, id');\n\t\t$this->datatables->from('caller');\n\n\t\t$this->datatables->edit_column('experiment_id', '$1', 'experiment_get_link_by_id(experiment_id)');\n\t\t$this->datatables->edit_column('user_id_caller', '$1', 'user_get_link_by_id(user_id_caller)');\n\t\t$this->datatables->edit_column('id', '$1', 'caller_actions(id)');\n\n\t\techo $this->datatables->generate();\n\t}", "function getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings, $idName, $URL;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t$page = $page . '<td class = \"headerCell\"></td>';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 1;\n\t\t\t\t$view = '<td class = \"even\">\n\t\t\t\t<a href=\"' . $URL . '?id=' . $tableContent[$i][$idName] . '\">\n\t\t\t\tVIEW</a></td>';\n\t\t\t\t$page = $page . $view;\n\t\t\t\t\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"even\">';\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\t$page = $page . '<td class = \"odd\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "private function createTables() {\n \n foreach($this->G->tableInfo as $table) {\n $this->tables[$table[\"title\"]] = new IdaTable($table[\"title\"]);\n } \n }", "protected function setupListOperation()\n {\n /*$this->crud->setFromDb();*/\n $this->crud->addColumn(['name' => 'name', 'type' => 'text', 'label' => 'Name']);\n $this->crud->addColumn(['name' => 'sku', 'type' => 'text', 'label' => 'SKU / Product Unique ID']);\n $this->crud->addColumn(['name' => 'price', 'type' => 'text', 'label' => 'Price / €']);\n $this->crud->addColumn(['name' => 'status', 'type' => 'text', 'label' => 'Status']);\n $this->crud->addColumn(['name' => 'user.name', 'type' => 'text', 'label' => 'User Name']);\n $this->crud->addColumn(['name' => 'category.name', 'type' => 'text', 'label' => 'Category']);\n $this->crud->addColumn(['name' => 'publish_date', 'type' => 'text', 'label' => 'Publish Date']);\n $this->crud->addColumn(['name' => 'blocking_date', 'type' => 'text', 'label' => 'Blocking Date']);\n $this->crud->addColumn(['name' => 'created_at', 'type' => 'text', 'label' => 'Created Om']);\n $this->crud->addColumn(['name' => 'updated_at', 'type' => 'text', 'label' => 'Updated On']);\n }", "public function render()\n\t{\n\n\t\t$table = \"<table\";\n\n\t\t// Add all attributes\n\t\tforeach ($this->attributes as $key => $value) {\n\t\t\t$table .= ' ' . $key . '=\"' . $value .'\"';\n\t\t}\n\n\t\t$table .= \">\"; // Close table\n\n\t\t// Add the head\n\t\tif ($this->showHeadRow) {\n\t\t\t$table .= \"<thead><tr>\";\n\n\t\t\t// Show the number header.\n\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t$table .= \"<th>#</th>\";\n\t\t\t}\n\n\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t$columnHeadTitle = isset($column['headTitle']) ? $column['headTitle'] : $column[0];\n\t\t\t\t$table .= \"<th>\" . $columnHeadTitle . \"</th>\";\n\t\t\t}\n\n\t\t\t$table .= \"</tr></thead>\"; // finish head\n\t\t}\n\n\t\t// Body\n\t\t$table .= \"<tbody>\";\n\n\t\t$row = $this->numberColumnOffset;\n\n\t\tif (count($this->data) == 0) {\n\t\t\t// Show a no data entry\n\t\t\t$colspan = count($this->columns) + ($this->showNumberColumn ? 1 : 0);\n\t\t\t$table .= '<tr><td colspan=\"'.$colspan.'\"><p align=\"center\" style=\"font-weight:bold;\">Keine Einträge</p></td></tr>';\n\t\t}\n\t\telse {\n\t\t\tforeach ($this->data as $dataObject) {\n\n\t\t\t\t// Row attributes\n\t\t\t\t$attributes = $this->rowAttributes;\n\t\t\t\tif (!is_array($attributes)) {\n\t\t\t\t\tif (is_callable($this->rowAttributes)) {\n\t\t\t\t\t\t$callable = $this->rowAttributes;\n\t\t\t\t\t\t$attributes = $callable($dataObject);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$attributeString = '';\n\t\t\t\tif ($attributes) {\t\t// Add attributes if we have some\n\t\t\t\t\tforeach ($attributes as $attributeName => $attributeValue) {\n\t\t\t\t\t\t$attributeString .= $attributeName . '=\"' . $attributeValue . '\" ' ;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ($this->rowIdDataMethod) {\n\t\t\t\t\t// method name or closure?\n\t\t\t\t\t$id = '';\n\t\t\t\t\tif (is_string($this->rowIdDataMethod)) {\n\t\t\t\t\t\t$id = $dataObject->{$this->rowIdDataMethod}(); // Call the row data method\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($this->rowIdDataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\t\t\t\t\t\t\t// we got a closure\n\t\t\t\t\t\t\t$closure = $this->rowIdDataMethod;\n\t\t\t\t\t\t\t$id = $closure($dataObject);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\n\n\t\t\t\t\t$table .= '<tr id=\"'. $id .'\" ' . $attributeString . '>'; // Start row with id\n\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$table .= \"<tr \". $attributeString .\">\";\t// Start row without id\n\t\t\t\t}\n\n\t\t\t\t// Number?\n\t\t\t\tif ($this->showNumberColumn) {\n\t\t\t\t\t$table .= \"<td>\" . $row . \"</td>\";\n\t\t\t\t}\n\n\t\t\t\tforeach ($this->columns as $column) {\n\t\t\t\t\t$dataMethod = isset($column['dataMethod']) ? $column['dataMethod'] : $column[1];\n\t\t\t\t\tif (is_string($dataMethod)) {\n\t\t\t\t\t\t// Just call the method an insert the return value into the table cell\n\t\t\t\t\t\t$table .= \"<td>\". $dataObject->$dataMethod() .\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$rf = new \\ReflectionFunction($dataMethod);\n\t\t\t\t\t\tif ($rf->isClosure()) {\n\n\t\t\t\t\t\t\t// Call the closure and get the result\n\t\t\t\t\t\t\t$value = $dataMethod($dataObject, $this);\n\n\t\t\t\t\t\t\t$table .= \"<td>\". $value .\"</td>\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$table .= \"</tr>\";\t// End the table row\n\t\t\t\t$row++;\n\t\t\t}\n\n\t\t\t// Render the footer row\n\t\t\t$table = $this->renderFooter($table);\n\n\t\t}\n\n\t\t$table .= \"</tbody>\";\n\n\t\t$table .= \"</table>\";\n\t\treturn $table;\n\t}", "public function showTable() {\n\t\t$tableName = $this->request->getVariable('id');\n\t\t$this->smarty->assign('dbTableObject',new $tableName());\n\t\t$this->pageDisplay('tools');\n\t}", "private function _display_data_table(){\n\t\t\t$fields = array();\n\t\t\t$query = \"DESCRIBE `\".$this->class_settings['database_name'].\"`.`\".$this->table_name.\"`\";\n\t\t\t$query_settings = array(\n\t\t\t\t'database'=>$this->class_settings['database_name'],\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'DESCRIBE',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n\t\t\t$sql_result = execute_sql_query($query_settings);\n\t\t\t\n\t\t\tif($sql_result && is_array($sql_result)){\n\t\t\t\tforeach($sql_result as $sval)\n\t\t\t\t\t$fields[] = $sval;\n\t\t\t}else{\n\t\t\t\t//REPORT INVALID TABLE ERROR\n\t\t\t\t$err = new cError(000001);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t\n\t\t\t\t$err->class_that_triggered_error = 'cCountry_list.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_display_data_table';\n\t\t\t\t$err->additional_details_of_error = 'executed query '.str_replace(\"'\",\"\",$query).' on line 208';\n\t\t\t\treturn $err->error();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//INHERIT FORM CLASS TO GENERATE TABLE\n\t\t\t$form = new cForms();\n\t\t\t$form->setDatabase( $this->class_settings['database_connection'] , $this->table_name , $this->class_settings['database_name'] );\n\t\t\t$form->uid = $this->class_settings['user_id']; //Currently logged in user id\n\t\t\t$form->pid = $this->class_settings['priv_id']; //Currently logged in user privilege\n\t\t\t\n\t\t\t$this->datatable_settings['current_module_id'] = $this->class_settings['current_module'];\n\t\t\t\n\t\t\t$form->datatables_settings = $this->datatable_settings;\n\t\t\t\n\t\t\t$returning_html_data = $form->myphp_dttables($fields);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'display-datatable',\n\t\t\t);\n\t\t}", "function render_table( $workshops, $orderBy, $order, $all_count, $filtered_count, $my_count, $limit, $paged ) {\n?>\n\t\t<?php $this->render_subsubsub( $all_count, $my_count ); ?>\n\t\t\t<?php $this->render_table_nav( \"bottom\", $all_count, $filtered_count, $my_count, $limit, $paged ); ?>\n\n\t\t\t<table class=\"wp-list-table widefat fixt posts\" cellspacing=\"0\">\n\t\t\t\t<thead>\n\t\t\t\t\t<?php $this->render_table_header_footer($orderBy, $order); ?>\n\t\t\t\t</thead>\n\t\t\t\t<tfoot>\n\t\t\t\t\t<?php $this->render_table_header_footer($orderBy, $order); ?>\n\t\t\t\t</tfoot>\n\t\t\t\t<?php $this->render_table_body($workshops); ?>\n\n\t\t\t</table>\n\t\t\t<?php $this->render_table_nav( \"bottom\", $all_count, $filtered_count, $my_count, $limit, $paged ); ?>\n\n<?php\n\t}", "function books_list()\n\t{\n global $wpdb;\n\n \t$this->check_dir();\n \t$this->check_db();\n\n $list = '';\n $list .= \"<table class=\\\"form-table\\\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>ID</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Preview</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Creation Date</h3></th>\n\t\t\t\t\t\t<th scope=\\\"col\\\" style=\\\"text-align: center;\\\" class=\\\"table_heading\\\"><h3>Operation</h3></th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody> \";\n\n\t $sql = \"select `id`, `name`, `date` from `\".$this->table_name.\"` order by `id`\";\n\t $piecemakers = $wpdb->get_results($sql, ARRAY_A);\n\n\t if(count($piecemakers) == \"0\") \n\t\t\t$list\t.= \"<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\"\n\t\t\t\t\t.\"<td colspan=\\\"5\\\" style=\\\"text-align: center;\\\"><strong>There are currently no Piecemakers defined</strong></td></tr>\";\n\n else foreach($piecemakers as $piecemaker) {\n\t\t\t\t$creationDate = date(\"d/m/Y\", $piecemaker['date']);\n\t\t\t\t$piecemakerXml = $this->get_xml($piecemaker['id']);\n\t\t\t\t$piecemakerTable = $this->xml_to_table($piecemaker['id']);\n\n\t\t\t\t$list\t.=\"<tr class=\\\"alternate author-self status-publish\\\" valign=\\\"top\\\">\"\n\t\t\t\t\t\t.\"<td width=\\\"10%\\\" style=\\\"text-align: center;\\\"><strong>\".$piecemaker['id'].\"</strong></td>\" \n\t\t\t\t\t\t.\"<td width=\\\"20%\\\" style=\\\"text-align: center;\\\">\".$this->printImg($piecemakerTable['allPages']['src'][0]).\"</td>\"\n\t\t\t\t\t\t.\"<td width=\\\"15%\\\" style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\".$creationDate.\"\n\t\t\t\t\t\t\t </td>\n\t\t\t\t\t\t\t <td width=\\\"35%\\\" style=\\\"text-align: center;\\\">\n\t\t\t\t\t\t\t\t\t <form name=\\\"operations\\\" id=\\\"operations\\\" method=\\\"post\\\" action=\\\"\\\">\n\t\t\t\t\t\t\t\t\t <input name=\\\"id\\\" value=\\\"\".$piecemaker['id'].\"\\\" type=\\\"hidden\\\"/>\";\n\n\t\t\t\tif($piecemakerXml)\n\t\t\t\t\t$list \t.= \"<input class=\\\"add_page\\\" name=\\\"do\\\" value=\\\"Add Slide\\\" type=\\\"submit\\\" title=\\\"Add Slide\\\"/>\"\n\t\t\t\t\t\t.\"<input class=\\\"piecemaker_properties\\\" name=\\\"do\\\" value=\\\"Book Properties\\\" type=\\\"submit\\\" title=\\\"Piecemaker Properties\\\"/>\"\n\t\t\t\t\t\t.\"<input class=\\\"view_pages\\\" name=\\\"do\\\" value=\\\"View pages\\\" type=\\\"submit\\\" title=\\\"View Pages\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"add_transition\\\" name=\\\"do\\\" value=\\\"Add Transition\\\" type=\\\"submit\\\" title=\\\"Add Transition\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"view_transitions\\\" name=\\\"do\\\" value=\\\"View Transitions\\\" type=\\\"submit\\\" title=\\\"View Transitions\\\" />\"\n\t\t\t\t\t\t.\"<input class=\\\"delete\\\" name=\\\"do\\\" value=\\\"Delete Book\\\" type=\\\"submit\\\" onClick=\\\"return confirm('Delete this book?')\\\"/ title=\\\"Delete\\\">\"\n\t\t\t\t\t\t.\"</form> </td> </tr>\";\n\n\t\t\t}\n $list .= \"</tbody></table>\";\n echo $list;\n\t}", "function writeAsHtmlTable() \r\n\t{\r\n\t\t\t// Import Package Utility\r\n\t\t\tinclude_once(RDFAPI_INCLUDE_DIR.PACKAGE_UTILITY); \t\t\t\r\n\t\tRDFUtil::writeHTMLTable($this->getMemModel());\r\n\t}", "function generateHorizontalTableFromQuery($tableid, $title, $description, $sql){\n\t\t global $database;\n\n $rec = $database->query($sql);\n \n if (!$rec || !$rec->num_rows){\n\t\t\t return $database->error;\n\t\t }\n\t\t \n\t\t $field_names = array();\n\t\t $fields = \"\";\n\t\t $body = \"\";\n\t\t\t\n\t\t\t// first field\n\t\t\t$field_names[] = \"<th>Category</th>\";\n\t\t\twhile ($row = $rec->fetch_array()){\n\t\t\t\t$col = $row[0];\n\t\t\t\t$field_names[] = \"<th>$col</th>\";\n\t\t\t}\n\n\t\t\t$fields = implode(\"\", $field_names);\n\t\t\t\n\t\t\tmysqli_data_seek($rec, 0);\n\n\t\t\t$keys = array();\t\t\t\n\t\t\t$row = $rec->fetch_array();\n\t\t\t$keys_ = array_keys($row);\n\t\t\t$idx = 0;\n\n\t\t\tforeach($keys_ as $key){\n\t\t\t\tif (! is_numeric($key) && $idx > 1){\n\t\t\t\t\t$keys[] = $key;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t$idx++;\n\t\t\t}\n\n\t\t\tmysqli_data_seek($rec, 0);\n\t\t\t$data = \"\";\n\t\t\t$body = \"\";\n\t\t\t\n\t\t\t$total_fields = sizeof($field_names); // account for category\n\t\t\t$datasets = [];\n\t\t\t$idx = 1;\n\t\t\t\n\t\t\twhile ($row = $rec->fetch_array()){\t\t\n\t\t\t\tforeach($keys as $category) {\n\t\t\t\t\t\t $data = $row[$category];\n\t\t\t\t\t\t if (!$data) $data = 0;\n\t\t\t\t\t\t $datasets[$category][] = \"<td>$data</td>\"; \n\t\t\t\t}\n\t\t\t}\t\t\t\n\n\t\t\tforeach ($datasets as $key=>$arr){\n\t\t\t\t$data = implode(\"\", $arr);\n\t\t\t\t$body .= \"<tr><td>$key</td>$data</tr>\";\n\t\t\t\t$idx++;\n\t\t\t}\n\t\t\t\n\t\t\treturn \"<h5 style='font-weight:bold'>$title <small class='pull-right'>$description</small></h5>\n\t\t\t\t\t <div class='table-responsive' style='overflow-x:scroll;'>\n\t\t\t\t\t\t <table class='table table-hover table-bordered' id='$tableid'>\n\t\t\t\t\t <thead>\n\t\t\t\t\t\t <tr>$fields</tr>\n\t\t\t\t\t\t </thead>\n\t\t\t\t\t\t <tbody>\n\t\t\t\t\t\t\t\t$body\n\t\t\t\t\t\t </tbody>\n\t\t\t\t\t\t </table>\n\t\t\t\t\t\t</div>\";\n }", "protected function setupListOperation()\n {\n // $this->crud->setFromDb();\n $name = $this->textCol('name', ' Name');\n $email = $this->emailCol('email', 'Email');\n CRUD::addColumns([$name, $email]);\n }", "function create_table($id, $data, $headers=[], $caption = \"\") {\n $table = \"<table id=\\\"$id\\\"><caption>$caption</caption>\";\n\n if (sizeof($headers) > 0) {\n $table .= add_row(create_headers($headers));\n }\n\n foreach($data as $vals) {\n $table .= add_row(create_row($vals));\n }\n\n $table .= \"</table>\";\n return $table;\n }", "private function _display_data_table(){\n\t\t\t$fields = array();\n\t\t\t$query = \"DESCRIBE `\".$this->class_settings['database_name'].\"`.`\".$this->table_name.\"`\";\n\t\t\t$query_settings = array(\n\t\t\t\t'database'=>$this->class_settings['database_name'],\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'DESCRIBE',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n\t\t\t$sql_result = execute_sql_query($query_settings);\n\t\t\t\n\t\t\tif($sql_result && is_array($sql_result)){\n\t\t\t\tforeach($sql_result as $sval)\n\t\t\t\t\t$fields[] = $sval;\n\t\t\t}else{\n\t\t\t\t//REPORT INVALID TABLE ERROR\n\t\t\t\t$err = new cError(000001);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t\n\t\t\t\t$err->class_that_triggered_error = 'centry_exit_log.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_display_data_table';\n\t\t\t\t$err->additional_details_of_error = 'executed query '.str_replace(\"'\",\"\",$query).' on line 208';\n\t\t\t\treturn $err->error();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//INHERIT FORM CLASS TO GENERATE TABLE\n\t\t\t$form = new cForms();\n\t\t\t$form->setDatabase( $this->class_settings['database_connection'] , $this->table_name , $this->class_settings['database_name'] );\n\t\t\t$form->uid = $this->class_settings['user_id']; //Currently logged in user id\n\t\t\t$form->pid = $this->class_settings['priv_id']; //Currently logged in user privilege\n\t\t\t\n\t\t\t$this->datatable_settings['current_module_id'] = $this->class_settings['current_module'];\n\t\t\t\n\t\t\t$form->datatables_settings = $this->datatable_settings;\n\t\t\t\n\t\t\t$returning_html_data = $form->myphp_dttables($fields);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'display-datatable',\n\t\t\t);\n\t\t}", "public function displayBuildingTable()\n {\n echo \"\n <tr>\n <td>\" . getBuildingRoomCount( $this->id ) . \"</td>\n <td>\n <a href='helper/buildVncFile.php?buildingId=\" . $this->id . \"' class='btn medium bg-blue-alt tooltip-button' data-placement='top' title='Building Info'>\n <i class='glyph-icon icon-info'></i>\n </a>\n <a href='buildingRooms.php?buildingId=\" . $this->id . \"' class='btn medium bg-black font-white tooltip-button' data-placement='top' title='Rooms in Building'>\n <i class='glyph-icon icon-building-o'></i>\n </a>\n </td>\n <td class='font-bold text-left'>\" . $this->name . \"</td>\n <td class='font-bold text-left'>\" . $this->description . \"</td>\n </tr>\n \";\n }", "public function renderItems()\n {\n $content = array_filter([\n $this->renderCaption(),\n $this->renderColumnGroup(),\n $this->showHeader ? $this->renderTableHeader() : false,\n $this->showFooter ? $this->renderTableFooter() : false,\n $this->renderTableBody(),\n ]);\n\n $table = Html::tag('table', implode(\"\\n\", $content), $this->tableOptions);\n if ($this->responsive)\n {\n $table = Html::tag('div', $table, ['class' => 'table-responsive']);\n }\n else\n {\n $table = Html::tag('div', $table, ['class' => 'table-scrollable']);\n }\n\n return $table;\n }", "public function buildListTemplate()\n {\n $this->addListColumn(\n SharpListTemplateColumnConfig::create(\"titre\")\n ->setSize(3)\n ->setHeading(\"Titre\")\n );\n\n $this->addListColumn(\n SharpListTemplateColumnConfig::create(\"soustitre\")\n ->setSize(3)\n ->setHeading(\"Sous-titre\")\n );\n }", "private function _display_data_table(){\n\t\t\t$fields = array();\n\t\t\t$query = \"DESCRIBE `\".$this->class_settings['database_name'].\"`.`\".$this->table_name.\"`\";\n\t\t\t$query_settings = array(\n\t\t\t\t'database'=>$this->class_settings['database_name'],\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'DESCRIBE',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n\t\t\t$sql_result = execute_sql_query($query_settings);\n\t\t\t\n\t\t\tif($sql_result && is_array($sql_result)){\n\t\t\t\tforeach($sql_result as $sval)\n\t\t\t\t\t$fields[] = $sval;\n\t\t\t}else{\n\t\t\t\t//REPORT INVALID TABLE ERROR\n\t\t\t\t$err = new cError(000001);\n\t\t\t\t$err->action_to_perform = 'notify';\n\t\t\t\t\n\t\t\t\t$err->class_that_triggered_error = 'cdiscount.php';\n\t\t\t\t$err->method_in_class_that_triggered_error = '_display_data_table';\n\t\t\t\t$err->additional_details_of_error = 'executed query '.str_replace(\"'\",\"\",$query).' on line 208';\n\t\t\t\treturn $err->error();\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t//INHERIT FORM CLASS TO GENERATE TABLE\n\t\t\t$form = new cForms();\n\t\t\t$form->setDatabase( $this->class_settings['database_connection'] , $this->table_name , $this->class_settings['database_name'] );\n\t\t\t$form->uid = $this->class_settings['user_id']; //Currently logged in user id\n\t\t\t$form->pid = $this->class_settings['priv_id']; //Currently logged in user privilege\n\t\t\t\n\t\t\t$this->datatable_settings['current_module_id'] = $this->class_settings['current_module'];\n\t\t\t\n\t\t\t$form->datatables_settings = $this->datatable_settings;\n\t\t\t\n\t\t\t$returning_html_data = $form->myphp_dttables($fields);\n\t\t\t\n\t\t\treturn array(\n\t\t\t\t'html' => $returning_html_data,\n\t\t\t\t'method_executed' => $this->class_settings['action_to_perform'],\n\t\t\t\t'status' => 'display-datatable',\n\t\t\t);\n\t\t}", "public function renderItems() {\n\n \t $caption = $this->renderCaption();\n \t $columnGroup = $this->renderColumnGroup();\n \t $tableHeader = $this->showHeader ? $this->renderTableHeader() : false;\n \t $tableBody = $this->renderTableBody();\n \t $tableFooter = $this->showFooter ? $this->renderTableFooter() : false;\n \t $content = array_filter([\n \t$caption,\n \t$columnGroup,\n \t$tableHeader,\n \t$tableFooter,\n \t$tableBody,\n \t ]);\n\n\t return self::html()->tag('table', array('options' => $this->tableOptions, 'content' => implode(\"\\n\", $content)), $this->tableOptions);\n }", "protected function setupListOperation()\n {\n $this->crud->removeAllButtons();\n $this->crud->disableResponsiveTable();\n CRUD::column('name');\n CRUD::column('cron_expression');\n CRUD::column('grace_time_in_minutes');\n CRUD::column('last_failed_at');\n CRUD::column('last_finished_at');\n// CRUD::column('last_pinged_at');\n CRUD::column('last_skipped_at');\n CRUD::column('last_started_at');\n// CRUD::column('ping_url');\n// CRUD::column('registered_on_oh_dear_at');\n CRUD::column('timezone');\n CRUD::column('type');\n CRUD::column('updated_at');\n\n /**\n * Columns can be defined using the fluent syntax or array syntax:\n * - CRUD::column('price')->type('number');\n * - CRUD::addColumn(['name' => 'price', 'type' => 'number']);\n */\n }", "public function visualizzazione(){\n $nameColumn = $this->getColumnName();\n $tuple = $this->read();\n foreach($nameColumn as $nome){\n $x = ' <td> '. $nome . ' </td> ';\n echo $x;\n }\n \n foreach($tuple as $ris){\n $str ='<tr> <td> '.$ris->getId(). ' </td> '.\n '<td> '.$ris->getNome(). '</td>'.\n '<td> '.$ris->getUsername(). '</td>'.\n '<td> '.$ris->getPassword(). '</td>'.\n '<td> '.$ris->getEmail(). '</td>'.\n '<td> '.$ris->getMuseo(). '</td>'.\n '</tr>';\n echo $str;\n };\n }", "function print_table($query_result) {\n echo \"<table>\";\n echo \"<tr>\";\n for ($i = 0; $i < pg_num_fields($query_result); $i++) {\n $fieldname = pg_field_name($query_result, $i);\n echo \"<th>$fieldname</th>\";\n }\n echo \"</tr>\";\n\n while ($row = pg_fetch_row($query_result)) {\n echo \"<tr>\";\n $num = pg_num_fields($query_result);\n for ($i = 0; $i < $num; $i++) {\n echo \"<td>$row[$i]</td>\";\n }\n echo \"</tr>\";\n }\n echo \"</table>\";\n }", "#[Pure] public function generateTables(): string\n {\n $snippets = [];\n foreach ($this->tables as $table) {\n $snippet = $table->generateSnippet($this->queryType, $this->dbc);\n if (!empty($snippet)) {\n $snippets[] = $snippet;\n }\n }\n return implode(', ', $snippets);\n }", "function create_table($log)\n {\n $colOrder = array('title','artist','time','count');\n $excludeCols = array('channel','','albumart','keep');\n\n //Select data for table\n list($nrows, $sliced) = select_table_rows($log);\n \n //Create table\n echo '<center><table>';\n \n echo \"\\n <tr>\";\n \n //create header row\n foreach($colOrder as $val) \n {\n echo \"\\n <th>\".$val.\"</th>\";\n }\n echo \"\\n </tr>\";\n\n //create data rows\n for ($i=0; $i <= $nrows; $i++) \n {\n $orderedRow = array_replace(array_flip($colOrder), $sliced[$i]);\n echo \"\\n <tr>\";\n foreach ($orderedRow as $key => $value) \n {\n if (!in_array($key, $excludeCols)) \n {\n echo \"\\n <td>\";\n switch ($key)\n {\n case \"albumart\":\n echo '<a href=\"'.$value.'\"><img src=\"'.$value.'\" alt=\"Album Art\" style=\"width:60px;height:60px;border:0;\"></a>'; \n case \"time\":\n echo date(\"D j M Y\",$value).\"<br>\".date(\"G:i:s\",$value);\n break;\n default:\n echo $value;\n } \n echo \"</td>\";\n }\n } \n echo \"\\n </tr>\";\n }\n echo \"</table></center>\";\n }", "protected function make_table_list($items_table=null, $items_list=null, $template_table=null, $template_list=null) {\n\t $toprint = null;\n\t\t$mytemplate_table = $this->select_template($template_table);\n\t\t$mytemplate_list = $this->select_template($template_list);\n\t\t$mytemplate_tablelist = $this->select_template('fpkatalog-grid-list');\n\t\t$tokens = array();\n\t\t\n if ($mytemplate_tablelist) { \n\t\t\n\t\t\t$table_token[] = (!empty($items_table)) ? implode('',$items_table) : null; \n\t\t\t//echo $table_token[0];\n\t\t\t$tokens[] = $this->combine_tokens($mytemplate_table, $table_token);\n\n\t\t\t$list_token[] = (!empty($items_list)) ? implode('',$items_list) : null; \n\t\t\t//echo $list_token[0];\n\t\t\t$tokens[] = $this->combine_tokens($mytemplate_list, $list_token);\n //print_r($tokens);\n\t\t\t$toprint = $this->combine_tokens($mytemplate_tablelist, $tokens);\n\t\t\t//echo $toprint;\n\t\t\tunset ($tokens);\n\t\t\tunset ($table_token);\n\t\t\tunset ($list_token);\n\t\t}\t\n return ($toprint); \t\t\n }", "protected function table()\n {\n return $this->getTable('loginLog')\n ->header([\n HeaderItem::label()->selection(),\n HeaderItem::label('登陆用户')->prop('login_name'),\n HeaderItem::label('登陆IP')->prop('login_ip'),\n HeaderItem::label('客户端')->prop('browser'),\n HeaderItem::label('系统')->prop('os'),\n HeaderItem::label('登陆状态')->prop('status')->component('status'),\n HeaderItem::label('登陆时间')->prop('login_at')->component('loginAt'),\n ])\n ->withApiRoute('log/login')\n ->withSearch([\n Search::startAt(),\n Search::label('结束时间')->endAt()\n ])\n ->selectionChange()\n ->render();\n\n }", "function createPlayerSummary() {\n $records = $this->Players->all();\n\n //Prime the table class to display player info. Wasn't sure what equity was though...\n $this->load->library('table');\n $parms = array(\n 'table_open' => '<table class=\"table-right-game\">',\n 'cell_start' => '<td class=\"player\">',\n 'cell_alt_start' => '<td class=\"player\">'\n );\n\n $this->table->set_template($parms);\n $this->table->set_heading('Player', 'Peanuts', 'Equity');\n\n foreach ($records as $row) {\n $this->table->add_row($row->Player, $row->Peanuts);\n }\n\n //Generate the table\n $this->data['wtable'] = $this->table->generate();\n }", "function createTable($result) {\n $table = \"<table class='table table-bordered'>\";\n $row = $result->fetch_assoc();\n $table .= \"<tr>\";\n foreach(array_keys($row) as $field) {\n $table .= \"<th class='text-center'>$field</th>\";\n }\n $table .= \"</tr>\";\n while($row) {\n $table .= \"<tr>\";\n foreach($row as $key => $value) {\n $table .= \"<td class='text-center'>\";\n if(strcmp($key, \"Price\") == 0 or strcmp($key, \"Revenue\") == 0) {\n $table.=\"\\$\" . number_format($value, 2, \".\", \"\");\n }\n else {\n $table .= $value;\n }\n $table.=\"</td>\";\n }\n $table .= \"</tr>\";\n $row = $result->fetch_assoc();\n }\n $table .= \"</table>\";\n return $table;\n }", "public function auto_build_list_thead(){\r\n\t\t$list_thead = \"<thead>\".\r\n\t\t\t\"<tr>\" .\r\n\t\t\t\"<th>#</th>\";\r\n\r\n\t\tforeach ($this->model->table_fields as $list_field)\r\n\t\t\tif ($list_field->get_visible_grid())\r\n\t\t\t\t$list_thead .= \"<th class='th-sm' >\" . ($list_field->get_label()) . \"</th>\";\r\n\r\n\t\treturn $list_thead . \"<th class='text-center'>Accion</th>\" .\r\n\t\t\t\"</tr>\" .\r\n\t\t\t\"</thead>\";\r\n\t}", "public function getTableDescription();", "public function get_display() {\n\t\t\t$output = '\n<table class=\"table mycred-table widefat log-entries table-striped\" cellspacing=\"0\">\n\t<thead>\n\t\t<tr>';\n\n\t\t\t// Table header\n\t\t\tforeach ( $this->headers as $col_id => $col_title ) {\n\t\t\t\t$output .= '<th scope=\"col\" id=\"' . str_replace( 'column-', '', $col_id ) . '\" class=\"manage-column ' . $col_id . '\">' . $col_title . '</th>';\n\t\t\t}\n\n\t\t\t$output .= '\n\t\t</tr>\n\t</thead>\n\t<tfoot>';\n\n\t\t\t// Table footer\n\t\t\tforeach ( $this->headers as $col_id => $col_title ) {\n\t\t\t\t$output .= '<th scope=\"col\" class=\"manage-column ' . $col_id . '\">' . $col_title . '</th>';\n\t\t\t}\n\n\t\t\t$output .= '\n\t</tfoot>\n\t<tbody id=\"the-list\">';\n\n\t\t\t// Loop\n\t\t\tif ( $this->have_entries() ) {\n\t\t\t\t$alt = 0;\n\t\t\t\t\n\t\t\t\tforeach ( $this->results as $log_entry ) {\n\t\t\t\t\t$row_class = apply_filters( 'mycred_log_row_classes', array( 'myCRED-log-row' ), $log_entry );\n\n\t\t\t\t\t$alt = $alt+1;\n\t\t\t\t\tif ( $alt % 2 == 0 )\n\t\t\t\t\t\t$row_class[] = ' alt';\n\n\t\t\t\t\t$output .= '<tr class=\"' . implode( ' ', $row_class ) . '\">';\n\t\t\t\t\t$output .= $this->get_the_entry( $log_entry );\n\t\t\t\t\t$output .= '</tr>';\n\t\t\t\t}\n\t\t\t}\n\t\t\t// No log entry\n\t\t\telse {\n\t\t\t\t$output .= '<tr><td colspan=\"' . count( $this->headers ) . '\" class=\"no-entries\">' . $this->get_no_entries() . '</td></tr>';\n\t\t\t}\n\n\t\t\t$output .= '\n\t</tbody>\n</table>' . \"\\n\";\n\n\t\t\treturn $output;\n\t\t}", "protected function getCleanableTableList() {}", "public function index()\n {\n return view('tables')->with([\n 'type' => 'tags',\n 'tags' => Tag::all(),\n ]);\n }", "public function tableList()\n {\n $list = (self::MODEL)::orderBy('clientes.created_at', 'DESC');\n $list = $this->handleRequest($list);\n\n return $this->listResponse(ClientTransformer::tableList($list));\n }", "function getTable(){\n\t\t\tglobal $page, $tableContent, $tableHeadings;\n\t\t\t// reset current page content\n\t\t\t$page = \"\";\n\t\t\t\n\t\t\t$page = '<div class=\"tableContainer\"><table class=\"twoCol\">';\n\t\t\t\n\t\t\t// make sure we have a header row, else skip\n\t\t\t/*\n\t\t\t$headerSize = count($tableHeadings);\n\t\t\tif($headerSize > 0){\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach ($tableHeadings as $h){\n\t\t\t\t\t$page = $page . '<td class = \"headerCell\">' . $h . '</td>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t$page = $page . '<tr class = \"tableHeader\">';\n\t\t\t\t\n\t\t\t\tforeach (array_keys($tableContent[0]) as $h){\n\t\t\t\t\t\n\t\t\t\t\t$page = $page . '<th class = \"headerCell\">' . $h . '</th>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\n\t\t\t\n\t\t\t// make sure we have table content to print\n\t\t\t\n\t\t\t$contentSize = count($tableContent);\n\t\t\t\n\t\t\tfor($i = 0; $i < $contentSize; $i++){\n\t\t\t\t$rowSize = count($tableContent[$i]);\n\t\t\t\t\n\t\t\t\t// vary row depending on odd/even\n\t\t\t\tif($i % 2){\n\t\t\t\t\t$page = $page . ('<tr class = \"odd\">');\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$page = $page . ('<tr class = \"even\">');\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// now build row content\n\t\t\t\t$oddevenCount = 0;\n\t\t\t\tforeach ($tableContent[$i] as $row){\n\t\t\t\t\t\n\t\t\t\t\t// vary cell tag depending on odd/even\n\t\t\t\t\tif($oddevenCount % 2){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$page = $page . '<td class = \"odd\">';\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\t$page = $page . '<td class = \"even\">';\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// add content\n\t\t\t\t\t$page = $page . $row;\n\t\t\t\t\t\n\t\t\t\t\t// close cell tag\n\t\t\t\t\t$page = $page . '</td>';\n\t\t\t\t\t$oddevenCount += 1;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// close row tag\n\t\t\t\t$page = $page . '</tr>';\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$page = $page . ('</table></div>');\n\t\t\t\n\t\t\treturn $page;\n\t\t}", "function print_table($database_connection, $table_name) {\r\n\r\n $attributes = get_attributes($database_connection, $table_name);\r\n $tuples = get_rows($database_connection, $table_name);\r\n\r\n print(\"<table>\\n\");\r\n print(\"<tr>\\n\");\r\n for($i = 0; $i < count($attributes); $i++) {\r\n print(\"<th>{$attributes[$i]}</th>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n for($j = 0; $j < count($tuples); $j++) {\r\n print(\"<tr>\\n\");\r\n foreach($attributes as $attribute) {\r\n print(\"<td>{$tuples[$j][$attribute]}</td>\\n\");\r\n }\r\n print(\"</tr>\\n\");\r\n }\r\n\r\n print(\"</table>\\n\");\r\n }", "public function showAthletesTable(){\r\n\t\t//fait le query voulu\r\n\t\t$stmt = $this->connect()->query(\"SELECT * FROM athletes\");\r\n\t\t//creer la table avec les tuples\r\n\t\techo \"<h3>Athletes Table</h3>\";\r\n\t\techo \"<table><tr><td>\" . \"id\" . \"</td><td>\" . \"name\" . \"</td><td>\" . \"identified_gender\" . \"</td><td>\" . \"email\" . \"</td><td>\" . \"date_of_birth\" . \"</td></tr>\";\r\n\t\twhile ($row = $stmt->fetch()) {\r\n\t\t\techo \"<tr><td>\" . $row['id'] . \"</td><td>\" . $row['name'] . \"</td><td>\" . $row['identified_gender'] . \"</td><td>\" . $row['email'] . \"</td><td>\" . $row['date_of_birth'] . \"</td></tr>\"; \r\n\t\t}\r\n\t\techo \"</table>\";\r\n\t}", "function createTable(array $results = array())\n{\n if (empty($results)) {\n return '<table><tr><td>Empty Result Set</td></tr></table>';\n }\n\n // dynamically create the header information from the keys\n // of the result array from mysql\n $table = '<table>';\n $keys = array_keys(reset($results));\n $table.='<thead><tr>';\n foreach ($keys as $key) {\n $table.='<th><mark>&nbsp;'.$key.'&nbsp;</mark></th>';\n }\n $table.='</tr></thead>';\n\n // populate the main table body\n $table.='<tbody>';\n foreach ($results as $result) {\n $table.='<tr>';\n foreach ($result as $val) {\n $table.='<td><mark>&nbsp;'.$val.'&nbsp;</mark></td>';\n }\n $table.='</tr>';\n }\n $table.='</tbody></table>';\n return $table;\n}", "public function listtabelSDMAction() {\n $this->view->tableList = $this->adm_listtabel_serv->getTableList('SDM');\n }", "public function tableList()\n {\n $list = (self::MODEL)\n ::join('product_imeis', 'product_imeis.id', 'product_defects.product_imei_id')\n ->join('produtos', 'produtos.sku', 'product_defects.product_sku')\n ->with([\n 'productImei',\n 'product',\n ])\n ->orderBy('created_at', 'DESC');\n\n $list = $this->handleRequest($list);\n\n return $this->listResponse(ProductDefectTransformer::tableList($list));\n }", "protected function setupListOperation()\n {\n\n $this->crud->setColumns([\n [ \n 'name' => 'id',\n 'label' => 'ID',\n 'type' => 'number',\n\n ],\n [\n 'name' => 'name',\n 'type' => 'text',\n 'label' => 'Customer',\n 'orderable' => false,\n ],\n [\n 'name' => 'target',\n 'type' => 'number',\n 'label' => 'Target',\n 'orderable' => false,\n ],\n [\n // non-relationship count\n 'name' => 'Machines', // name of relationship method in the model\n 'type' => 'relationship_count', \n 'label' => 'Machines', // Table column heading\n // OPTIONAL\n 'suffix' => '', // to show \"123 tags\" instead of \"123 items\"\n ],\n [\n 'name' => 'balance',\n 'type' => 'text',\n 'label' => 'Balance',\n ],\n [ \n // any type of relationship\n 'name' => 'User', // name of relationship method in the model\n 'type' => 'relationship',\n 'label' => 'Collector', // Table column heading\n // OPTIONAL\n // 'entity' => 'tags', // the method that defines the relationship in your Model\n // 'attribute' => 'name', // foreign key attribute that is shown to user\n // 'model' => App\\Models\\Category::class, // foreign key model\n ],\n ]);\n\n }", "static function generateTableHeaderHTML()\n\t{\n\t\techo \"<p class=left>Description:</p>\\n\";\n\t}", "public static function buildTable($data)\r\n {\r\n $table = '<table class=\"table table-hover\">';\r\n // Create the table header row\r\n $header = '<tr>';\r\n foreach ( $data[ 0 ] as $key => $cell ) {\r\n $header .= '<th>' . $key . '</th>';\r\n }\r\n $header .= '</tr>';\r\n // Add the header to the table\r\n $table .= $header;\r\n // Build the table rows\r\n $rowHTML = '';\r\n // Loop through each row of data and build a row\r\n foreach ( $data as $row ) {\r\n $rowHTML .= '<tr>';\r\n // Loop through each cell and create the cells\r\n foreach ( $row as $cell ) {\r\n $rowHTML .= '<td>' . $cell . '</td>';\r\n }\r\n $rowHTML .= '</tr>';\r\n }\r\n // Add the rows to the table\r\n $table .= $rowHTML;\r\n // Close out the table\r\n $table .= '</table>';\r\n return $table;\r\n }", "public function json_table() {\n\t\t\techo json_encode($this->populate_rows());\n\t\t}", "public function buildTable()\n {\n\n $view = View::getActive();\n\n // Creating the Head\n $head = '<thead class=\"ui-widget-header\" >'.NL;\n $head .= '<tr>'.NL;\n\n $head .= '<th >Project Name</th>'.NL;\n //$head .= '<th>File</th>'.NL;\n $head .= '<th >Description</th>'.NL;\n $head .= '<th style=\"width:165px\" >Nav</th>'.NL;\n\n $head .= '</tr>'.NL;\n $head .= '</thead>'.NL;\n //\\ Creating the Head\n\n // Generieren des Bodys\n $body = '<tbody class=\"ui-widget-content\" >'.NL;\n\n $num = 1;\n foreach ($this->data as $key => $row) {\n $rowid = $this->name.\"_row_$key\";\n\n $body .= \"<tr class=\\\"row$num\\\" id=\\\"$rowid\\\" >\";\n\n $urlConf = 'index.php?c=Daidalos.Projects.genMask&amp;objid='.urlencode($key);\n $linkConf = '<a title=\"GenMask\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlConf.'\">'\n .Wgt::icon('daidalos/bdl_mask.png' , 'xsmall' , 'build').'</a>';\n\n $urlGenerate = 'index.php?c=Genf.Bdl.build&amp;objid='.urlencode($key);\n $linkGenerate = '<a title=\"Code generieren\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlGenerate.'\">'\n .Wgt::icon('daidalos/parser.png' , 'xsmall' , 'build').'</a>';\n\n\n $urlDeploy = 'index.php?c=Genf.Bdl.deploy&amp;objid='.urlencode($key);\n $linkDeploy = '<a title=\"Deploy the Project\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlDeploy.'\">'\n .Wgt::icon('genf/deploy.png' , 'xsmall' , 'deploy').'</a>';\n\n $urlRefreshDb = 'index.php?c=Genf.Bdl.refreshDatabase&amp;objid='.urlencode($key);\n $linkRefreshDb = '<a title=\"Refresh the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlRefreshDb.'\">'\n .Wgt::icon('daidalos/db_refresh.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlSyncDb = 'index.php?c=Genf.Bdl.syncDatabase&amp;objid='.urlencode($key);\n $linkSyncDb = '<a title=\"Sync the database with the model\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlSyncDb.'\">'\n .Wgt::icon('daidalos/db_sync.png' , 'xsmall' , 'sync db').'</a>';\n\n $urlPatchDb = 'index.php?c=Genf.Bdl.createDbPatch&amp;objid='.urlencode($key);\n $linkPatchDb = '<a title=\"Create an SQL Patch to alter the database\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlPatchDb.'\" >'\n .Wgt::icon('genf/dump.png' , 'xsmall' , 'create alter patch').'</a>';\n\n $urlClean = 'index.php?c=Genf.Bdl.clean&amp;objid='.urlencode($key);\n $linkClean = '<a title=\"Projekt cleanen\" class=\"wcm wcm_req_ajax wgt_info\" href=\"'.$urlClean.'\">'\n .Wgt::icon('genf/clean.png' , 'xsmall' , 'clean').'</a>';\n\n $body .= '<td valign=\"top\" >'.$row[0].'</td>'.NL;\n //$body .= '<td valign=\"top\" >'.$row[1].'</td>'.NL;\n $body .= '<td valign=\"top\" >'.$row[2].'</td>'.NL;\n $body .= '<td valign=\"top\" align=\"center\" >'.$linkConf.' | '.$linkGenerate.$linkDeploy.' | '.$linkSyncDb.' '.$linkRefreshDb.' '.$linkPatchDb.' | '.$linkClean.'</td>'.NL;\n\n $body .= '</tr>'.NL;\n\n $num ++;\n if ($num > $this->numOfColors)\n $num = 1;\n\n }// ENDE FOREACH\n\n $body .= \"</tbody>\".NL;\n //\\ Generieren des Bodys\n\n $html ='<table id=\"table_'.$this->name.'\" class=\"full\" >'.NL;\n $html .= $head;\n $html .= $body;\n $html .= '</table>'.NL;\n\n return $html;\n\n }", "function DisplayDBasTable($db, $sql, $showID)\n {\n $showHeader=true;\n \t$result = $db->query($sql);\n //echo $sql . '<br>';\n \techo \"<table border='1'>\";\n \t$rowCounter=0;\n \twhile ($row = $result->fetch_assoc()){\n \t $rowCounter++;\n if ($showHeader)\n {\n \t\techo \"<tr onclick='myFolderFunction(this)'>\";\n \t foreach ($row as $key => $value)\n \t {\n \t\t\tif (($showID) || ($key!='id'))\n \t\t\t{\n \t\t\t echo \"<th>$key</th>\";\n \t\t\t};\n \t\t};\n \t\techo \"</tr>\";\n $showHeader=false;\n };\n reset($row);\n debug_to_console($rowCounter);\n \t echo \"<tr\";\n if($rowCounter%2 > 0){ \n echo \" class='even'\";\n } \n else{ \n \n };\n echo \" onclick='myFolderFunction(this)'>\";\n \t foreach ($row as $key => $value)\n \t {\n \t\t\tif (($showID) || ($key!='id'))\n \t\t\t{\n \t\t echo '<td>'.$value . ' </td>';\n \t\t\t};\n \t };\n \t\techo \"</tr>\";\n \t};\n \techo \"</table>\";\n \treturn true;\n }", "protected function buildTable(): string\n {\n $sql = '';\n\n if ( empty($this->tableInto) )\n {\n return $sql;\n }\n\n $sql .= 'INTO' . PHP_EOL;\n $sql .= $this->indent();\n $sql .= $this->tableInto . PHP_EOL;\n\n return $sql;\n }", "public function getTableStructure(Request $request) {\n $table = $request->table;\n return json_encode(DB::select(\"describe $table\"));\n }", "function tt_render_list_page(){\n\t\n\t//Create an instance of our package class...\n\t$testListTable = new TT_Example_List_Table();\n\t//Fetch, prepare, sort, and filter our data...\n\t$testListTable->prepare_items();\n\t\n\t?>\n\t<div class=\"wrap\">\n\t\t\n\t\t<div id=\"icon-users\" class=\"icon32\"><br/></div>\n\t\t<h2>List Table Test</h2>\n\t\t\n\t\t<div style=\"background:#ECECEC;border:1px solid #CCC;padding:0 10px;margin-top:5px;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;\">\n\t\t\t<p>This page demonstrates the use of the <tt><a href=\"http://codex.wordpress.org/Class_Reference/WP_List_Table\" target=\"_blank\" style=\"text-decoration:none;\">WP_List_Table</a></tt> class in plugins.</p> \n\t\t\t<p>For a detailed explanation of using the <tt><a href=\"http://codex.wordpress.org/Class_Reference/WP_List_Table\" target=\"_blank\" style=\"text-decoration:none;\">WP_List_Table</a></tt>\n\t\t\tclass in your own plugins, you can view this file <a href=\"<?php echo admin_url( 'plugin-editor.php?plugin='.plugin_basename(__FILE__) ); ?>\" style=\"text-decoration:none;\">in the Plugin Editor</a> or simply open <tt style=\"color:gray;\"><?php echo __FILE__ ?></tt> in the PHP editor of your choice.</p>\n\t\t\t<p>Additional class details are available on the <a href=\"http://codex.wordpress.org/Class_Reference/WP_List_Table\" target=\"_blank\" style=\"text-decoration:none;\">WordPress Codex</a>.</p>\n\t\t</div>\n\t\t\n\t\t<!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions -->\n\t\t<form id=\"movies-filter\" method=\"get\">\n\t\t\t<!-- For plugins, we also need to ensure that the form posts back to our current page -->\n\t\t\t<input type=\"hidden\" name=\"page\" value=\"<?php echo $_REQUEST['page'] ?>\" />\n\t\t\t<!-- Now we can render the completed list table -->\n\t\t\t<?php $testListTable->display() ?>\n\t\t</form>\n\t\t\n\t</div>\n\t<?php\n}", "function wv_commission_table_heading_list($type = \"thead\") {\n $output = \"\";\n\n //verify the header and footer of the table list\n $type = ($type == \"thead\") ? \"thead\" : \"tfoot\";\n\n $output .=\"<$type>\";\n $output .=\" <tr>\n <th>#OrderId</th>\n <th>Order Date</th>\n <th>ProductName</th>\n <th>Vendor</th>\n <th>Commission</th>\n <th>Status</th>\n <th>Commission Date</th>\n </tr>\";\n\n $output .=\"</$type>\";\n return $output;\n }", "function _showTables() {\n print \"<pre>\";\n print_r($this->_tables);\n print \"</pre>\";\n }", "function index() {\n\n\t\t\t\t\t/* @param partnerMenu is an array containing all Partner Company records in database.\n\t\t\t\t\t * Used to display the company names in our drop-down menu.\n\t\t\t\t\t * Could be refactored to only retrieve Name column from records.\n\t\t\t\t\t * If refactored currentPartner must also be refactored since it requires a complete record object. */\n\n\t\t\t\t\t$partnerMenu = allPartnersAscending();\n\t\t\t\t\t\n\t\t\t\t\t/* @param currentPartner determines which partner company we are displaying in the table. */\n\t\t\t\t\t$currentPartner = $partnerMenu[0];\n\t\t\t\t\t\n\t\t\t\t\t/* @param skillsArray is an array of all skills required by given Partner company. */\n\t\t\t\t\t$skillsArray = getCompanySkills($currentPartner);\n\t\t\t\t\t\n\t\t\t\t\t/* @param apprenticeArray is an array containing all Apprentice records in database. */\n\t\t\t\t\t$apprenticeArray = Apprentice::all();\n\n\t\t\t\t\t/* h2o calls 'table.html'. */\n\t\t\t\t\t/* Since 'table.html' inherits from 'base.html' the application will automatically load 'base.html' as well. */\n\t\t\t\t\t$index = new h2o('views/table.html');\n\t\t\t\t\techo $index->render(compact('partnerMenu','currentPartner','skillsArray','apprenticeArray'));\n\t\t\t\t}", "public function getTables()\n {\n global $adminer;\n\n $main_actions = [\n 'add-table' => \\adminer\\lang('Create table'),\n ];\n\n $headers = [\n \\adminer\\lang('Table'),\n \\adminer\\lang('Engine'),\n \\adminer\\lang('Collation'),\n // \\adminer\\lang('Data Length'),\n // \\adminer\\lang('Index Length'),\n // \\adminer\\lang('Data Free'),\n // \\adminer\\lang('Auto Increment'),\n // \\adminer\\lang('Rows'),\n \\adminer\\lang('Comment'),\n ];\n\n // From db.inc.php\n // $table_status = \\adminer\\table_status('', true); // Tables details\n $table_status = \\adminer\\table_status(); // Tables details\n\n $details = [];\n foreach($table_status as $table => $status)\n {\n if(!\\adminer\\is_view($status))\n {\n $details[] = [\n 'name' => $adminer->tableName($status),\n 'engine' => \\array_key_exists('Engine', $status) ? $status['Engine'] : '',\n 'collation' => '',\n 'comment' => \\array_key_exists('Comment', $status) ? $status['Comment'] : '',\n ];\n }\n }\n\n $select = \\adminer\\lang('Select');\n return \\compact('main_actions', 'headers', 'details', 'select');\n }", "function getTableList(){\n\t\t// Process the query string and exclude querystring named \"p\"\n\t\tif (!empty($_SERVER['QUERY_STRING'])) {\n\t\t\t$qrystr = explode(\"&\",$_SERVER['QUERY_STRING']);\n\t\t\tforeach ($qrystr as $value) {\n\t\t\t\t$qstr = explode(\"=\",$value);\n\t\t\t\tif ($qstr[0]!=\"p\") {\n\t\t\t\t\t$arrQryStr[] = implode(\"=\",$qstr);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$aQryStr = $arrQryStr;\n\t\t\t$aQryStr[] = \"p=@@\";\n\t\t\t$queryStr = implode(\"&\",$aQryStr);\n\t\t}\n\n\t\t//bby: search module\n\t\t$qry = array();\n\t\tif (isset($_REQUEST['search_field'])) {\n\n\t\t\t// lets check if the search field has a value\n\t\t\tif (strlen($_REQUEST['search_field'])>0) {\n\t\t\t\t// lets assign the request value in a variable\n\t\t\t\t$search_field = $_REQUEST['search_field'];\n\n\t\t\t\t// create a custom criteria in an array\n\t\t\t\t$qry[] = \"mnu_name like '%$search_field%'\";\n\n\t\t\t}\n\t\t}\n\n\t\t// put all query array into one criteria string\n\t\t$criteria = (count($qry)>0)?\" where \".implode(\" and \",$qry):\"\";\n\n\t\t// Sort field mapping\n\t\t$arrSortBy = array(\n\t\t \"viewdata\"=>\"viewdata\"\n\t\t,\"mnu_name\"=>\"mnu_name\"\n\t\t,\"mnu_link\"=>\"mnu_link\"\n\t\t,\"mnu_ord\"=>\"mnu_ord\"\n\t\t);\n\n\t\tif(isset($_GET['sortby'])){\n\t\t\t$strOrderBy = \" order by \".$arrSortBy[$_GET['sortby']].\" \".$_GET['sortof'];\n\t\t}\n\n\t\t// Add Option for Image Links or Inline Form eg: Checkbox, Textbox, etc...\n\t\t$viewLink = \"\";\n\t\t$editLink = \"<a href=\\\"?statpos=tax&edit=',am.mnu_id,'\\\"><img src=\\\"\".SYSCONFIG_DEFAULT_IMAGES_INCTEMP.\"icons/edited/edit.png\\\" title=\\\"Edit\\\" hspace=\\\"2px\\\" border=0 width=\\\"16\\\" height=\\\"16\\\"></a>\";\n\t\t$delLink = \"<a href=\\\"?statpos=tax&delete=',am.mnu_id,'\\\" onclick=\\\"return confirm(\\'Are you sure, you want to delete?\\');\\\"><img src=\\\"\".SYSCONFIG_DEFAULT_IMAGES_INCTEMP.\"icons/edited/delete.png\\\" title=\\\"Delete\\\" hspace=\\\"2px\\\" border=0 width=\\\"16\\\" height=\\\"16\\\"></a>\";\n\n\t\t// SqlAll Query\n\t\t$sql = \"select am.*, CONCAT('$viewLink','$editLink','$delLink') as viewdata\n\t\t\t\t\t\tfrom app_modules am\n\t\t\t\t\t\t$criteria\n\t\t\t\t\t\t$strOrderBy\";\n\n\t\t// Field and Table Header Mapping\n\t\t$arrFields = array(\n\t\t \"viewdata\"=>\"Action\"\n\t\t,\"mnu_name\"=>\"Module Name\"\n\t\t,\"mnu_link\"=>\"Link\"\n\t\t,\"mnu_ord\"=>\"Order\"\n\t\t);\n\n\t\t// Column (table data) User Defined Attributes\n\t\t$arrAttribs = array(\n\t\t\"mnu_ord\"=>\" align='center'\",\n\t\t\"viewdata\"=>\"width='50' align='center'\"\n\t\t);\n\n\t\t// Process the Table List\n\t\t$tblDisplayList = new clsTableList($this->conn);\n\t\t$tblDisplayList->arrFields = $arrFields;\n\t\t$tblDisplayList->paginator->linkPage = \"?$queryStr\";\n\t\t$tblDisplayList->sqlAll = $sql;\n\t\t$tblDisplayList->sqlCount = $sqlcount;\n\n\t\treturn $tblDisplayList->getTableList($arrAttribs);\n\t}" ]
[ "0.7007589", "0.678785", "0.6782046", "0.6740639", "0.6514125", "0.6513527", "0.64687353", "0.6380533", "0.63751704", "0.6288956", "0.6286187", "0.6282498", "0.62622255", "0.62552774", "0.61742663", "0.6172575", "0.617086", "0.61614126", "0.614921", "0.6133383", "0.61222965", "0.61174196", "0.60760975", "0.6069218", "0.60499305", "0.60446477", "0.6033479", "0.60276484", "0.6015125", "0.5975456", "0.5969977", "0.59663427", "0.5954929", "0.59491754", "0.5948078", "0.5947538", "0.59453785", "0.59422535", "0.5936526", "0.5917564", "0.5917357", "0.5915194", "0.59150714", "0.591056", "0.58966476", "0.5896542", "0.5885013", "0.5881184", "0.5880899", "0.587244", "0.5866795", "0.58664584", "0.58622867", "0.58604544", "0.58598596", "0.5857463", "0.5856579", "0.58552456", "0.58518755", "0.5843486", "0.58345646", "0.5832101", "0.5825446", "0.58246946", "0.58244234", "0.5817347", "0.5813943", "0.58063614", "0.5805973", "0.5801971", "0.5801939", "0.5797113", "0.5796606", "0.57930815", "0.57835263", "0.5779029", "0.57787186", "0.57767075", "0.57706296", "0.5762455", "0.5762233", "0.5759992", "0.5759174", "0.57543886", "0.5751747", "0.5744751", "0.57440567", "0.5742987", "0.57414526", "0.57410336", "0.573777", "0.57216674", "0.57209593", "0.57117647", "0.57062584", "0.5698908", "0.5696232", "0.5696196", "0.56943536", "0.5688928", "0.56878144" ]
0.0
-1
Get footer for table.
public function getFooter($decodedJsonFeedData) { $footer = []; if(isset($decodedJsonFeedData['data']['previous_page'])) { $parsed_url_previous_page = UrlHelper::parse($decodedJsonFeedData['data']['previous_page']); $footer['data'][] = $this->getPagerLinks($parsed_url_previous_page, '‹ Previous'); } if(!$this->isFeedChecked()) { $footer['data'][] = t('Page: ') . $decodedJsonFeedData['data']['current_page']; } if(isset($decodedJsonFeedData['data']['next_page'])) { if($this->isFeedChecked()) { $parsed_url_next_page = UrlHelper::parse($decodedJsonFeedData['data']['next_page']); $footer['data'][] = $this->getPagerLinks($parsed_url_next_page, 'More ›'); return $footer; } $parsed_url_next_page = UrlHelper::parse($decodedJsonFeedData['data']['next_page']); $footer['data'][] = $this->getPagerLinks($parsed_url_next_page, 'Next ›'); } return $footer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function getFooter();", "public function getFooter();", "public static function getFooter()\n {\n return self::$_footer;\n }", "private function createTableFooter() {\n\t\treturn \"</table>\\n\";\n\t}", "public function getFooter()\n {\n $this->smarty->assign(array(\n 'id_everpsquotation_quotes' => $this->id_everpsquotation_quotes,\n 'everpsquotationtext' => $this->text,\n ));\n return $this->smarty->fetch($this->pdfDir . '/everquotation_footer.tpl');\n }", "public function renderTableFooter() {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderFooterCell();\n }\n $content = Widget::html()->tag('table-row', array('content' => implode('', $cells), 'options' => $this->footerRowOptions), $this->footerRowOptions);\n if ($this->filterPosition == self::FILTER_POS_FOOTER) {\n $content .= $this->renderFilters();\n }\n\n return \"<tfoot>\\n\" . $content . \"\\n</tfoot>\";\n }", "public function getFooter()\n {\n return $this->getValue('nb_catalog_item_lang_footer');\n }", "public function renderTableFooter()\n {\n $cells = [];\n foreach ($this->columns as $column) {\n /* @var $column Column */\n $cells[] = $column->renderFooterCell();\n }\n $content = Html::tag('tr', implode('', $cells), $this->footerRowOptions);\n if ($this->filterPosition === self::FILTER_POS_FOOTER) {\n $content .= $this->renderFilters();\n }\n\n return \"<tfoot>\\n\" . $content . \"\\n</tfoot>\";\n }", "public function getFooter()\n {\n $this->assignCommonFooterDataForSeller();\n $objModule = new MpSellerInvoice();\n $this->context->smarty->assign(array(\n 'footer' => $objModule->l('Seller Invoice'),\n ));\n\n return $this->context->smarty->fetch($this->getTemplate('sellerinvoice_footer'));\n }", "public function get_foot()\n\t{\n\t\treturn $this->footer_item;\n\t}", "function\ttableFoot() {\n\n\t\t/**\n\t\t *\n\t\t */\n\t\t$frm\t=\t$this->myDoc->currMasterPage->getFrameByFlowName( \"Auto\") ;\n\t\tif ( $this->myDoc->pageNr >= 1) {\n\t\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterCT) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t\tif ( $actRow->isEnabled()) {\n\t\t\t\t\t$this->punchTableRow( $actRow) ;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everything we have output'\n\t\t}\n\t\tfor ( $actRow=$this->myTable->getFirstRow( BRow::RTFooterPE) ; $actRow !== FALSE ; $actRow=$this->myTable->getNextRow()) {\n\t\t\t$this->punchTableRow( $actRow) ;\n\t\t}\n\t\t$frm->currVerPos\t+=\t1.5 ;\t\t// now add the height of everythign we have output'\n\t}", "public function print_footer() {\n return $this->footer();\n }", "public function getFooterTpl(){\n return $this->templates['footer'];\n }", "public function docbookFooter()\n {\n $output = <<<'EOS'\n </tbody>\n </tgroup>\n</table>\n\n</section>\n<!--\nvim:se ts=4 sw=4 et:\n-->\n\nEOS;\n\n return $output;\n }", "public static function getFooter()\n {\n ?>\n <p>Content in the front end's footer. This code comes from <?php echo __METHOD__; ?></p>\n <?php\n }", "function showTableFooter() {\n\techo \"\t</tbody>\";\n\techo \"</table>\";\n}", "public function addTableFooter() {\n // auto width\n foreach ($this->_tableParams['auto_width'] as $col)\n $this->_xls->getActiveSheet()->getColumnDimensionByColumn($col)->setAutoSize(true);\n\n // filter (has to be set for whole range)\n if (count($this->_tableParams['filter']))\n $this->_xls->getActiveSheet()->setAutoFilter(PHPExcel_Cell::stringFromColumnIndex($this->_tableParams['filter'][0]) . ($this->_tableParams['header_row']) . ':' . PHPExcel_Cell::stringFromColumnIndex($this->_tableParams['filter'][count($this->_tableParams['filter']) - 1]) . ($this->_tableParams['header_row'] + $this->_tableParams['row_count']));\n\n // wrap\n foreach ($this->_tableParams['wrap'] as $col)\n $this->_xls->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($col) . ($this->_tableParams['header_row'] + 1) . ':' . PHPExcel_Cell::stringFromColumnIndex($col) . ($this->_tableParams['header_row'] + $this->_tableParams['row_count']))->getAlignment()->setWrapText(true);\n\n return $this;\n }", "public function addTableFooter() {\n\t\t// auto width\n\t\tforeach ($this->tableParams['auto_width'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getColumnDimensionByColumn($col)->setAutoSize(true);\n\t\t// filter (has to be set for whole range)\n\t\tif (count($this->tableParams['filter']))\n\t\t\t$this->xls->getActiveSheet()->setAutoFilter(PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][0]).($this->tableParams['header_row']).':'.PHPExcel_Cell::stringFromColumnIndex($this->tableParams['filter'][count($this->tableParams['filter']) - 1]).($this->tableParams['header_row'] + $this->tableParams['row_count']));\n\t\t// wrap\n\t\tforeach ($this->tableParams['wrap'] as $col)\n\t\t\t$this->xls->getActiveSheet()->getStyle(PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + 1).':'.PHPExcel_Cell::stringFromColumnIndex($col).($this->tableParams['header_row'] + $this->tableParams['row_count']))->getAlignment()->setWrapText(true);\n\t}", "public function footer() {\n\t\tRequirements::clear();\n\n\t\t$templates = ['Grasenhiller\\WkHtmlToX\\PdfFooter'];\n\t\t$data = $this->getHeaderFooterVariables();\n\n\t\tif (isset($data['template']) && $data['template']) {\n\t\t\t$templates[] = $data['template'];\n\t\t}\n\n\t\t$this->extend('updateFooter', $templates, $data);\n\n\t\treturn $this\n\t\t\t->customise($data)\n\t\t\t->renderWith(array_reverse($templates));\n\t}", "function magazinevibe_edge_get_footer_bottom() {\n\n\t\t$parameters = array();\n\n\t\t$parameters['footer_in_grid'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? true : false;\n $parameters['footer_bottom_classes'] = (magazinevibe_edge_options()->getOptionValue('footer_in_grid') == 'yes') ? '' : 'edgtf-footer-top-full';\n\t\t$parameters['footer_bottom_columns'] = magazinevibe_edge_options()->getOptionValue('footer_bottom_columns');\n\n\t\tmagazinevibe_edge_get_module_template_part('templates/parts/footer-bottom', 'footer', '', $parameters);\n\t}", "protected function renderFooter($html)\n\t{\n\t\t$hasFooter = false;\n\n\t\t$footer = '<tr>';\n\n\t\t$emptyCount = 1;\n\n\t\tforeach ($this->columns as $column) {\n\t\t\t// Do only something if we have a footer.\n\t\t\tif (isset($column['footerData'])) {\n\n\t\t\t\t$hasFooter = true;\n\n\t\t\t\t// Render the empty cells before.\n\t\t\t\tif ($emptyCount > 0) {\n\t\t\t\t\t$footer .= '<td colspan=\"'. $emptyCount .'\"></td>';\n\t\t\t\t\t$emptyCount = 0;\n\t\t\t\t}\n\n\n\t\t\t\t$dataContainer = $column['footerData'];\n\t\t\t\tif (is_string($dataContainer)) {\n\t\t\t\t\t// Just show the static string\n\t\t\t\t\t$footer .= '<td>' . $dataContainer . \"</td>\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$rf = new \\ReflectionFunction($dataContainer);\n\t\t\t\t\tif ($rf->isClosure()) {\n\n\t\t\t\t\t\t// Call the closure and get the result\n\t\t\t\t\t\t$value = $dataContainer($this->getData(), $this);\n\n\t\t\t\t\t\t$footer .= \"<td>\". $value .\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\t// Let's remember how many empty cell there was.\n\t\t\t\t$emptyCount++;\n\t\t\t}\n\t\t}\n\n\t\t// Render empty cells (if we have)\n\t\tif ($emptyCount > 0) {\n\t\t\t$footer .= '<td colspan=\"'. $emptyCount .'\"></td>';\n\t\t}\n\n\t\t$footer .= \"</tr>\";\n\n\t\tif ($hasFooter) {\n\t\t\t$html .= $footer;\n\t\t}\n\n\t\treturn $html;\n\t}", "public function footer()\n\t\t{\t\t\t\n\t\t\treturn $this->render('incs/footer');\n\t\t}", "public function getFooterOrder()\n {\n return $this->footer_order;\n }", "public function getFooterOrder()\n {\n return $this->footer_order;\n }", "public function footer_info()\n {\n $this->db->order_by('id',\"DESC\");\n $res = $this->db->get('footer_info')->row_array();\n\n // print_r($res);\n return $res;\n }", "function tabletfoot_close() {\n $this->doc .= DOKU_TAB.'</tfoot>'.DOKU_LF;\n }", "protected function makeFooter()\n {\n }", "private function getFooter(){\n\t$out = <<<EOT\n </body>\n </text>\n</TEI>\nEOT;\n\treturn $out;\t\n}", "public function drawFooter() {\n\t\t\t// Is there scope for using Smarty or similar here?\n\t\t\t$html = '';\n\t\t\treturn $html;\n\t\t}", "public function toFooterHtml()\n {\n return $this->getChildHtml('footer.' . $this->getNameInLayout());\n }", "public function getFooterCode() {\n\n\t\t$scripts = (array) $this->getMeta( App::s()->getPrefix( '_scripts' ), array() );\n\n\t\treturn isset( $scripts['footer'] ) ? $scripts['footer'] : '';\n\n\t}", "public function footer($value) {\n return $this->setProperty('footer', $value);\n }", "public function Footer(){\n // Position at 15 mm from bottom\n $this->SetY(-15);\n // Set font\n\t\t$html = \"<table>\";\n\t\t$html .= \"<tr><td>unidad de adm y serv</td><td>responsable del proyecto o accion centralizada</td><td>unidad de finanzas</td><td>unidad de planificacion ppto</td><td>presidente</td><td>secreatria de adcripcion</td><td>Secretaria de Planificacion presupuesto y control de gestion</td><td>Gobernador del estado</td></tr>\";\n\t\t$html .= \"<tr><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td><td>.</td></tr>\";\n\t\t$html .= \"</table>\";\n\t\t$this->writeHTMLCell($w = 0, $h = 0, $x = '', $y = '', $html, $border = 0, $ln = 1, $fill = 0, $reseth = true, $align = '', $autopadding = true);\n $this->SetFont('helvetica', 'I', 8);\n // Page number\n $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n }", "private function row_foot() {\n\t\t\t\n\t\t$row_foot = '<div class=\"adv_listing_mid\"><hr class=\"listing_divisor\" /></div>'.LB;\n\t\t\t\n\treturn $row_foot;\n\t}", "public function getFooterHTML()\n\t{\n\t\tif(!is_array($this->elements['footer'])){\n\t\t\t// Footers are optional\n\t\t\treturn false;\n\t\t}\n\n\t\t# Add the required Bootstrap footer class very first\n\t\t$this->elements['footer']['class'] = str::getAttrArray($this->elements['footer']['class'], \"modal-footer\", $this->elements['footer']['only_class']);\n\n\t\t# Styles\n\t\t$this->elements['footer']['style'] = str::getAttrArray($this->elements['footer']['style'], NULL, $this->elements['footer']['only_style']);\n\n\t\t# Dropdown buttons\n\t\tif($this->elements['footer']['buttons']){\n\t\t\t$buttons = Button::get($this->elements['footer']);\n\t\t}\n\n\t\t# Button(s) in a row\n\t\t$button = Button::generate($this->elements['footer']['button']);\n\n\t\tif($button){\n\t\t\t$button = \"<div class=\\\"btn-float-right\\\">{$button}</div>\";\n\t\t}\n\n\t\t# Icon\n\t\t$icon = Icon::generate($this->elements['footer']['icon']);\n\n\t\t# Badge\n\t\t$badge = Badge::generate($this->elements['footer']['badge']);\n\n\t\t# ID\n\t\t$id = str::getAttrTag(\"id\", $this->elements['footer']['id']);\n\n\t\t# Style\n\t\t$style = str::getAttrTag(\"style\", $this->elements['footer']['style']);\n\n\t\t# Text colour\n\t\t$class[] = str::getColour($this->elements['footer']['colour']);\n\n\t\t# Draggable\n\t\t$class[] = $this->draggable ? \"modal-footer-draggable\" : false;\n\n\t\t# Script\n\t\t$script = str::getScriptTag($this->elements['footer']['script']);\n\n\t\t# The div class\n\t\t$class = str::getAttrTag(\"class\", $this->elements['footer']['class']);\n\n\t\t# Only include left side if it has values (or a custom ID)\n\t\tif(($left = $icon . $this->elements['footer']['html'] . $badge) || $id){\n\t\t\t$left = \"<div class=\\\"col-auto\\\">{$left}</div>\";\n\t\t}\n\n\t\t# Only include right side if it has values (buttons)\n\t\tif($right = $buttons . $button){\n\t\t\t$right = \"<div class=\\\"col\\\">{$right}</div>\";\n\t\t}\n\n\t\treturn <<<EOF\n<div{$id}{$class}{$style}>\n\t<div class=\"container\">\n \t\t<div class=\"row\">\n \t\t{$left}\n \t\t{$right} \t\t\n \t</div>\n\t</div>{$script}\n</div>\nEOF;\n\n\t}", "public function getFooter()\n { \n $footer = PageFooter::where('status', PageFooter::ACTIVE)->first();\n $footerLink = FooterLink::where('status', FooterLink::ACTIVE)->orderBy('id', 'desc')->take(10)->get();\n\n $data['footer_sidebar'] = $footer;\n $data['footer_sidebar_link'] = $footerLink;\n return $data;\n }", "public static function getFooterTags(): string {\n if (self::$tests) {\n return '';\n }\n\n return self::$footer['before'].self::$footer['after'].self::$footer['end'];\n }", "public function footer()\n {\n $footer = \"\\t</body>\\n</html>\";\n echo $footer;\n }", "function output_footer($footer, $cols)\n {\n $output_html = '';\n $output_html .= '<tr>';\n $output_html .= '<td colspan=\"' . $cols . '\">' . $footer . '</td>';\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_footer($footer, $cols)\n {\n $output_html = '';\n $output_html .= '<tr>';\n $output_html .= '<td colspan=\"' . $cols . '\">' . $footer . '</td>';\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_footer($footer, $cols)\n {\n $output_html = '';\n $output_html .= '<tr>';\n $output_html .= '<td colspan=\"' . $cols . '\">' . $footer . '</td>';\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_footer($footer, $cols)\n {\n $output_html = '';\n $output_html .= '<tr>';\n $output_html .= '<td colspan=\"' . $cols . '\">' . $footer . '</td>';\n $output_html .= '</tr>';\n return $output_html;\n }", "function output_footer($footer, $cols)\n {\n $output_html = '';\n $output_html .= '<tr>';\n $output_html .= '<td colspan=\"' . $cols . '\">' . $footer . '</td>';\n $output_html .= '</tr>';\n return $output_html;\n }", "protected function setFooter() {\n $footer = \"<div class='footer'>\n <center>\n <a href='https://www.linkedin.com/in/ali-mohtasham-a75a2886' >Designed by <strong> Ali Mohtasham Gilani </strong> All rights reserved.</a>\n </center>\n </div>\n \";\n return $footer;\n }", "private function printFooter()\n {\n // Nothing to do at the moment\n }", "public function renderFooterCellContent()\n {\n if($footer = $this->getFooterCellSummary()){\n $this->footer = $footer;\n }\n if(!empty($this->footer)){\n $this->footer = $this->grid->formatter->format($this->footer, $this->format);\n }\n return parent::renderFooterCellContent();\n }", "abstract protected function footer();", "abstract protected function footer();", "public function createFooter() {\n\t\t$footer = new PHPWord_Section_Footer($this->_sectionCount);\n\t\t$this->_footer = $footer;\n\t\treturn $footer;\n\t}", "public function getFooter(): ?HtmlElementInterface\n {\n return $this->footer;\n }", "public function footer()\n {\n }", "function getContentFooter() {\n return '';\n }", "function Footer()\n\t{\n\t\t$this->SetY(-15);\n\t\t// Arial italic 8\n\t\t$this->SetFont('Arial','b',8);\n\t\t\n\t\t$this->Cell(30,1,\"----------------------------------------\",0,0,'C');\n\t\t$this->Cell(210,1,'',0,0);\n\t\t// $this->Cell(30,1,\"----------------------------------------\",0,0,'C');\n\t\t// $this->Cell(50,1,'',0,0);\n\t\t$this->Cell(30,1,\"----------------------------------------\",0,1,'C');\n\t\t\n\t\t$this->Cell(30,4,\"Prepared/Class Teacher\",0,0,'C');\n\t\t// $this->Cell(50,4,'',0,0);\n\t\t// $this->Cell(30,4,\"Controlar of Examination\",0,0,'C');\n\t\t$this->Cell(210,4,'',0,0);\n\t\t$this->Cell(30,4,\"Principal/VP\",0,1,'C');\n\t\t\n\t\t$this->Cell(50,4,date(\"d-m-y h:i:s A\"),0,0,'L');\n\t\t// Page number\n\t\t//$this->Cell(140,4,''.$this->PageNo().'/{nb}',0,0,'C');\n\t}", "public function getHtmlFooterSection()\n\t{\n\t\tif( in_array( $this->m_common->m_env, Common::constructionEnvironments() ) )\n\t\t{\n\t\t\t$footer_content = '';\n\t\t}\n\t\telse \n\t\t{\n\t\t\t$footer_content = '\n\t\t\t<div style=\"position:relative;float:left;\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://facebook.com/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_facebook_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://forrst.me/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_forrst_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://www.linkedin.com/in/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_linkedIn_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<a href=\"http://twitter.com/#!/colehafner\" target=\"_blank\">\n\t\t\t\t\t\t\t\t\t<img src=\"/images/icon_twitter_bw.gif\" />\n\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t&copy;&nbsp;2011 Cole Hafner\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div style=\"position:relative;float:right;\">\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td align=\"right\">\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\tShortcuts:\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&uarr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&rarr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&darr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\t&larr;\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<div class=\"padder_10_right\">\n\t\t\t\t\t\t\t\t<div class=\"footer_shortcut bg_dark padder_3_top padder_5_right padder_3_bottom padder_5_left color_white center\">\n\t\t\t\t\t\t\t\t\tShift\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\n\t\t\t\t\t</tr>\n\t\t\t</div>\n\t\t\t\n\t\t\t<div class=\"clear\"></div>\n\t\t\t';\n\t\t}\n\t\t\n\t\t\n\t\t$return = '\n\t\t\t\t\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--/content section-->\n\t\t\t\n\t\t\t<!--footer section-->\n\t\t\t<div class=\"footer_section bg_tan\">\n\t\t\t\t<div class=\"container_12\">\n\t\t\t\t\t<div class=\"grid_12\">\n\t\t\t\t\t\t' . $footer_content . '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"clear\"></div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!--/footer section-->\n\t\t\t\n\t\t</div>\n\t\t<!--page wrapper-->\n\t\t\n\t\t<iframe class=\"input text_input\" style=\"height:200px;width:600px;margin:20px auto 20px auto;display:none;\" id=\"hidden_frame\" name=\"hidden_frame\" ></iframe>\n\t\t';\n\t\t\n\t\treturn $return;\n\t\t\n\t}", "public function getFooter($name = null)\n {\n do_action('get_footer', $name);\n $this->getPartial('footer', $name);\n }", "private function getFooter() {\n\t\t$this->data['oxfooter']\t= \"\\n\"\n\t\t. '<!-- Module ' . ucfirst( $this->_name )\n\t\t.' v.'. $this->_version . ' by http://osworx.net (c) '\n\t\t. date('Y')\n\t\t. ' -->' . \"\\n\";\n\t}", "public function footer() {\n\t}", "public function Footer(){\n\t\t$cur_y = $this->y;\n\t\t$this->SetTextColorArray($this->footer_text_color);\n\t\t//set style for cell border\n\t\t$line_width = (0.85 / $this->k);\n\t\t$this->SetLineStyle(array('width' => $line_width, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => $this->footer_line_color));\n\n\t\t//$w_page = isset($this->l['w_page']) ? $this->l['w_page'].' ' : '';\n\t\t//AJK, 28-JUN-2015: Could not find where l['w_page'] is set in class TCPDF, so simplifying code with own private member\n\t\tif (empty($this->pagegroups)) {\n\t\t\t$pagenumtxt = $this->w_page. ' ' . $this->getAliasNumPage().' OF '.$this->getAliasNbPages();\n\t\t} else {\n\t\t\t$pagenumtxt = $this->w_page. ' ' . $this->getPageNumGroupAlias().' OF '.$this->getPageGroupAlias();\n\t\t}\n\t\t$this->SetY($cur_y);\n\t\t//AJK, 28-JUN-2015: Print page number twice, i.e., on left and right edge of footer. \n\t\t// Taking advantage of existing code that printed once based on whether document was set for RTL or LTR\n\t\t$this->SetX($this->original_lMargin);\n\t\t$this->Cell(0, 0, $pagenumtxt, 0, 0, 'L');\n\t\t$this->SetX($this->original_rMargin);\n\t\t$this->Cell(0, 0, $this->getAliasRightShift().$pagenumtxt, 0, 0, 'R');\n\t}", "public function Footer() {\r\n $this->SetTextColor(0,0,0);\r\n /* insertamos numero de pagina y total de paginas*/\r\n $this->Cell(0, 10, 'Página '.$this->getAliasNumPage().\r\n ' de un total de '.\r\n $this-> getAliasNbPages(),\r\n 0, false, 'C', 0, '', 0, false, 'T', 'M');\r\n $this->SetDrawColor(0,0,0);\r\n /* dibujamos una linea roja delimitadora del pie de página */\r\n $this->Line(15,282,195,282);\r\n\r\n }", "public function getFooter(){\n\t\t$maConfig= new Config();\n\t\t$data['style']=$maConfig->getCouleur();\n\t\t\n\t\t$monControle= new ControlleurAccess();\n\t\tif(isset($_SESSION['nom'])){\n\t\t\tif($monControle->estConnu($_SESSION['nom'])){\n\t\t\t\t//echo\"<PRE> COntroller : réservé \";print_r($data);echo\"</PRE>\";\n\t\t\t\t$data['nom']=$_SESSION['nom'];\n\t\t\t\t$footerPrivate= new _FooterPrivateView();\n\t\t\t\treturn $footerPrivate->show($data);\n\t\t\t}else{\n\t\t\t\t//echo\"<PRE> COntroller : libre \";print_r($data);echo\"</PRE>\";\n\t\t\t\t$footerFree= new _FooterFreeView();\n\t\t\t\treturn $footerFree->show($data);\n\t\t\t}\n\t\t}else{\n\t\t\t//echo\"<PRE> COntroller : libre \";print_r($data);echo\"</PRE>\";\n\t\t\t$footerFree= new\t_FooterFreeView();\n\t\treturn $footerFree->show($data);;\n\t\t}\n\t}", "function toHtml()\n {\n require_once 'HTML/Table.php';\n $table = new HTML_Table(null, 0, true);\n $table->updateAttributes($this->getAttributes());\n\n $tbody = $table->getBody();\n $tbody->setAutoGrow(true);\n $tbody->setAutoFill('');\n\n $thead = $table->getHeader();\n $thead->setAutoGrow(true);\n $thead->setAutoFill('');\n \n $tfoot = $table->getFooter();\n $tfoot->setAutoGrow(true);\n $tfoot->setAutoFill('');\n \n if (isset($this->_footer) && is_array($this->_footer) && count($this->_footer)) {\n $footer = $this->_footer;\n } elseif (is_string($this->_footer)) {\n $last_column = array_pop(array_keys($this->_columnNames));\n $footer = array($last_column => $this->_footer);\n if (isset($this->_footerAttributes['@all'])) {\n if (isset($this->_footerAttributes[$last_column])) {\n $this->_footerAttributes[$last_column] = array_merge($this->_footerAttributes['@all'], $this->_footerAttributes[$last_column]);\n } else {\n $this->_footerAttributes[$last_column] = $this->_footerAttributes['@all'];\n }\n unset($this->_footerAttributes['@all']);\n }\n }\n\n $col = 0;\n if ($this->_columnNames) {\n foreach ($this->_columnNames as $key => $value) {\n $thead->setHeaderContents(0, $col, $value, $this->_columnAttributes[$key]);\n if (isset($footer)) {\n if (isset($footer[$key])) {\n $attributes = isset($this->_footerAttributes['@all']) ? $this->_footerAttributes['@all'] : array();\n if (isset($this->_footerAttributes[$key])) $attributes = array_merge($attributes, $this->_footerAttributes[$key]);\n if (isset($col_spanned)) {\n $tfoot->setCellContents(0, $col_spanned, $footer[$key]);\n $tfoot->setCellAttributes(0, $col_spanned, array_merge($attributes, array('colspan' => $key - $col_spanned + 1)));\n unset($col_spanned);\n } else {\n $tfoot->setCellContents(0, $col, $footer[$key]);\n if (!empty($attributes)) $tfoot->setCellAttributes(0, $col, $attributes);\n }\n } else {\n if (!isset($col_spanned)) $col_spanned = $key;\n }\n }\n ++$col;\n }\n }\n if (!empty($this->_rows)) {\n $row = 0;\n foreach (array_keys($this->_rows) as $key) {\n $col = 0;\n foreach (array_keys($this->_rows[$key]) as $key2) {\n $tbody->setCellContents($row, $col, $this->_rows[$key][$key2]->toHTML());\n $attributes = isset($this->_rowAttributes[$key]['@all']) ? $this->_rowAttributes[$key]['@all'] : array();\n if (isset($this->_rowAttributes[$key][$key2])) $attributes = array_merge($attributes, $this->_rowAttributes[$key][$key2]);\n if (!empty($attributes)) $tbody->setCellAttributes($row, $col, $attributes); \n ++$col;\n }\n if (isset($this->_rowAttributes[$key]['@row'])) $tbody->setRowAttributes($row, $this->_rowAttributes[$key]['@row'], true);\n ++$row;\n }\n } elseif (isset($this->_emptyText)) {\n $tbody->setCellContents(0, 0, $this->_emptyText);\n $tbody->setCellAttributes(0, 0, array('align' => 'center', 'colspan' => count($this->_columnNames)));\n }\n\n return $table->toHTML();\n }", "public function get_footer()\n {\n return <<<EOD\n<div id=\"siteftr\">\n Sitewide Footer\n</div>\n\nEOD;\n }", "function build_html_table_bottom(){\n\t\t\n\t\t$output = '';\n\t\t\n\t\t$output .= '\n\t\t\t\t\t</table>';\n\t\t\n\t\treturn $output;\n\t\t\n\t}", "private function generateHtmlFooter() \n {\n $now = new \\DateTime();\n return '<footer>report generated on ' . $now->format('d-m-Y') . ' at ' . $now->format('H:i:s') . '</footer>';\n }", "public function getLongFooter() {\n\t\t$footer = '© ' . date('Y') . ' <a href=\"' . $this->getBaseUrl() . '\" target=\"_blank\">' . $this->getEntity() . '</a>' .\n\t\t\t'<br/>' . $this->getSlogan();\n\n\t\treturn $footer;\n\t}", "public function Footer() {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');\n }", "public function Footer()\n {\n // Go to 10 cm from bottom\n $this->SetY(-10);\n // Set font to Open Sans\n $this->SetFont('opensans', 'I', 6);\n // Print centered page number with datetime and timezone\n $this->AliasNbPages('{totalPages}');\n // The timezone of the user is retrieved from their Auth0 user's profile if available, otherwise the server time zone is used\n // related to this trello card https://trello.com/c/OjWZzsGA\n $timezone = ($_SESSION['auth0_user']['https://www.boxtribute.com/timezone']) ? $_SESSION['auth0_user']['https://www.boxtribute.com/timezone'] : date_default_timezone_get();\n\n $dt = new DateTime('now', new DateTimeZone($timezone));\n // This is quick fix for an issue with the alignment of footer text as the library incorrectly calculates the text length when template variables {totalPages} are used\n $totalPages = ($_GET['count'] && 0 != $_GET['count']) ? round(intval($_GET['count']) / 2) : 1;\n $this->Cell(0, 10, 'Page '.$this->PageNo().' of '.$totalPages.' Printed on '.$dt->format('d-m-Y H:i:s').\" {$timezone}\", 0, 0, 'C');\n }", "function Footer()\n {\n $this->SetY(-11);\n $this->Cell(45);\n // Select Arial italic 8\n $this->SetFont('Arial','I',8);\n // Print centered page number\n $this->Cell(6,10,'',0,0,'C');\n $this->Cell(96,10,'Nombre y Firma','T',0,'C');\n $this->Cell(0,10,utf8_decode('Página ').$this->PageNo(),0,0,'R');\n\n }", "public function Footer() {\n\t\t$this->SetY(-15);\n\t\t// Set font\n\t\t$this->SetFont('helvetica', 'I', 8);\n\t\t// Page number\n\t\t$this->Cell(0, 10, 'Pagina '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n\t}", "private function getParamFooter()\n {\n $footer = $this->getMenuParams()->get( 'footer', '' );\n return (string)$footer;\n }", "function Footer(){\n\t\t$this->Cell(190,0,'','T',1,'',true);\n\t\t\n\t\t//Go to 1.5 cm from bottom\n\t\t$this->SetY(-15);\n\t\t\t\t\n\t\t$this->SetFont('Arial','',8);\n\t\t\n\t\t//width = 0 means the cell is extended up to the right margin\n\t\t$this->Cell(0,10,'Page '.$this->PageNo().\" / {pages}\",0,0,'C');\n\t}", "public function Footer() {\n $this->SetY(-15);\n // Select helvetica italic 8\n $this->SetFont('helvetica', '', 10);\n // Print current and total page numbers\n\n //$this->Cell(0,10,'Page '.$this->pageNo().'/{nb}',0,0,'C');\n\n $this->Cell(0, 4, 'This document shall be deemed uncontrolled unless labelled \"CONTROLLED\"', 0, 0, 'C');\n $this->ln();\n\n $this->Cell($this->w - ($this->w * 0.51), 4, 'User should verify latest', 0, 0, 'R');\n $this->SetFont('helvetica', 'B', 10);\n $this->Cell(0, 4, ' revision.', 0, 0, 'L');\n $this->ln();\n\n $this->SetFont('helvetica', 'I', 7);\n\n $pageNo = 'Page '.$this->getAliasNumPage().' of '.$this->getAliasNbPages();\n $this->Cell(0, 3, $pageNo, 0, 0, 'R');\n }", "function Footer()\n\t{\n\t\t$this->SetY(-15);\n\t\t// Select Arial italic B\n\t\t$this->setfont('Arial','I',14);\n\t\t$this->cell(250,8,\"Proyecto Final, copyright &copy; 2019\",0,0,'c');\n\t\t// Print centered page numbre\n\t\t$this->Cell(0,10,'Pag.'.$this->PageNo(),0,0,'c');\n\t}", "public function getFooter()\n {\n $main_menu = \\Drupal::menuTree()->load('main', new \\Drupal\\Core\\Menu\\MenuTreeParameters());\n //Generate array\n generateMainMenuTree($menu_tree, $main_menu);\n\n $output = array(\n 'page' => array(\n ThemeConstante::THEME => ThemeConstante::FOOTER,\n ThemeConstante::FOOTERMENU => $menu_tree,\n )\n );\n $html = \\Drupal::service('renderer')->renderRoot($output);\n $response = new Response();\n $response->setContent($html);\n\n return $response;\n }", "function get_footer($name = \\null, $args = array())\n {\n }", "public function getFooterClass() {\n if (null != $this->footerClass) {\n return $this->footerClass;\n }\n $_ve = $this->getValueExpression(\"footerClass\");\n if ($_ve != null) {\n return $_ve->getValue($this->getFacesContext()->getELContext());\n } else {\n return null;\n }\n }", "function asu_brand_get_block_footer() {\n $settings = asu_brand_get_block_settings();\n $cache_id = 'asu_brand:footer';\n return asu_brand_get_cached_content($cache_id, $settings->footer_path);\n}", "public function footer(): PlacementInterface;", "public function Footer()\n {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Print centered page number\n $this->Cell(0, 4, utf8_decode('Atenea - Página ' . $this->PageNo()), 0, 0, 'C');\n }", "function Footer()\n\t{\n\t\t//$this->Image('../imagenes/pie.jpg',15,250,170);\n\t\t$this->AliasNbPages();\n\t\t$this->SetY(-23);\n\t\t\n\t\t$this->SetFont('Arial','B',9);\n\t\t$this->MultiCell(180,5,utf8_decode(''),'0','C');\n\t\t\n\t $this->SetFont('Arial','I',8);\n\t $this->Cell(0,7,'Pag. '.$this->PageNo().' / {nb}',0,1,'C');\n\t}", "function footer() {\n\t\tob_start();\n\t\tinclude('templates/footer.php');\n\t\t$output = ob_get_clean();\n\t\treturn $output;\n\t}", "function footer() {\n }", "function Footer()\n\t{\n\t $this->SetY(-15);\n\t //Arial italic 8\n\t $this->SetFont('Arial','I',7);\n\t //Page number\n\t $this->Cell(0,10,utf8_decode('PlatSource © '.date('Y')),0,0,'L');\n\t $this->Cell(0,10,utf8_decode('Página ').$this->PageNo().' de {nb}',0,0,'R');\n\t}", "public function Footer()\n {\n $this->SetFont('Arial', 'I', 8);\n $this->SetY(-15);\n $this->Write(4, 'Dokumen ini dicetak secara otomatis menggunakan sistem terkomputerisasi');\n\n $time = \"Dicetak pada tanggal \" . date('d-m-Y H:i:s') . \" WIB\";\n\n $this->SetX(-150);\n $this->Cell(0, 4, $time, 0, 0, 'R');\n }", "protected function footer()\n {\n\n }", "function footer() {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial', 'I', 8);\n // Print current and total page numbers\n $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');\n }", "public function Footer() {\n $this->SetY(-15);\n // Set font\n $this->SetFont('helvetica', 'I', 8);\n // Page number\n $this->Cell(0, 10, 'Page '.$this->getAliasNumPage().'/'.$this->getAliasNbPages(), 0, false, 'C', 0, '', 0, false, 'T', 'M');\n }", "function Footer()\n {\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial','I',8);\n // Page number\n $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');\n }", "function Footer()\n {\n $this->SetY(-15);\n // Police Arial italique 8\n $this->SetFont('Arial','I',6);\n // Num?ro de page\n $this->Cell(0,8,'Page '.$this->PageNo().'/{nb}',0,0,'C');$this->Ln(3);\n $this->Cell(0,8,\"Algerian Gulf Life Insurance Company, SPA au capital social de 1.000.000.000 de dinars algériens, 01 Rue Tripoli, Hussein Dey Alger, \",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"RC : 16/00-1009727 B 15 NIF : 001516100972762-NIS :0015160900296000\",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"Tel : +213 (0) 21 77 30 12/14/15 Fax : +213 (0) 21 77 29 56 Site Web : www.aglic.dz \",0,0,'C');\n }", "public function getShortFooter() {\n\t\t$footer = '© ' . date('Y') . ' <a href=\"' . $this->getBaseUrl() . '\" target=\"_blank\">' . $this->getEntity() . '</a>' .\n\t\t\t'<br/>' . $this->getSlogan();\n\n\t\treturn $footer;\n\t}", "function get_footer(){\n\t\tglobal $FANNIE_ROOT, $FANNIE_AUTH_ENABLED, $FANNIE_URL;\n\t\tob_start();\n\t\tinclude($FANNIE_ROOT.'src/footer_install.html');\n\t\treturn ob_get_clean();\n\t}", "function getListFooter()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$list = array();\n\t\t$list['limit']\t\t\t= $this->limit;\n\t\t$list['limitstart']\t\t= $this->limitstart;\n\t\t$list['total']\t\t\t= $this->total;\n\t\t$list['limitfield']\t\t= $this->getLimitBox();\n\t\t$list['pagescounter']\t= $this->getPagesCounter();\n\t\t$list['pageslinks']\t\t= $this->getPagesLinks();\n\n\t\t$chromePath\t\t= JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists( $chromePath ))\n\t\t{\n\t\t\trequire_once( $chromePath );\n\t\t\tif (function_exists( 'pagination_list_footer' )) {\n\t\t\t\treturn pagination_list_footer( $list );\n\t\t\t}\n\t\t}\n\t\treturn $this->_list_footer($list);\n\t}", "function Footer()\n {\n date_default_timezone_set('UTC+1');\n //Date\n $tDate = date('F j, Y, g:i:s a');\n // Position at 1.5 cm from bottom\n $this->SetY(-15);\n // Arial italic 8\n $this->SetFont('Arial', 'I', 12);\n // Text color in gray\n $this->SetTextColor(128);\n // Page number\n $this->Cell(0, 10,utf8_decode('Page ' . $this->PageNo().' \n CHUYC \n '.$tDate.'\n +237 693 553 454\n '.$this->Image(SITELOGO, 189, 280, 10, 10,'', URLROOT)), 0, 0, 'L');\n }", "function table_end(){\n\techo '</table>';\n}", "function Footer() {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial', 'B', 8);\n // Print centered page number\n $this->Cell(0, 5, utf8_decode(\"[Página \") . $this->PageNo() . \"]\", 0, 0, 'L');\n }", "function Footer() {\n $this->SetY(-15);\n // Select Arial italic 8\n $this->SetFont('Arial', 'B', 8);\n // Print centered page number\n $this->Cell(0, 5, utf8_decode(\"[Página \") . $this->PageNo() . \"]\", 0, 0, 'L');\n }", "public function renderFooter()\r\n {\r\n $footer = parent::renderFooter();\r\n if (empty($footer) && (isset($this->cancelButton) || isset($this->submitButton))) {\r\n if ($this->cancelButton)\r\n $footer.= Button::widget($this->cancelButton);\r\n if ($this->submitButton)\r\n $footer.= Button::widget($this->submitButton);\r\n\r\n Html::addCssClass($this->footerOptions, 'modal-footer');\r\n $footer = Html::tag('div', \"\\n\" .$footer . \"\\n\", $this->footerOptions);\r\n }\r\n return $footer;\r\n }", "public function getFooter()\n {\n return <<<EOF\n\n<info>\nFinished. \n</info>\n\n\nEOF;\n\n}", "public function Footer(){\n $this->SetY(-15);\n $this->SetFont('Arial','I',6);\n $this->Cell(0,5,'\"ESTA FACTURA CONTRIBUYE AL DESARROLLO DEL PAIS, EL USO ILICITO DE ESTA SERA SANCIONADO DE ACUERDO A LEY\"',0,0,'C');\n $this->Ln(5);\n $this->Cell(0,5,'Ley No 453: Tienes derecho a un trato equitativo sin discriminacion en la oferta de servicios.',0,0,'C');\n }", "function Footer()\n {\n $this->SetY(-15);\n\n // Police Arial italique 8\n $this->SetFont('Arial','I',6);\n // Num?ro de page\n $this->Cell(0,8,'Page '.$this->PageNo().'/{nb}',0,0,'C');$this->Ln(3);\n $this->Cell(0,8,\"Algerian Gulf Life Insurance Company, SPA au capital social de 1.000.000.000 de dinars algériens, 01 Rue Tripoli, Hussein Dey Alger, \",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"RC : 16/00-1009727 B 15 NIF : 001516100972762-NIS :0015160900296000\",0,0,'C');\n $this->Ln(2);\n $this->Cell(0,8,\"Tel : +213 (0) 21 77 30 12/14/15 Fax : +213 (0) 21 77 29 56 Site Web : www.aglic.dz \",0,0,'C');\n }", "function Footer()\n\t{\n\t $this->SetY(-15);\n\t //Arial italic 8\n\t $this->SetFont('Arial','I',7);\n\t //Page number\n\t $this->Cell(0,10,utf8_decode('Página ').$this->PageNo().' de {nb}',0,0,'R');\n\t}" ]
[ "0.78271747", "0.78271747", "0.76918465", "0.7611681", "0.7367222", "0.72682035", "0.7236785", "0.7233251", "0.7140567", "0.7131904", "0.69366235", "0.6858771", "0.6844632", "0.6843202", "0.67691493", "0.6750055", "0.67487174", "0.67283213", "0.6727102", "0.6710324", "0.6701496", "0.6680215", "0.66618025", "0.66618025", "0.66558945", "0.6654373", "0.6641614", "0.6595769", "0.6585121", "0.65675485", "0.65491146", "0.6523538", "0.6519358", "0.6471897", "0.6469655", "0.6462505", "0.6433872", "0.64266366", "0.6401036", "0.6401036", "0.6401036", "0.6401036", "0.6401036", "0.6361621", "0.6344563", "0.6336868", "0.6335372", "0.6335372", "0.6324132", "0.632413", "0.63062376", "0.6302875", "0.6302855", "0.6294672", "0.6292847", "0.6289042", "0.6283801", "0.626387", "0.6244627", "0.62341624", "0.6232092", "0.62299174", "0.6210837", "0.6187108", "0.6175538", "0.61747086", "0.61657435", "0.6150915", "0.6138234", "0.6126648", "0.6125214", "0.61106557", "0.61075145", "0.6093135", "0.6091793", "0.6091388", "0.60777545", "0.60757124", "0.6062031", "0.60546345", "0.60538965", "0.6053173", "0.6031185", "0.6007052", "0.60037726", "0.59876883", "0.59818184", "0.5978095", "0.5970683", "0.596932", "0.59680426", "0.59642154", "0.5952798", "0.59464383", "0.5940118", "0.5940118", "0.5938704", "0.5938073", "0.5930012", "0.592999", "0.5924191" ]
0.0
-1
Generate pager for listing.
public function getPagerLinks($param, $label) { $qt = $param['query']['qt']; if($this->isFeedChecked()) { $seq = $param['query']['seq']; $pager_link = Link::createFromRoute($label,'ap_newsroom_clone.pager',[ 'qt' => $qt, 'page_num' => $seq ],[ 'attributes' => ['class' => 'use-ajax'] ]); } else { $page = $param['query']['page']; $pager_link = Link::createFromRoute($label,'ap_newsroom_clone.pager',[ 'qt' => $qt, 'page_num' => $page ],[ 'attributes' => ['class' => 'use-ajax'] ]); } return $pager_link; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private function generatePages()\n {\n $all_pages = self::getPages($this->records, $this->recordsInPage);\n $total = 0;\n $start = 1;\n while ($total < $all_pages) {\n $shift = $this->getShift();\n $paging_start = $total < $this->getLeftShift() ? true : false;\n $paging_end = $total >= ($all_pages - $this->getRightShift()) ? true : false;\n\n if ($this->currentPage == $start) {\n $this->appendData(sprintf('<li class=\"active\"><span>%d</span></li>', $start));\n }\n elseif ($paging_start|| $paging_end) {\n $this->appendData(sprintf('<li><a href=\"%s%d\">%d</a></li>', $this->url, $start, $start));\n }\n elseif (($this->currentPage == $start - $shift) || ($this->currentPage == $start + $shift)) {\n $this->appendData('<li><span>...</span></li>');\n }\n $total++;\n $start++;\n }\n }", "private function pageList() {\n //get pager range\n $this->getPagerRange();\n\n //loop specified ranged pager list\n\t\t//there is no link for current page number\n for ($i = $this->minPager; $i <= $this->maxPager; $i++) {\n if ($i == $this->currentPage) {\n print '<li class=\"current-page\">' . $i . '</li>';\n } else {\n print '<li><a href=\"' . $this->url . '&page=' . $i . '\">' . $i . '</a></li>';\n }\n }\n }", "function pagination(){}", "protected function buildPagination() {}", "protected function buildPagination() {}", "public function list_pages() {\n\t\t$this->print_prev();\n\n\t\tif ($this->current_page+2 >= $this->total_pages-1) {\n\t\t\t$this->pages_right();\n\t\t} else {\n\t\t\t$this->pages_left();\n\t\t}\n\n\t\t$this->print_next();\n\t}", "function get_pager()\n\t{\n\t\tinclude_once('Pager/Pager.php');\n\t\t$pager_options = array();\n\t\t$pager_options['mode'] = 'Sliding';\n\t\t$pager_options['urlVar'] = 'page';\n\t\t$pager_options['delta'] = 2;\n\t\t$pager_options['perPage'] = (int) $this->rows_per_page;\n\t\t$pager_options['separator'] = '|';\n\t\t$pager_options['prev'] = '&laquo;';\n\t\t$pager_options['next'] = '&raquo;';\n\t\t$pager_options['append'] = false;\n\t\t$pager_options['fileName'] = $this->pager_file_name;\n\t\t\n\t\t$pager_options['totalItems'] = $this->totalItems;\n\t\t\n\t\t$currentPage = common::arg($this->pager_arg_no);\n\t\t//$this->content->debug .= ' currentPage: '.$currentPage .' argno: '.$this->pager_arg_no .' a:'.(int)common::arg(3);\n\t\tif (! isset($currentPage) || ! $currentPage) { $currentPage = 1; }\n\t\tif ($currentPage > ceil($this->totalItems/$this->rows_per_page)) { $currentPage = 1; }\n\t\t\n\t\t$pager_options['currentPage'] = $currentPage;\n\t\t\n\t\t$pager =& Pager::factory($pager_options);\n\t\treturn $pager->links;\n\t}", "public function generatePagination()\n {\n $this->buffer = [];\n\n if ($this->currentPage != 1) {\n $this->generateLeftButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n\n $this->generatePages();\n\n if ($this->currentPage != self::getPages($this->records, $this->recordsInPage)) {\n $this->generateRightButton($this->currentPage);\n } else {\n $this->generateLeftButton($this->currentPage, true);\n }\n }", "public function do_paging()\n {\n }", "function getPaging() {\n\t\t//if the total number of rows great than page size\n\t\tif($this->totalRows > $this->pageSize) {\n\t\t\tprint '<div class=\"paging\">';\n\t\t\tprint '<ul>';\n\t\t\tprint $this->first() . $this->prev() . $this->pageList() . $this->next() . $this->end();\n\t\t\tprint '</ul>';\n\t\t\tprint '</div>';\n\t\t}\n }", "public function pager()\n {\n $pager = $this->getPublisher()->getPagination()['pager'];\n $html = \"\\n<nav>\\n <ul class=\\\"pager\\\">\";\n\n $html .= \"\\n <li class=\\\"previous\".\n ($pager['pages']['prev'] !== null ? '' : ' disabled').\n \"\\\"><a href=\\\"\".($pager['pages']['prev'] ? : '#').\n \"\\\"><span aria-hidden=\\\"true\\\">&larr;</span> \".\n $this->getConfig()->ls('ui.nav.previous').\"</a></li>\";\n\n $html .= \"\\n <li class=\\\"next\".\n ($pager['pages']['next'] !== null ? '' : ' disabled').\n \"\\\"><a href=\\\"\".($pager['pages']['next'] ? : '#').\n \"\\\">\".$this->getConfig()->ls('ui.nav.next').\n \" <span aria-hidden=\\\"true\\\">&rarr;</span></a></li>\";\n\n $html .= \"\\n </ul>\\n</nav>\\n\\n\";\n\n return $html;\n }", "private function compilePager() {\n \t\n \t\n \t$this->_tmp_page = '<p '.$this->_config['css_page'].'>';\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].'1\">'.$this->_config['first'].'</a>';\n \t}\n \tif ($this->_all_page > 1 && $this->_config['cur_page'] > 1) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] - 1).'\">'.$this->_config['previous'].'</a>';\n \t}\n \t\n \tif ($this->_all_page <= $this->_config['scr_page']) {\n \tif($this->_config['all_recs'] <= $this->_config['per_page']) {\n \t$this->_start = 1;\n $this->_stop = $this->_all_page;\n } else {\n \t\t$this->_start = 1;\n $this->_stop = $this->_all_page;\n }\n } else {\n \tif($this->_config['cur_page'] < intval($this->_config['scr_page'] / 2) + 1) {\n\t $this->_start = 1; \n\t \t$this->_stop = $this->_config['scr_page'];\n } else {\n \t$this->_start = $this->_config['cur_page'] - intval($this->_config['scr_page'] / 2);\n $this->_stop = $this->_config['cur_page'] + intval($this->_config['scr_page'] / 2);\n if($this->_stop > $this->_all_page) $this->_stop = $this->_all_page;\n }\n }\n if ($this->_all_page > 1) {\n\t for ($i = $this->_start; $i <= $this->_stop; $i++) {\n\t \tif ($i == $this->_config['cur_page']) {\n\t \t$this->_tmp_page .= '<span '.$this->_config['act_page'].'>'.$i.'</span>';\n\t } else {\n\t $this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$i.'\">'.$i.'</a>';\n\t }\n\t }\n }\n \n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].($this->_config['cur_page'] + 1).'\">'.$this->_config['next'].'</a>';\n \t}\n \tif ($this->_config['cur_page'] < $this->_all_page) {\n \t\t$this->_tmp_page .= '<a href=\"'.$this->_config['url_page'].$this->_all_page.'\">'.$this->_config['last'].'</a>';\n \t}\n \treturn $this->_tmp_page.'</p>';\n }", "abstract public function preparePagination();", "public function executeList()\n\t{\n\t\t$c = new Criteria();\n\t $pager = new sfPropelPager('ProjectSite', sfConfig::get('app_pager_homepage_max'));\n\t\t$pager->setCriteria($c);\n\t\t$pager->setPage($this->getRequestParameter('page', 1));\n\t\t$pager->init();\n\t\t$this->pager = $pager;\n\t}", "function create_links()\n\t{\n\t\t$totalItems = $this->total_records;\n\t\t$perPage = $this->size;\n\t\t$currentPage = $this->page;\n\t\t$link = $this->link;\n\t\t$totalPages = floor($totalItems / $perPage);\n\t\t$totalPages += ($totalItems % $perPage != 0) ? 1 : 0;\n\n\t\tif ($totalPages < 1 || $totalPages == 1){\n\t\t\treturn null;\n\t\t}\n\n\t\t$output = null;\t\t\t\t\n\t\t$loopStart = 1; \n\t\t$loopEnd = $totalPages;\n\n\t\tif ($totalPages > 5)\n\t\t{\n\t\t\tif ($currentPage <= 3)\n\t\t\t{\n\t\t\t\t$loopStart = 1;\n\t\t\t\t$loopEnd = 5;\n\t\t\t}\n\t\t\telse if ($currentPage >= $totalPages - 2)\n\t\t\t{\n\t\t\t\t$loopStart = $totalPages - 4;\n\t\t\t\t$loopEnd = $totalPages;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$loopStart = $currentPage - 2;\n\t\t\t\t$loopEnd = $currentPage + 2;\n\t\t\t}\n\t\t}\n\n\t\tif ($loopStart != 1){\n\t\t\t$output .= sprintf('<li class=\"disabledpage\"> <a href=\"' . $link . '\">&#171;</a> </li>', '1');\n\t\t}\n\t\t\n\t\tif ($currentPage > 1){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">'._previous_.'</a> </li>', $currentPage - 1);\n\t\t}\n\t\t\n\t\tfor ($i = $loopStart; $i <= $loopEnd; $i++)\n\t\t{\n\t\t\tif ($i == $currentPage){\n\t\t\t\t$output .= '<li class=\"currentpage\">' . $i . '</li> ';\n\t\t\t} else {\n\t\t\t\t$output .= sprintf('<li><a href=\"' . $link . '\">', $i) . $i . '</a> </li> ';\n\t\t\t}\n\t\t}\n\n\t\tif ($currentPage < $totalPages){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">'._next_.'</a> </li>', $currentPage + 1);\n\t\t}\n\t\t\n\t\tif ($loopEnd != $totalPages){\n\t\t\t$output .= sprintf('<li class=\"nextpage\"> <a href=\"' . $link . '\">&#187;</a> </li>', $totalPages);\n\t\t}\n\n\t\treturn '<div class=\"pagination\"><ul>' . $output . '</ul></div>';\n\t}", "public function generatePHPPaginator()\n {\n $sHTML = '';\n \n $iNumOfPages = ceil($this->iLength / $this->iNumOfPosAtPage);\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=1\">&lt;</a></li>';\n \n for($i = 0;$i < $iNumOfPages;$i++)\n {\n if(($i + 1) == $this->iActualPage)\n {\n $sHTML .= '<li class=\"active\"><a href=\"?' . $this->sActualParams . '&p=' . $this->iActualPage . '\">' . ($i + 1) . '</a></li>';\n }\n else\n {\n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . ($i + 1) . '\">' . ($i + 1) . '</a></li>';\n }\n }\n \n $sHTML .= '<li><a href=\"?' . $this->sActualParams . '&p=' . $iNumOfPages . '\">&gt;</a></li>';\n \n $this->oTemplate->assign['paginator'] = $sHTML;\n $this->oTemplate->assign['scripts-path'] = SCRIPTS_PATH;\n \n return $this->oTemplate->parse(INCLUDES_PATH . 'paginator.html');\n }", "function page($num = 1)\n {\n // retrieve all data from history table per sorting\n $source = $this->factory->sortAll($this->sort);\n $records = array(); // start with an empty extract\n\n // use a foreach loop, because the record indices may not be sequential\n $index = 0; // where are we in the tasks list\n $count = 0; // how many items have we added to the extract\n $start = ($num - 1) * $this->itemsPerPage;\n \n foreach($source as $record) {\n if ($index++ >= $start) {\n $records[] = $record;\n $count++;\n }\n if ($count >= $this->itemsPerPage) break;\n }\n \n $this->data['pagination'] = $this->pagenav($num);\n $this->showPage($records);\n }", "public function page_list() {\n\n\t\t\t$output = \"\";\n\t\t\t$cur_page = $this->current_page;\n\t\t\t$tot_page = $this->total_pages();\n\n\t\t\tif( $cur_page <= $tot_page ) {\n\t\t\t\t$output .= \"<h3 class=\\\"pagelist\\\">Page {$cur_page} of \" ;\n\t\t\t\t$output .= \"{$tot_page}</h3>\";\t\n\t\t\t}\n\t\t\t\n\t\t\treturn $output;\n\n\t\t}", "public function view()\n {\n $pages = explode(' ', $this->list);\n\n if ($this->current_page < 1 || $this->current_page > $this->total_pages) {\n $this->current_page = 1;\n }\n $output = null;\n\n $output .= '<ul class=\"pagination\">';\n $output .= $this->beginning();\n $output .= $this->middle($pages);\n $output .= $this->ending();\n $output .= '</ul>';\n \n return $output;\n }", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "private function getPagination(){\n\t\t$pager=new pager();\n\t\t$pager->isAjaxCall($this->iAmAjax);\n\t\t$pager->set(\"type\", \"buttons\");\n\t\t$pager->set(\"gridId\",$this->id);\n\t\t$pager->set(\"pages\", $this->pages);\n\t\t$pager->set(\"currPage\", $this->currPage);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\t$pager->set(\"maxNumPages\", $this->maxNumPages);\n\t\treturn $pager->render(true);\n\t}", "private function paginate()\n\t{\n\t\tif ($this->_listModel) {\n\t\t\t$this->_listModel->loadNextPage();\n\t\t}\n\t}", "function horizon_theme_paging_nav() {\n\t\t$mid = 2; // Total of items that will show along with the current page.\n\t\t$end = 1; // Total of items displayed for the last few pages.\n\t\t$show = false; // Show all items.\n\n\t\techo horizon_theme_pagination( $mid, $end, false );\n\t}", "function mft_pager($variables) {\n $tags = $variables['tags'];\n $element = $variables['element'];\n $parameters = $variables['parameters'];\n $quantity = $variables['quantity'];\n global $pager_page_array, $pager_total;\n\n // Calculate various markers within this pager piece:\n // Middle is used to \"center\" pages around the current page.\n $pager_middle = ceil($quantity / 2);\n // current is the page we are currently paged to\n $pager_current = $pager_page_array[$element] + 1;\n // first is the first page listed by this pager piece (re quantity)\n $pager_first = $pager_current - $pager_middle + 1;\n // last is the last page listed by this pager piece (re quantity)\n $pager_last = $pager_current + $quantity - $pager_middle;\n // max is the maximum page number\n $pager_max = $pager_total[$element];\n // End of marker calculations.\n\n // Prepare for generation loop.\n $i = $pager_first;\n if ($pager_last > $pager_max) {\n // Adjust \"center\" if at end of query.\n $i = $i + ($pager_max - $pager_last);\n $pager_last = $pager_max;\n }\n if ($i <= 0) {\n // Adjust \"center\" if at start of query.\n $pager_last = $pager_last + (1 - $i);\n $i = 1;\n }\n // End of generation loop preparation.\n\n $li_first = theme('pager_first', array('text' => (isset($tags[0]) ? $tags[0] : t('« first')), 'element' => $element, 'parameters' => $parameters));\n $li_previous = theme('pager_previous', array('text' => (isset($tags[1]) ? $tags[1] : t('‹ previous')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n $li_next = theme('pager_next', array('text' => (isset($tags[3]) ? $tags[3] : t('next ›')), 'element' => $element, 'interval' => 1, 'parameters' => $parameters));\n $li_last = theme('pager_last', array('text' => (isset($tags[4]) ? $tags[4] : t('last »')), 'element' => $element, 'parameters' => $parameters));\n\n if ($pager_total[$element] > 1) {\n if ($li_first) {\n $items[] = array(\n 'class' => array('pager-first'),\n 'data' => $li_first,\n );\n }\n if ($li_previous) {\n $items[] = array(\n 'class' => array('pager-previous'),\n 'data' => $li_previous,\n );\n }\n\n // When there is more than one page, create the pager list.\n if ($i != $pager_max) {\n if ($i > 1) {\n $items[] = array(\n 'class' => array('pager-ellipsis'),\n 'data' => '…',\n );\n }\n // Now generate the actual pager piece.\n for (; $i <= $pager_last && $i <= $pager_max; $i++) {\n if ($i < $pager_current) {\n $items[] = array(\n 'class' => array('pager-item'),\n 'data' => theme('pager_previous', array('text' => $i, 'element' => $element, 'interval' => ($pager_current - $i), 'parameters' => $parameters)),\n );\n }\n if ($i == $pager_current) {\n $items[] = array(\n 'class' => array('pager-current'),\n 'data' => $i,\n );\n }\n if ($i > $pager_current) {\n $items[] = array(\n 'class' => array('pager-item'),\n 'data' => theme('pager_next', array('text' => $i, 'element' => $element, 'interval' => ($i - $pager_current), 'parameters' => $parameters)),\n );\n }\n }\n if ($i < $pager_max) {\n $items[] = array(\n 'class' => array('pager-ellipsis'),\n 'data' => '…',\n );\n }\n }\n // End generation.\n if ($li_next) {\n $items[] = array(\n 'class' => array('pager-next'),\n 'data' => $li_next,\n );\n }\n if ($li_last) {\n $items[] = array(\n 'class' => array('pager-last'),\n 'data' => $li_last,\n );\n }\n return theme('item_list', array(\n 'items' => $items,\n 'attributes' => array('class' => array('pager')),\n ));\n }\n}", "function pager($current_page, $records_per_page, $pages_per_pageList, $dataQuery, $countQuery){\n $obj->record = array(); // beinhaltet ein Arrray des objects mit Daten wor&uuml;ber dann zugegriffen wird.\n $obj->current_page = $current_page; // Startet mit 0!\n $obj->total_cur_page = 0; // shows how many records belong to current page\n $obj->records_per_page = 0;\n $obj->total_records = 0;\n $obj->total_pages = 0;\n $obj->preceding = false; // Ist true wenn es eine Seite vor der angezeigten gibt.\n $obj->subsequent = false; // Ist true wenn es eine Seite nach der angezeigten gibt.\n $obj->pages_per_pageList = 10; //$pages_per_pageList;\n $result=mysql_query($countQuery, $this->CONNECTION);\n $obj->total_records = mysql_num_rows($result);\n if($obj->total_records>0){\n $obj->record = $this->select($dataQuery);\n $obj->total_cur_page = sizeof($obj->record);\n $obj->records_per_page = $records_per_page;\n $obj->total_pages = ceil($obj->total_records/$records_per_page);\n $obj->offset_page = $obj->pages_per_pageList*floor($obj->current_page/$obj->pages_per_pageList);\n $obj->total_pages_in_pageList = $obj->total_pages-($obj->offset_page+$obj->pages_per_pageList);\n $obj->last_page_in_pageList = $obj->offset_page+$obj->pages_per_pageList;\n if($obj->last_page_in_pageList>$obj->total_pages) $obj->last_page_in_pageList=$obj->total_pages;\n if($obj->offset_page>0) $obj->pageList_preceding=true;\n else $obj->pageList_preceding=false;\n if($obj->last_page_in_pageList<$obj->total_pages) $obj->pageList_subsequent=true;\n else $obj->pageList_subsequent=false;\n if($obj->current_page>1) $obj->preceding=true;\n if($obj->current_page<$obj->total_pages) $obj->subsequent=true;\n }\n return $obj;\n }", "function index() {\n\t\t$page = $this->request->param('page', 1);\n\t\t$rows = $this->request->param('num_results', 100);\n\n\t\t// call MODEL function that returns the DBPager object\n\t\t$pager = $this->model('issues')->get_test_pager($page, $rows);\n\n\t\t// pass DBPager object to VIEW\n\t\t$this->view->display(\"test_pager.php\", array('pager' => $pager));\n\t}", "function pager($count){\n //x if > 0 - decrement on num\n //y - number position of ouput increment on num\n //z - number of account increment on 1\n for($x=$count, $y=1, $z=1;\n $x>0;\n $x-=$this->num, $y+=$this->num ,$z++){\n if($this->pos == $y){\n echo $z;\n } else {\n echo \"<a href=?pos=\",$y,\"> \",$z,\" </a>\" ;\n }\n }\n }", "function displayPaging() \r\n {\r\n $self = $_SERVER['PHP_SELF'];\r\n if($this->openPage<=0) {\r\n $next = 2;\r\n }\r\n\r\n else {\r\n $next = $this->openPage+1;\r\n }\r\n $prev = $this->openPage-1;\r\n $last = $this->pages;\r\n\t\t$queryString = '';\r\n\t\t\r\n\t\tif ($_GET['keywords']!= '') {\r\n\t\t\t$queryString .= '&keywords='.$_GET['keywords'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['sort'] != '') {\r\n\t\t\t$queryString .= '&sort='.$_GET['sort'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['filters']!='') {\r\n\t\t\t$queryString .= '&filters='.$_GET['filters'];\r\n\t\t}\r\n\t\t\t\t\t\r\n\t\tif ($_GET['cat']!='') {\r\n\t\t\t$queryString .= '&cat='.$_GET['cat'];\r\n\t\t}\r\n\t\t\r\n\t\tif ($_GET['media']!='') {\r\n\t\t\t$queryString .= '&media='.$_GET['media'];\r\n\t\t}\r\n\t\tif ($_GET['content']!='') {\r\n\t\t\t$queryString .= '&content='.$_GET['content'];\r\n\t\t}\r\n\t\tif ($_GET['genre']!='') {\r\n\t\t\t$queryString .= '&genre='.$_GET['genre'];\r\n\t\t}\r\n\r\n if($this->openPage > 1) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=1\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\t\r\n\t\t\techo \"First</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n \techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$prev\".$queryString.\"\\\">\";\r\n\t\t\t\t\t\r\n\t\t\techo \"Prev</a>]&nbsp;&nbsp;\";\r\n }\r\n else {\r\n echo \"[First<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Prev]&nbsp;&nbsp;\";\r\n }\r\n for($i=1;$i<=$this->pages;$i++) {\r\n if($i == $this->openPage) \r\n\t\t\t\tif ($i==1)\r\n \techo \"$i\";\r\n\t\t\t\telse \r\n\t\t\t\t\t echo \", $i\";\r\n else\r\n\t\t\tif ($i==1) {\r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n\t\t\t\t}else{ \r\n \t\techo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$i\".$queryString.\"\\\">$i</a>\";\r\n } }\r\n if($this->openPage < $this->pages) {\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$next\".$queryString.\"\\\">Next</a><span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \",<a href=\\\"\".$_SERVER['SCRIPT_NAME'].\"?page=$last\".$queryString.\"\\\">Last</a>]\";\r\n }\r\n else {\r\n echo \"&nbsp;&nbsp;[Next<span style='color:#e5e5e5; padding-left:2px;padding-right:2px;'>|</span>\";\r\n echo \"Last]\";\r\n } \r\n }", "function show_pages($amount, $rowamount, $id = '') {\n if ($amount > $rowamount) {\n $num = 8;\n $poutput = '';\n $lastpage = ceil($amount / $rowamount);\n $startpage = 1;\n\n if (!isset($_GET[\"start\"]))\n $_GET[\"start\"] = 1;\n $start = $_GET[\"start\"];\n\n if ($lastpage > $num & $start > ($num / 2)) {\n $startpage = ($start - ($num / 2));\n }\n\n echo _('Show page') . \":<br>\";\n\n if ($lastpage > $num & $start > 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start - 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ < ]';\n $poutput .= '</a>';\n }\n if ($start != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=1';\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ 1 ]';\n $poutput .= '</a>';\n if ($startpage > 2)\n $poutput .= ' .. ';\n }\n\n for ($i = $startpage; $i <= min(($startpage + $num), $lastpage); $i++) {\n if ($start == $i) {\n $poutput .= '[ <b>' . $i . '</b> ]';\n } elseif ($i != $lastpage & $i != 1) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $i;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $i . ' ]';\n $poutput .= '</a>';\n }\n }\n\n if ($start != $lastpage) {\n if (min(($startpage + $num), $lastpage) < ($lastpage - 1))\n $poutput .= ' .. ';\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . $lastpage;\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ ' . $lastpage . ' ]';\n $poutput .= '</a>';\n }\n\n if ($lastpage > $num & $start < $lastpage) {\n $poutput .= '<a href=\" ' . htmlentities($_SERVER[\"PHP_SELF\"], ENT_QUOTES);\n $poutput .= '?start=' . ($start + 1);\n if ($id != '')\n $poutput .= '&id=' . $id;\n $poutput .= '\">';\n $poutput .= '[ > ]';\n $poutput .= '</a>';\n }\n\n echo $poutput;\n }\n}", "public function genPageNums()\n\t{\n\t\t$pageLinks = array();\t\n\t\n\t\tfor($i=1; $i<=$this->numofpages; $i++)\n\t\t{\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\t\n\t\n\t\tif(($this->totalrows % $this->limit) != 0)\n\t\t{\n\t\t\t$this->numofpages++;\n\t\t\t$page = $i;\n\t\t\t$item = $this->itemTpl;\t\t\t\n\t\t\tif($this->page == $i)\n\t\t\t{\n\t\t\t\t$styleclass = 'page_current';\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$styleclass = 'page';\n\t\t\t}\n\t\t\t$item = str_replace(array('{pageclass}','{pagelink}', '{pagetext}'),\n\t\t\t\t\t\t\t\tarray($styleclass, $this->prepend.$page.$this->append, $i),\n\t\t\t\t\t\t\t\t$item);\t\t\t\t\t\n\t\t\t$pageLinks[$i] = $item;\n\t\t}\n\t\tksort($pageLinks);\n\t\t$this->pagination['nums'] = $pageLinks;\n\t}", "function set_pagination(){\n\t\tif ($this->rpp>0)\n\t\t{\n\t\t\t$compensation= ($this->num_rowset % $this->rpp)>0 ? 1 : 0;\n\t\t\t$num_pages = (int)($this->num_rowset / $this->rpp) + $compensation;\n\t\t} else {\n\t\t\t$compensation = 0;\n\t\t\t$num_pages = 1;\n\t\t}\n\n\t\tif ($num_pages>1){\n\t\t\t$this->tpl->add(\"pagination\", \"SHOW\", \"TRUE\");\n\n\t\t\tfor ($i=0; $i<$num_pages; $i++){\n\t\t\t\t$this->tpl->add(\"page\", array(\n\t\t\t\t\t\"CLASS\"\t=> \"\",\n\t\t\t\t\t\"VALUE\"\t=> \"\",\n\t\t\t\t));\n\t\t\t\t$this->tpl->parse(\"page\", true);\n\t\t\t}\n\t\t}\n/*\n\t\t\t<patTemplate:tmpl name=\"pagination\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t<div class=\"pagination\">\n\t\t\t\t<ul>\t\n\t\t\t\t\t<patTemplate:tmpl name=\"prev_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li class=\"disablepage\"><a href=\"javascript: return false;\">« Предишна</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t\t<patTemplate:tmpl name=\"page\">\n\t\t\t\t\t<li {CLASS}>{VALUE}</li>\n\t\t\t\t\t</patTemplate:tmpl>\n<!--\n\t\t\t\t\t<li class=\"currentpage\">1</li>\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">2</a></li>\n\t\t\t\t\t<li><a href=\"?page=2&sort=date&type=desc\">3</a></li>\n//-->\n\t\t\t\t\t<patTemplate:tmpl name=\"next_page\" type=\"simplecondition\" requiredvars=\"SHOW\">\n\t\t\t\t\t<li><a href=\"?page=1&sort=date&type=desc\">Следваща »</a></li>\n\t\t\t\t\t</patTemplate:tmpl>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t</patTemplate:tmpl>\n*/\n\t}", "public function paginate()\n {\n }", "function smarty_function_pager($params, &$smarty) {\n $result = '';\n \n if (!isset($params['delta'])) {\n $params['delta'] = 3;\n }\n \n if ($params && $params['pages'] > 1) {\n $result = '<div class=\"dg_pager_container\">';\n \n if ($params['current'] > 1) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"1\">First</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] - 1).'\">Prev</a> ';\n }\n \n $pager_start = $params['current'] <= $params['delta'] ? 1 : $params['current'] - $params['delta'];\n $pager_stop = $params['current'] > $params['pages'] - $params['delta'] ? $params['pages'] : $params['current'] + $params['delta'];\n \n if ($params['current'] > $params['delta'] + 1) {\n /*for ($i = 1; $i <= $params['delta'] + 1; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n $result .= ' ... ';\n }\n \n for ($i = $pager_start; $i <= $pager_stop; ++$i) {\n if ($i == $params['current']) {\n $result .= ' <span>['.$i.']</span> ';\n } else {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }\n }\n \n if ($params['current'] < $params['pages'] - $params['delta']) {\n $result .= ' ... ';\n /*for ($i = $params['pages'] - $params['delta']; $i <= $params['pages']; ++$i) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$i.'\">'.$i.'</a> ';\n }*/\n }\n\n if ($params['current'] < $params['pages']) {\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.($params['current'] + 1).'\">Next</a> ';\n $result .= ' <a href=\"javascript: void(0);\" class=\"dg_pager\" page=\"'.$params['pages'].'\">Last</a> ';\n }\n \n $result .= '</div>';\n }\n \n return $result;\n}", "public function getPages();", "public function getPerPage();", "public function actionList()\n {\n $this->adminOnly();\n\n $pages = $this->findAll();\n return $this->render('@custom_pages/views/common/list', [\n 'pages' => $pages,\n 'label' => Yii::createObject($this->getPageClassName())->getLabel(),\n 'subNav' => \\humhub\\modules\\custom_pages\\widgets\\ContainerPageMenu::widget()\n ]);\n }", "function go_page_list() {\n\t\tglobal $ROW, $TEMPLATE;\n\t\tLOG_MSG('INFO',\"go_page_list(): START \");\n\t\t// Do we have a search string?\n\t\t// Get all the args from $_GET\n\t\t$name=get_arg($_GET,\"name\");\n\t\t$title=get_arg($_GET,\"title\");\n\t\t$type=get_arg($_GET,\"type\");\n\t\tLOG_MSG('DEBUG',\"go_page_list(): Got args\");\n\t\t// Validate parameters as normal strings \n\t\tLOG_MSG('DEBUG',\"go_page_list(): Validated args\");\n\t\t// Rebuild search string for future pages\n\t\t$search_str=\"name=$name&title=$title&type=$type\";\n\t\t$ROW=$this->admin_model->db_page_select(\n\t\t\t\"\",\n\t\t\t\t$name,\n\t\t\t\t$title,\n\t\t\t\t'',\n\t\t\t\t$type);\n\n\t\tif ( $ROW[0]['STATUS'] != \"OK\" ) {\n\t\t\tadd_msg(\"ERROR\",\"There was an error loading the Pages. Please try again later. \");\n\t\t\treturn;\n\t\t}\n\t\t\t\t$this->data['rows'] = $ROW;\n\t\t\t\t$this->load->view('admin/html/header', $this->data,'');\n\t\t\t\t$this->load->view('admin/html/topbar', $this->data);\n\t\t\t\t$this->load->view('admin/html/leftnav', $this->data);\n\t\t\t\t$this->load->view('admin/page/list', $this->data);\n\t\t\t\t$this->load->view('admin/html/footer', $this->data);\n\t\tLOG_MSG('INFO',\"go_page_list(): END\");\n\t}", "public function getPages() {}", "public function page_numbers() {\n $pages = $this->total_pages();\n $query = htmlentities($this->term);\n $page = $this->pagenumber;\n $next = get_string('next', 'search');\n $back = get_string('back', 'search');\n\n $ret = \"<div align='center' id='search_page_links'>\";\n\n //Back is disabled if we're on page 1\n if ($page > 1) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page-1).\"'>&lt; {$back}</a>&nbsp;\";\n } else {\n $ret .= \"&lt; {$back}&nbsp;\";\n } \n\n //don't <a href> the current page\n for ($i = 1; $i <= $pages; $i++) {\n if ($page == $i) {\n $ret .= \"($i)&nbsp;\";\n } else {\n $ret .= \"<a href='query.php?query_string={$query}&page={$i}'>{$i}</a>&nbsp;\";\n } \n } \n\n //Next disabled if we're on the last page\n if ($page < $pages) {\n $ret .= \"<a href='query.php?query_string={$query}&page=\".($page+1).\"'>{$next} &gt;</a>&nbsp;\";\n } else {\n $ret .= \"{$next} &gt;&nbsp;\";\n } \n\n $ret .= \"</div>\";\n\n //shorten really long page lists, to stop table distorting width-ways\n if (strlen($ret) > 70) {\n $start = 4;\n $end = $page - 5;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n\n $start = $page + 5;\n $end = $pages - 3;\n $ret = preg_replace(\"/<a\\D+\\d+\\D+>$start<\\/a>.*?<a\\D+\\d+\\D+>$end<\\/a>/\", '...', $ret);\n }\n\n return $ret;\n }", "function paging($condition = \"1\", $listing_per_page = NULL, $h_link = NULL, $from_clause = NULL)\n {\n /*\n * General link\n */\n $h_link = isset($h_link) ? $h_link : '?';\n\n /*\n * Read the page number\n */\n $page = isset($_GET['page']) ? $_GET['page'] : \"1\";\n\n /*\n * Total page\n */\n $total = $this->countEntry($condition, $from_clause);\n\n /*\n * List per page\n */\n $listing_per_page = isset($listing_per_page) ? $listing_per_page : app::Config()->Setting('default_pagination');\n\t\t$listing_per_page = (empty($listing_per_page) or !is_numeric($listing_per_page)) ? $total : $listing_per_page;\n\n /*\n * Tota page in the selection\n */\n $tpage = isset($listing_per_page) && ($listing_per_page != 0) ? ceil($total / $listing_per_page) : $total;\n\n /*\n *\tTotal page\n */\n $spage = ($tpage == 0) ? ($tpage + 1) : $tpage;\n $startfrom = ($page - 1) * $listing_per_page;\n $endto = ($page) * $listing_per_page;\n if ($endto > $total) {\n $endto = $total;\n }\n $page_no = \"\";\n $s = $i = $page - 5;\n $s = ($s < 1) ? 1 : $s;\n $sp_link = '';\n for ($i = $s; $i <= $page + 5 && $i <= $tpage; $i++) {\n if ($i == $page) {\n $page_no .= \"<strong classs=\\\"page_selected\\\">\" . $this->__($i) . \"</strong> \";\n }\n else {\n $page_no .= '<a href=\"' . $h_link . '&page=' . $i . '\">' . $this->__($i) . '</a> ';\n }\n\n $sp_link .= ($i == $page) ? \"<li class=\\\"current\\\">{$i}</li>\" : '<li><a href=\"' . $h_link . '&page=' . $i . '\">' . $i . '</a> </li>';\n }\n\n /**\n * Bulid link\n */\n $link = ($page_no != \"\") ? \"Showing Results \" . ($startfrom + 1) . \"-$endto of $total\" : \"\";\n\n /**\n * Build Pagination string\n */\n $paging = '';\n $sp_prev = '<li class=\"disabled\">' . PREVIOUS_PAGE . '</li>';\n $sp_next = '<li class=\"disabled\">' . NEXT_PAGE . '</li>';\n if ($tpage > 1) {\n $nextpage = $page + 1;\n $prevpage = $page - 1;\n\n $prevlink = '<a href=\"' . $h_link . '&amp;page=' . $prevpage . '\" class=\"page_previous\" title=\"' . $this->__(PREVIOUS_PAGE) . '\">' . $this->__(PREVIOUS_PAGE) . '</a>';\n $nextlink = '<a href=\"' . $h_link . '&amp;page=' . $nextpage . '\" class=\"page_next\" title=\"' . $this->__(NEXT_PAGE) . '\">' . $this->__(NEXT_PAGE) . '</a>';\n\n if ($page == $tpage) {\n $paging = \"$prevlink\";\n $sp_prev = \"<li>$paging</li>\";\n $sp_next = '<li class=\"disabled\">' . NEXT_PAGE . '</li>';\n\n }\n elseif ($tpage > $page && $page > 1) {\n $paging = \"$prevlink | $nextlink\";\n $sp_prev = \"<li>$prevlink</li>\";\n $sp_next = \"<li>$nextlink</li>\";\n }\n elseif ($tpage > $page && $page <= 1) {\n $paging = \"$nextlink\";\n $sp_prev = '<li class=\"disabled\">' . PREVIOUS_PAGE . '</li>';\n $sp_next = \"<li>$paging</li>\";\n }\n }\n\n /*\n * Build query\n */\n $limite = isset($listing_per_page) ? \" \" . $this->__(\"limit\") . \" $startfrom, $listing_per_page\" : \"\";\n $query = $this->query_builder($this->name, $condition . $limite, $from_clause);\n\n /*\n * Feach data based on SQL\n */\n $info_array = $this->fetch_rows($query);\n\n /*\n * Data to return\n */\n $gross['data'] = $info_array;\n $gross['paging'] = $paging;\n $gross['link'] = $link;\n $gross['total'] = $total + 0;\n $gross['page'] = $page + 0;\n $gross['paging_str'] =\n '<div class=\"pagination pagination-left\">\n\t\t\t\t<div class=\"results\">\n\t\t\t\t\t<span>' . $link . '</span>\n\t\t\t\t</div>\n\t\t\t\t<ul class=\"pager\">\n\t\t\t\t\t' . $sp_prev . '\n\t\t\t\t\t' . $sp_link . '\n\t\t\t\t\t' . $sp_next . '\n\t\t\t\t</ul>\n\t\t\t</div>';\n return $gross;\n }", "public function getPaginated();", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "function get_test_pager($page, $num_results) {\n\t\t$pager = $this->db->get_pager(\n\t\t\t\"select * from tasks where status < 3 order by suspense_date\"\n\t\t);\n\n\t\t// override defaults\n\t\t$pager->set_rows($num_results);\n\t\t$pager->set_page($page);\n\n\t\treturn $pager;\n\t}", "public function index()\n {\n\t\t$totalComments = count($this->model->findAllWithTheirAuthor(\"p_datetime DESC\"));\n\t\t$itemPerpage = 5;\n\t\t$totalPages = ceil($totalComments/$itemPerpage); //ceil around superior number\n\t\t\n\t\tif(isset($_GET['page']) AND !empty($_GET['page']) AND $_GET['page'] > 0)\n {\n $_GET['page'] = intval($_GET['page']); //return an entier value\n $currentPage = $_GET['page'];\n }\n else\n {\n $currentPage = 1;\n\t\t}\n\t\t$start = ($currentPage - 1)*$itemPerpage;\n $posts = $this->model->countItems($start, $itemPerpage, \"p_datetime\");\n\t\t\n\t\t$pageTitle = \"Articles\";\n\t\t\n\t\t$description = \"Liste des articles\";\n\n\t\t$author = \"Invest People\";\n\n \\Renderer::render('post/index', compact('pageTitle', 'posts', 'description', 'author', 'totalPages')); \n\t}", "function honeycomb_paging_nav() {\n\t\tglobal $wp_query;\n\n\t\t$args = array(\n\t\t\t'type' \t => 'list',\n\t\t\t'next_text' => _x( 'Next', 'Next post', 'honeycomb' ),\n\t\t\t'prev_text' => _x( 'Previous', 'Previous post', 'honeycomb' ),\n\t\t\t);\n\n\t\tthe_posts_pagination( $args );\n\t}", "function displayPager( $pagerCurrent, $pagesCount ) {\n // Middle is used to \"center\" pages around the current page.\n $pager_middle = ceil( $this->pagerLimit / 2 );\n // first is the first page listed by this pager piece (re quantity)\n $pagerFirst = $pagerCurrent - $pager_middle + 1;\n // last is the last page listed by this pager piece (re quantity)\n $pagerLast = $pagerCurrent + $this->pagerLimit - $pager_middle;\n\n // Prepare for generation loop.\n $i = $pagerFirst;\n if ( $pagerLast > $pagesCount ) {\n // Adjust \"center\" if at end of query.\n $i = $i + ( $pagesCount - $pagerLast );\n $pagerLast = $pagesCount;\n }\n if ( $i <= 0 ) {\n // Adjust \"center\" if at start of query.\n $pagerLast = $pagerLast + ( 1 - $i );\n $i = 1;\n }\n\n $output = '';\n if ( $pagesCount > 1 ) {\n $output .= '<ul class=\"c-pager\">';\n $pagerEllipsis = '<li class=\"c-pager-item c-pager-ellipsis\"><span>...</span></li>';\n\n // Whether to display the \"Previous page\" link\n if ( $pagerCurrent > 1 ) {\n $output .= '<li class=\"c-pager-item c-pager-previous\">' .\n Html::rawElement(\n 'a',\n array(\n 'rel' => 'nofollow',\n 'class' => 'c-pager-link',\n 'href' => '#cfirst',\n 'data-' . $this->pageQuery => ( $pagerCurrent - 1 ),\n ),\n '&lt;'\n ) .\n '</li>';\n }\n\n // Whether to display the \"First page\" link\n if ( $i > 1 ) {\n $output .= '<li class=\"c-pager-item c-pager-first\">' .\n Html::rawElement(\n 'a',\n array(\n 'rel' => 'nofollow',\n 'class' => 'c-pager-link',\n 'href' => '#cfirst',\n 'data-' . $this->pageQuery => 1,\n ),\n 1\n ) .\n '</li>';\n }\n\n // When there is more than one page, create the pager list.\n if ( $i != $pagesCount ) {\n if ( $i > 2 ) {\n $output .= $pagerEllipsis;\n }\n\n // Now generate the actual pager piece.\n for ( ; $i <= $pagerLast && $i <= $pagesCount; $i++ ) {\n if ( $i == $pagerCurrent ) {\n $output .= '<li class=\"c-pager-item c-pager-current\"><span>' .\n $i . '</span></li>';\n } else {\n $output .= '<li class=\"c-pager-item\">' .\n Html::rawElement(\n 'a',\n array(\n 'rel' => 'nofollow',\n 'class' => 'c-pager-link',\n 'href' => '#cfirst',\n 'data-' . $this->pageQuery => $i,\n ),\n $i\n ) .\n '</li>';\n }\n }\n\n if ( $i < $pagesCount ) {\n $output .= $pagerEllipsis;\n }\n }\n\n // Whether to display the \"Last page\" link\n if ( $pagesCount > ( $i - 1 ) ) {\n $output .= '<li class=\"c-pager-item c-pager-last\">' .\n Html::rawElement(\n 'a',\n array(\n 'rel' => 'nofollow',\n 'class' => 'c-pager-link',\n 'href' => '#cfirst',\n 'data-' . $this->pageQuery => $pagesCount,\n ),\n $pagesCount\n ) .\n '</li>';\n }\n\n // Whether to display the \"Next page\" link\n if ( $pagerCurrent < $pagesCount ) {\n $output .= '<li class=\"c-pager-item c-pager-next\">' .\n Html::rawElement(\n 'a',\n array(\n 'rel' => 'nofollow',\n 'class' => 'c-pager-link',\n 'href' => '#cfirst',\n 'data-' . $this->pageQuery => ( $pagerCurrent + 1 ),\n ),\n '&gt;'\n ) .\n '</li>';\n }\n\n $output .= '</ul>';\n }\n\n return $output;\n }", "function getPagelist($sql = '', $fields = array(), $mod = array())\n{\n $count = count(db(sql));\n $totalNum = ceil($count / PAGE_NUM);\n $path = $request_url['path'];\n\n $page = (isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'];\n// 组装limit语句\n $limit = 'LIMIT' . ($page - 1) * PAGE_NUM . ',' . PAGE_NUM;\n $datas = db($sql, $limit);\n $html = getTable($datas, $fields, $mod);\n $start = ($page - PAGE_OFFSET) > 0 ? $page - PAGE_OFFSET : 1;//获取左侧位置的偏移\n $end = ($page + PAGE_OFFSET) < $totalNum ? $page + PAGE_OFFSET : $totalNum;\n $html .= '<div class=\"page\">';\n if ($page > 1) {\n $html .= '<a href=\"' . $path . '?page=' . ($page - 1) . '\">上一页</a>';\n $html .= '<a href=\"' . $path . '?page=1\">首页</a>';\n }\n for($i = $start;$i<=$end;$i++)\n {\n $class = ($i==$page)?'class=\"on\"':'';\n $html .='<a href =\"'.$path.'?page='.$i.'\"'.$class.'>'.$i.'</a>';\n\n\n }\n if ($page < $totalNum) {\n ;\n $html .= '<a href=\"' . $path . '?page='.$totalNum.'\">尾页</a>';\n $html .= '<a href=\"' . $path . '?page='.($page+1).'\">下一页</a>';\n }\n $html .='共'.$totalNum.'页';\n $html .='</div>';\n return $html;\n}", "public function create_links()\n {\n $totalPages = floor($this->total_records / $this->size);\n $totalPages += ($this->total_records % $this->size != 0) ? 1 : 0;\n if($totalPages < 1 || $totalPages == 1)\n return null;\n $output = null;\n $loopStart = 1;\n $loopEnd = $totalPages;\n if($totalPages > 5){\n if($this->page <= 3){\n $loopStart = 1;\n $loopEnd = 5;\n } else if($this->page >= $totalPages - 2){\n $loopStart = $totalPages - 4;\n $loopEnd = $totalPages;\n } else{\n $loopStart = $this->page - 2;\n $loopEnd = $this->page + 2;\n }\n }\n if($loopStart != 1){\n $output .= sprintf('<a id=\"back\" href=\"' . $this->link . '\">&#171;</a>', '1');\n }\n if($this->page > 1){\n $output .= sprintf('<a id=\"prev\" href=\"' . $this->link . '\">' . __('Previous') . '</a>', $this->page - 1);\n }\n for($i = $loopStart; $i <= $loopEnd; $i++){\n if($i == $this->page){\n $output .= '<a class=\"on\">' . $i . '</a>';\n } else{\n $output .= sprintf('<a href=\"' . $this->link . '\">', $i) . $i . '</a>';\n }\n }\n if($this->page < $totalPages){\n $output .= sprintf('<a id=\"next\" href=\"' . $this->link . '\">' . __('Next') . '</a>', $this->page + 1);\n }\n if($loopEnd != $totalPages){\n $output .= sprintf('<a id=\"forward\" href=\"' . $this->link . '\">&#187;</a>', $totalPages);\n }\n return '<div id=\"pagination\"><ul><li>' . $output . '</li></ul></div>';\n }", "function generate_pagination($base_url, $num_items, $per_page, $start_item, $add_prevnext_text = false, $tpl_prefix = '')\n{\n\tglobal $template, $user;\n\n\t// Make sure $per_page is a valid value\n\t$per_page = ($per_page <= 0) ? 1 : $per_page;\n\n\t$seperator = '<span class=\"page-sep\">' . $user->lang['COMMA_SEPARATOR'] . '</span>';\n\t$total_pages = ceil($num_items / $per_page);\n\n\tif ($total_pages == 1 || !$num_items)\n\t{\n\t\treturn false;\n\t}\n\n\t$on_page = floor($start_item / $per_page) + 1;\n\t$url_delim = (strpos($base_url, '?') === false) ? '?' : ((strpos($base_url, '?') === strlen($base_url) - 1) ? '' : '&amp;');\n\n\t$page_string = ($on_page == 1) ? '<strong>1</strong>' : '<a href=\"' . $base_url . '\">1</a>';\n\n\tif ($total_pages > 5)\n\t{\n\t\t$start_cnt = min(max(1, $on_page - 4), $total_pages - 5);\n\t\t$end_cnt = max(min($total_pages, $on_page + 4), 6);\n\n\t\t$page_string .= ($start_cnt > 1) ? ' ... ' : $seperator;\n\n\t\tfor ($i = $start_cnt + 1; $i < $end_cnt; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $end_cnt - 1)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\n\t\t$page_string .= ($end_cnt < $total_pages) ? ' ... ' : $seperator;\n\t}\n\telse\n\t{\n\t\t$page_string .= $seperator;\n\n\t\tfor ($i = 2; $i < $total_pages; $i++)\n\t\t{\n\t\t\t$page_string .= ($i == $on_page) ? '<strong>' . $i . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($i - 1) * $per_page) . '\">' . $i . '</a>';\n\t\t\tif ($i < $total_pages)\n\t\t\t{\n\t\t\t\t$page_string .= $seperator;\n\t\t\t}\n\t\t}\n\t}\n\n\t$page_string .= ($on_page == $total_pages) ? '<strong>' . $total_pages . '</strong>' : '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($total_pages - 1) * $per_page) . '\">' . $total_pages . '</a>';\n\n\tif ($add_prevnext_text)\n\t{\n\t\tif ($on_page != 1)\n\t\t{\n\t\t\t$page_string = '<a href=\"' . $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page) . '\">' . $user->lang['PREVIOUS'] . '</a>&nbsp;&nbsp;' . $page_string;\n\t\t}\n\n\t\tif ($on_page != $total_pages)\n\t\t{\n\t\t\t$page_string .= '&nbsp;&nbsp;<a href=\"' . $base_url . \"{$url_delim}start=\" . ($on_page * $per_page) . '\">' . $user->lang['NEXT'] . '</a>';\n\t\t}\n\t}\n\n\t$template->assign_vars(array(\n\t\t$tpl_prefix . 'BASE_URL'\t\t=> $base_url,\n\t\t'A_' . $tpl_prefix . 'BASE_URL'\t=> addslashes($base_url),\n\t\t$tpl_prefix . 'PER_PAGE'\t\t=> $per_page,\n\n\t\t$tpl_prefix . 'PREVIOUS_PAGE'\t=> ($on_page == 1) ? '' : $base_url . \"{$url_delim}start=\" . (($on_page - 2) * $per_page),\n\t\t$tpl_prefix . 'NEXT_PAGE'\t\t=> ($on_page == $total_pages) ? '' : $base_url . \"{$url_delim}start=\" . ($on_page * $per_page),\n\t\t$tpl_prefix . 'TOTAL_PAGES'\t\t=> $total_pages,\n\t));\n\n\treturn $page_string;\n}", "protected function paginate()\n {\n if ($this->currentItem == $this->pagerfanta->getMaxPerPage() and $this->pagerfanta->hasNextPage()) {\n $this->pagerfanta->setCurrentPage($this->pagerfanta->getNextPage());\n $this->loadData();\n }\n }", "public function getItemsPerPage();", "public function getItemsPerPage();", "function paginator($params, $count) {\n $limit = $params->getLimit();\n if ($count > $limit && $count!=0){\n $page = $params->getPage(); \n $controllerName = strtolower(Zend_Controller_Front::getInstance()->getRequest()->getControllerName()); \n $pagination = ($page != 1)?'<span><a href=\"\"onclick=\"Grid.page('.($page-1).'); return false\"><<</a></span>':''; \n if ($page > 10){ \n $pagination .= '<a href=\"\" onclick=\"Grid.page(1); return false;\">1</a>';\n $pagination .= '<span>...</span>';\n }\n $pageSpliter = ($page - 5 >= 1 ? $page - 4 : 1);\n for ($i = $pageSpliter; ($count + $limit) / ($i*$limit) > 1 && $i < $pageSpliter + 10; $i++) {\n $pagination .= '<a href=\"\" onclick=\"Grid.page('.$i.'); return false;\" class=\"'. ($page == $i ? \"active\":\"\") .'\">'.$i.'</a>';\n } \n $lastPage = floor(($count + $limit -1) / $limit);\n if ($page < $lastPage - 10){\n $pagination .= '<span>...</span>'; \n $pagination .= '<a href=\"\" onclick=\"Grid.page('. $lastPage .'); return false;\">'.$lastPage .'</a>';\n }\n $pagination .= ($page < ($count/$limit))?'<span><a href=\"\"onclick=\"Grid.page('.($page+1).'); return false\">>></a></span>':''; \n echo '<div class=\"pagination\">'; \n echo $pagination; \n echo '</div>';\n } \n }", "public function indexAction() {\n\t\t$this->_model->where_clause(NULL);\n\n\t\tif(!isset($this->params['page'])) {\n\t\t\tself::$params['page'] = 1;\n\t\t} \n\n\t\t$this->_view->data['info'] = $this->_model->getPage($this->params['page'], $this->config->pagination_limit);\n\t\t$this->_view->data['total_items'] = $this->_model->getCount();\n\t\t$this->addModuleTemplate($this->module, 'index');\n\n\t}", "public function show()\n {\n $html = '<div class=\"page_selector\">';\n\n $startPage = $this->currentPage - 5;\n $startPage > 1 ? $html .= '<span><a href=\"' . $this->generateUrl(1) . '\">1</a></span><span class=\"more_page\">...</span>'\n : $startPage = 1;\n for ($i = $startPage; $i < $this->currentPage; $i++) {\n $html .= '<span><a href=\"' . $this->generateUrl($i) . '\">' . $i . '</a></span>';\n }\n\n $html .= '<span><div class=\"current_page\">' . $this->currentPage . '</div></span>';\n\n $endPage = $this->currentPage + 5;\n $endPage < $this->totalPage ? '' : $endPage = $this->totalPage;\n for ($i = $this->currentPage + 1; $i <= $endPage; $i++) {\n $html .= '<span><a href=\"' . $this->generateUrl($i) . '\">' . $i . '</a></span>';\n }\n $endPage != $this->totalPage ? $html .= '<span class=\"more_page\">...</span><span><a href=\"' . $this->generateUrl($this->totalPage)\n . '\">' . $this->totalPage . '</a></span>' : '';\n\n return $html . '<span><div class=\"total_page\">total ' . $this->totalPage . ' page</div></span></div>';\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function getPaginationDataSource();", "public function getPaginationHtml();", "protected function pagination( $which ) {\n\t\t\tif ( empty( $this->_pagination_args ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$total_items = $this->_pagination_args['total_items'];\n\t\t\t$total_pages = $this->_pagination_args['total_pages'];\n\t\t\t$infinite_scroll = false;\n\t\t\tif ( isset( $this->_pagination_args['infinite_scroll'] ) ) {\n\t\t\t\t$infinite_scroll = $this->_pagination_args['infinite_scroll'];\n\t\t\t}\n\n\t\t\tif ( 'top' === $which && $total_pages > 1 ) {\n\t\t\t\t$this->screen->render_screen_reader_content( 'heading_pagination' );\n\t\t\t}\n\n\t\t\t/* translators: %s: number of items (2x) */\n\t\t\t$output = '<span class=\"displaying-num\">' . sprintf( _n( '%s item', '%s items', $total_items ), number_format_i18n( $total_items ) ) . '</span>';\n\n\t\t\t$current = $this->get_pagenum();\n\t\t\tif ( $this->search_value != $this->search_value_old ) {\n\t\t\t\t$current = 1;\n\t\t\t}\n\n\t\t\t// *********************\n\t\t\t// *** BEGIN CHANGES ***\n\t\t\t// *********************\n\t\t\t// Code removed.\n\t\t\t// *******************\n\t\t\t// *** END CHANGES ***\n\t\t\t// *******************\n\t\t\t$page_links = array();\n\n\t\t\t$total_pages_before = '<span class=\"paging-input\">';\n\t\t\t$total_pages_after = '</span></span>';\n\n\t\t\t$disable_first = $disable_last = $disable_prev = $disable_next = false;\n\n\t\t\tif ( 1 === (int) $current ) {\n\t\t\t\t$disable_first = true;\n\t\t\t\t$disable_prev = true;\n\t\t\t}\n\t\t\tif ( 2 === (int) $current ) {\n\t\t\t\t$disable_first = true;\n\t\t\t}\n\t\t\tif ( (int) $current === (int) $total_pages ) {\n\t\t\t\t$disable_last = true;\n\t\t\t\t$disable_next = true;\n\t\t\t}\n\t\t\tif ( (int) $current === (int) $total_pages - 1 ) {\n\t\t\t\t$disable_last = true;\n\t\t\t}\n\n\t\t\t// *********************\n\t\t\t// *** BEGIN CHANGES ***\n\t\t\t// *********************\n\t\t\t$link_with_post_support = \"\n <a class='%s' \n href='javascript:void(0)' \n onclick='jQuery(\\\"#current-page-selector\\\").val(\\\"%s\\\"); jQuery(\\\"#wpda_main_form\\\").submit();'>\n <span class='screen-reader-text'>%s</span>\n <span aria-hidden='true'>%s</span>\n </a>\";\n\t\t\t// *******************\n\t\t\t// *** END CHANGES ***\n\t\t\t// *******************\n\t\t\tif ( $disable_first ) {\n\t\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&laquo;</span>';\n\t\t\t} else {\n\t\t\t\t// *********************\n\t\t\t\t// *** BEGIN CHANGES ***\n\t\t\t\t// *********************\n\t\t\t\t$page_links[] = sprintf(\n\t\t\t\t\t$link_with_post_support,\n\t\t\t\t\t'first-page button',\n\t\t\t\t\t'',\n\t\t\t\t\t__( 'First page' ),\n\t\t\t\t\t'&laquo;'\n\t\t\t\t);\n\t\t\t\t// *******************\n\t\t\t\t// *** END CHANGES ***\n\t\t\t\t// *******************\n\t\t\t}\n\n\t\t\tif ( $disable_prev ) {\n\t\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&lsaquo;</span>';\n\t\t\t} else {\n\t\t\t\t// *********************\n\t\t\t\t// *** BEGIN CHANGES ***\n\t\t\t\t// *********************\n\t\t\t\t$page_links[] = sprintf(\n\t\t\t\t\t$link_with_post_support,\n\t\t\t\t\t'prev-page button',\n\t\t\t\t\tmax( 1, $current - 1 ),\n\t\t\t\t\t__( 'Previous page' ),\n\t\t\t\t\t'&lsaquo;'\n\t\t\t\t);\n\t\t\t\t// *******************\n\t\t\t\t// *** END CHANGES ***\n\t\t\t\t// *******************\n\t\t\t}\n\n\t\t\tif ( 'bottom' === $which ) {\n\t\t\t\t$html_current_page = $current;\n\t\t\t\t$total_pages_before = '<span class=\"screen-reader-text\">' . __( 'Current Page' ) . '</span><span id=\"table-paging\" class=\"paging-input\"><span class=\"tablenav-paging-text\">';\n\t\t\t} else {\n\t\t\t\t$html_current_page = sprintf(\n\t\t\t\t\t\"%s<input class='current-page' id='current-page-selector' type='text' name='paged' value='%s' size='%d' aria-describedby='table-paging' /><span class='tablenav-paging-text'>\",\n\t\t\t\t\t'<label for=\"current-page-selector\" class=\"screen-reader-text\">' . __( 'Current Page' ) . '</label>',\n\t\t\t\t\t$current,\n\t\t\t\t\tstrlen( $total_pages )\n\t\t\t\t);\n\t\t\t}\n\t\t\t$html_total_pages = sprintf( \"<span class='total-pages'>%s</span>\", number_format_i18n( $total_pages ) );\n\t\t\t/* translators: %s: current page/total pages */\n\t\t\t$page_links[] = $total_pages_before . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . $total_pages_after;\n\n\t\t\tif ( $disable_next ) {\n\t\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&rsaquo;</span>';\n\t\t\t} else {\n\t\t\t\t// *********************\n\t\t\t\t// *** BEGIN CHANGES ***\n\t\t\t\t// *********************\n\t\t\t\t$page_links[] = sprintf(\n\t\t\t\t\t$link_with_post_support,\n\t\t\t\t\t'next-page button',\n\t\t\t\t\tmin( $total_pages, $current + 1 ),\n\t\t\t\t\t__( 'Next page' ),\n\t\t\t\t\t'&rsaquo;'\n\t\t\t\t);\n\t\t\t\t// *******************\n\t\t\t\t// *** END CHANGES ***\n\t\t\t\t// *******************\n\t\t\t}\n\n\t\t\tif ( $disable_last ) {\n\t\t\t\t$page_links[] = '<span class=\"tablenav-pages-navspan button disabled\" aria-hidden=\"true\">&raquo;</span>';\n\t\t\t} else {\n\t\t\t\t// *********************\n\t\t\t\t// *** BEGIN CHANGES ***\n\t\t\t\t// *********************\n\t\t\t\t$page_links[] = sprintf(\n\t\t\t\t\t$link_with_post_support,\n\t\t\t\t\t'last-page button',\n\t\t\t\t\t$total_pages,\n\t\t\t\t\t__( 'Last page' ),\n\t\t\t\t\t'&raquo;'\n\t\t\t\t);\n\t\t\t\t// *******************\n\t\t\t\t// *** END CHANGES ***\n\t\t\t\t// *******************\n\t\t\t}\n\n\t\t\t$pagination_links_class = 'pagination-links';\n\t\t\tif ( ! empty( $infinite_scroll ) ) {\n\t\t\t\t$pagination_links_class = ' hide-if-js';\n\t\t\t}\n\t\t\t$output .= \"\\n<span class='$pagination_links_class'>\" . join( \"\\n\", $page_links ) . '</span>';\n\n\t\t\tif ( $total_pages ) {\n\t\t\t\t$page_class = $total_pages < 2 ? ' one-page' : '';\n\t\t\t} else {\n\t\t\t\t$page_class = ' no-pages';\n\t\t\t}\n\t\t\t$this->_pagination = \"<div class='tablenav-pages{$page_class}'>$output</div>\";\n\n\t\t\techo $this->_pagination;\n\t\t}", "public function index()\r\n {\r\n $this->page_list_grid();\r\n }", "function displayPaging()\r\n {\r\n\t $InfoArray = $this->InfoArray();\r\n \r\n\t /* Everything below here are just examples! */\r\n\t\r\n\t /* Print our some info like \"Displaying page 1 of 49\" */\r\n\t echo \"Displaying page \" . $InfoArray[\"CURRENT_PAGE\"] . \" of \" . $InfoArray[\"TOTAL_PAGES\"] . \"<BR>\";\r\n\t echo \"Displaying results \" . $InfoArray[\"START_OFFSET\"] . \" - \" . $InfoArray[\"END_OFFSET\"] . \" of \" . $InfoArray[\"TOTAL_RESULTS\"] . \"<BR>\";\r\n\t\r\n\t /* Print our first link */\r\n\t if($InfoArray[\"CURRENT_PAGE\"]!= 1) {\r\n\t\t echo \"<a href='?page=1'>&lt;&lt;</a> \";\r\n\t } else {\r\n\t\t echo \"&lt;&lt; \";\r\n\t }\r\n\t\r\n\t /* Print out our prev link */\r\n\t if($InfoArray[\"PREV_PAGE\"]) {\r\n\t\t echo \"<a href='?page=\" . $InfoArray[\"PREV_PAGE\"] . \"'>Previous</a> | \";\r\n\t } else {\r\n\t\t echo \"Previous | \";\r\n\t }\r\n\t\r\n\t /* Example of how to print our number links! */\r\n\t for($i=0; $i<count($InfoArray[\"PAGE_NUMBERS\"]); $i++) {\r\n\t\t if($InfoArray[\"CURRENT_PAGE\"] == $InfoArray[\"PAGE_NUMBERS\"][$i]) {\r\n\t\t\t echo $InfoArray[\"PAGE_NUMBERS\"][$i] . \" | \";\r\n\t\t } else {\r\n\t\t\t echo \"<a href='?page=\" . $InfoArray[\"PAGE_NUMBERS\"][$i] . \"'>\" . $InfoArray[\"PAGE_NUMBERS\"][$i] . \"</a> | \";\r\n\t\t }\r\n\t }\r\n\t\r\n\t /* Print out our next link */\r\n\t if($InfoArray[\"NEXT_PAGE\"]) {\r\n\t\t echo \" <a href='?page=\" . $InfoArray[\"NEXT_PAGE\"] . \"'>Next</a>\";\r\n\t } else {\r\n\t\t echo \" Next\";\r\n\t }\r\n\t\r\n\t /* Print our last link */\r\n\t if($InfoArray[\"CURRENT_PAGE\"]!= $InfoArray[\"TOTAL_PAGES\"]) {\r\n\t\t echo \" <a href='?page=\" . $InfoArray[\"TOTAL_PAGES\"] . \"'>>></a>\";\r\n\t } else {\r\n\t\t echo \" &gt;&gt;\";\r\n\t }\r\n\t}", "public function get()\n {\n // To write links\n $links = null;\n // We get restrictions for the cycle\n $limits = $this->limits();\n\n $html = '<ul class=\"pagination\">';\n // Generate links\n for ($page = $limits[0]; $page <= $limits[1]; $page++) {\n // If the current page is the current page, there is no link and the active class is added\n if ($page == $this->current_page) {\n $links .= '<li class=\"active\"><a href=\"//\">' . $page . '</a></li>';\n } else {\n // Else generate a link\n $links .= $this->generateHtml($page);\n }\n }\n\n // If the links were created\n if (!is_null($links)) {\n // If the current page is not the first one\n if ($this->current_page > 1)\n // Create a link to \"To first\"\n $links = $this->generateHtml(1, '&lt;') . $links;\n // If the current page is not the first one\n if ($this->current_page < $this->amount)\n // Create a link \"To the last\"\n $links .= $this->generateHtml($this->amount, '&gt;');\n }\n\n $html .= $links . '</ul>';\n\n // Return html\n return $html;\n }", "public function index()\n {\n $sort = FacadesRequest::get('sort');\n $dir = FacadesRequest::get('direction');\n\n if ($sort == '')\n $sort = 'created_at';\n\n $search = FacadesRequest::get('q');\n if ($search != '') {\n $pages = Page::where('name', 'LIKE', '%' . $search . '%')\n ->orWhere('description', 'LIKE', '%' . $search . '%')\n ->orderBy($sort, $dir)->paginate(10);\n }\n else {\n $pages = Page::orderBy($sort, $dir)->paginate(10);\n }\n\n\n return PageResource::collection($pages);\n }", "public function page_links()\n\t{\n\t\tif ($this->total_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\t\t\n\t\t$pagination = '';\n\t\t\n\t\t// Let's get the starting page number, this is determined using num_links\n\t\t$start = (($this->current_page - $this->num_links) > 0) ? $this->current_page - ($this->num_links - 1) : 1;\n\n\t\t// Let's get the ending page number\n\t\t$end = (($this->current_page + $this->num_links) < $this->total_pages) ? $this->current_page + $this->num_links : $this->total_pages;\n\n\t\tfor ($i = $start; $i <= $end; $i++)\n\t\t{\n\t\t\t$text = $i;\n\t\t\t$url = '#';\n\t\t\t$state = $this->template['state']['current_page'];\n\n\t\t\tif ($this->current_page != $i)\n\t\t\t{\n\t\t\t\t// detect if anchor attribute is presented in the template \n\t\t\t\tif (stripos('<a ', $this->template['page_start']) < 0)\n\t\t\t\t{\n\t\t\t\t\t$text = '<a href=\":url\">'.$i.'</a>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$url = $this->build_url($i);\n\t\t\t\t$state = '';\n\t\t\t}\n\n\t\t\t$pagination .= Str::tr($this->template['page_start'].$text.$this->template['page_end'], array(\n\t\t\t\t'state' => $state,\n\t\t\t\t'url' => $url,\n\t\t\t));\n\t\t}\n\n\t\treturn $pagination;\n\t}", "function getPagesLinks()\n\t{\n\t\tglobal $mainframe;\n\n\t\t$lang =& JFactory::getLanguage();\n\n\t\t// Build the page navigation list\n\t\t$data = $this->_buildDataObject();\n\n\t\t$list = array();\n\n\t\t$itemOverride = false;\n\t\t$listOverride = false;\n\n\t\t$chromePath = JPATH_THEMES.DS.$mainframe->getTemplate().DS.'html'.DS.'pagination.php';\n\t\tif (file_exists($chromePath))\n\t\t{\n\t\t\trequire_once ($chromePath);\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive')) {\n\t\t\t\t$itemOverride = true;\n\t\t\t}\n\t\t\tif (function_exists('pagination_list_render')) {\n\t\t\t\t$listOverride = true;\n\t\t\t}\n\t\t}\n\n\t\t// Build the select list\n\t\tif ($data->all->base !== null) {\n\t\t\t$list['all']['active'] = true;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\n\t\t} else {\n\t\t\t$list['all']['active'] = false;\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\n\t\t}\n\n\t\tif ($data->start->base !== null) {\n\t\t\t$list['start']['active'] = true;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\n\t\t} else {\n\t\t\t$list['start']['active'] = false;\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\n\t\t}\n\t\tif ($data->previous->base !== null) {\n\t\t\t$list['previous']['active'] = true;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\n\t\t} else {\n\t\t\t$list['previous']['active'] = false;\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\n\t\t}\n\n\t\t$list['pages'] = array(); //make sure it exists\n\t\tforeach ($data->pages as $i => $page)\n\t\t{\n\t\t\tif ($page->base !== null) {\n\t\t\t\t$list['pages'][$i]['active'] = true;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\n\t\t\t} else {\n\t\t\t\t$list['pages'][$i]['active'] = false;\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\n\t\t\t}\n\t\t}\n\n\t\tif ($data->next->base !== null) {\n\t\t\t$list['next']['active'] = true;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\n\t\t} else {\n\t\t\t$list['next']['active'] = false;\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\n\t\t}\n\t\tif ($data->end->base !== null) {\n\t\t\t$list['end']['active'] = true;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\n\t\t} else {\n\t\t\t$list['end']['active'] = false;\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\n\t\t}\n\n\t\tif($this->total > $this->limit){\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\n\t\t}\n\t\telse{\n\t\t\treturn '';\n\t\t}\n\t}", "public function indexAction()\n {\n $currentDate = date('Y-m');\n\n return $this->pagerAction($currentDate);\n }", "public function listing();", "public function getPageItems()\n {\n }", "function getPaging($refUrl, $aryOpts, $pgCnt, $curPg) {\n $return = '';\n $return.='<div class=\"box-bottom\"><div class=\"paginate\">';\n if ($curPg > 1) {\n $aryOpts['pg'] = 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">First</a>';\n\n $aryOpts['pg'] = $curPg - 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Prev</a>';\n }\n for ($i = 1; $i <= $pgCnt; $i++) {\n $aryOpts['pg'] = $i;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\" class=\"';\n if ($curPg == $i)\n $return.='active';\n $return.='\" >' . $i . '</a>';\n }\n if ($curPg < $pgCnt) {\n $aryOpts['pg'] = $curPg + 1;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Next</a>';\n $aryOpts['pg'] = $pgCnt;\n $return.='<a href=\"' . $refUrl . getQueryString($aryOpts) . '\">Last</a>';\n }\n $return.='<div class=\"clearfix\"></div></div></div>';\n return $return;\n}", "public function get_pagenum()\n {\n }", "public function indexAction()\n {\n $page = (int) $this->getParam('page', 1);\n $pageSize = (int) $this->getParam('size', 25);\n\n $profileRepoFactory = new Application_Factory_ProfileRepository();\n $profileRepo = $profileRepoFactory->createService();\n\n $this->view->profiles = $profileRepo->paginator($page, $pageSize);\n }", "public function get_pages_as_list($acl_checks=false)\n {\n $link_suffix = $this->get_parameter_string();\n\n $this->data['prefix'] = $this->prefix;\n $this->data['current_page'] = $this->current_page;\n $this->data['page_count'] = $this->count_pages($acl_checks);\n $this->data['results_per_page'] = $this->limit;\n $this->data['offset'] = $this->offset;\n $this->data['display_pages'] = $this->display_pages;\n //Won't work (wrong scope), so the code is copied below.\n //midcom_show_style('show-pages');\n $data =& $this->data;\n \n $pages = '';\n\n //Skip the header in case we only have one page\n if ($data['page_count'] <= 1)\n {\n return;\n }\n\n //TODO: \"showing results (offset)-(offset+limit)\n //TODO: Localizations\n $page_var = $data['prefix'] . 'page';\n $results_var = $data['prefix'] . 'results';\n $pages .= '<div class=\"org_openpsa_qbpager_pages\">';\n $pages .= \"\\n <ul>\\n\";\n $page = 0;\n $display_start = $data['current_page'] - ceil($data['display_pages']/2);\n if ($display_start < 0)\n {\n $display_start = 0;\n }\n $display_end = $data['current_page'] + ceil($data['display_pages']/2);\n if ($display_end > $data['page_count'])\n {\n $display_end = $data['page_count'];\n }\n\n if ($data['current_page'] > 1)\n {\n $previous = $data['current_page'] - 1;\n if ($previous != 1)\n {\n //$pages .= \"\\n<li class=\\\"first\\\"><a class=\\\"first_page\\\" href=\\\"?{$page_var}=1\\\">&nbsp;</a></li>\";\n //$pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n }\n\n $pages .= \"\\n<li class=\\\"prev\\\" onclick=\\\"window.location='?{$page_var}={$previous}{$link_suffix}';\\\"></li>\";\n\n if ($display_start > 1)\n {\n $pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n $pages .= \"\\n<li class=\\\"page last\\\" onclick=\\\"window.location='?{$page_var}=1{$link_suffix}';\\\">1</li>\";\n $pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n $pages .= \"\\n<li class=\\\"page splitter\\\">...</li>\";\n $pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n }\n }\n\n\n while ($page++ < $display_end)\n {\n if ($page < $display_start)\n {\n continue;\n }\n if ($page == $data['current_page'])\n {\n $pages .= \"\\n<li class=\\\"page active\\\">{$page}</li>\";\n $pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n continue;\n }\n if ($page < $data['page_count'])\n {\n $pages .= \"\\n<li class=\\\"page\\\" onclick=\\\"window.location='?{$page_var}={$page}{$link_suffix}';\\\">{$page}</li>\";\n $pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n }\n }\n\n if ($data['current_page'] < $data['page_count'])\n {\n $next = $data['current_page'] + 1;\n\n if ($next != $data['page_count'])\n {\n //$pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n //$pages .= \"\\n<li class=\\\"last\\\"><a class=\\\"last_page\\\" href=\\\"?{$page_var}={$data['page_count']}\\\">&nbsp;</a></li>\";\n $pages .= \"\\n<li class=\\\"page splitter\\\">...</li>\";\n $pages .= \"\\n<li class=\\\"separator\\\"></li>\";\n $pages .= \"\\n<li class=\\\"page last\\\" onclick=\\\"window.location='?{$page_var}={$data['page_count']}{$link_suffix}';\\\">{$data['page_count']}</li>\";\n }\n\n\n $pages .= \"\\n<li class=\\\"next\\\" onclick=\\\"window.location='?{$page_var}={$next}{$link_suffix}';\\\"></li>\";\n }\n\n $pages .= \"\\n </ul>\\n\";\n $pages .= \"</div>\\n\";\n\n return $pages;\n }", "function get_paged_list($limit = 10, $offset = 0){\n\t $this->db->join('department', 'department.id = employee.Department');\n $this->db->order_by('EmployeeId','asc');\n return $this->db->get($this->tbl_Employeeinfo, $limit, $offset);\n }", "public function generateList()\n {\n // Set page record in header\n $this->pageRecord = BackendUtility::getRecordWSOL('pages', $this->id);\n $hideTablesArray = GeneralUtility::trimExplode(',', $this->hideTables);\n\n $backendUser = $this->getBackendUser();\n\n // pre-process tables and add sorting instructions\n $tableNames = array_flip(array_keys($GLOBALS['TCA']));\n foreach ($tableNames as $tableName => &$config) {\n $hideTable = false;\n\n // Checking if the table should be rendered:\n // Checks that we see only permitted/requested tables:\n if ($this->table && $tableName !== $this->table\n || $this->tableList && !GeneralUtility::inList($this->tableList, $tableName)\n || !$backendUser->check('tables_select', $tableName)\n ) {\n $hideTable = true;\n }\n\n if (!$hideTable) {\n // Don't show table if hidden by TCA ctrl section\n // Don't show table if hidden by pageTSconfig mod.web_list.hideTables\n $hideTable = $hideTable\n || !empty($GLOBALS['TCA'][$tableName]['ctrl']['hideTable'])\n || in_array($tableName, $hideTablesArray, true)\n || in_array('*', $hideTablesArray, true);\n // Override previous selection if table is enabled or hidden by TSconfig TCA override mod.web_list.table\n if (isset($this->tableTSconfigOverTCA[$tableName . '.']['hideTable'])) {\n $hideTable = (bool)$this->tableTSconfigOverTCA[$tableName . '.']['hideTable'];\n }\n }\n if ($hideTable) {\n unset($tableNames[$tableName]);\n } else {\n if (isset($this->tableDisplayOrder[$tableName])) {\n // Copy display order information\n $tableNames[$tableName] = $this->tableDisplayOrder[$tableName];\n } else {\n $tableNames[$tableName] = [];\n }\n }\n }\n unset($config);\n\n $orderedTableNames = GeneralUtility::makeInstance(DependencyOrderingService::class)\n ->orderByDependencies($tableNames);\n\n foreach ($orderedTableNames as $tableName => $_) {\n // check if we are in single- or multi-table mode\n if ($this->table) {\n $this->iLimit = isset($GLOBALS['TCA'][$tableName]['interface']['maxSingleDBListItems'])\n ? (int)$GLOBALS['TCA'][$tableName]['interface']['maxSingleDBListItems']\n : $this->itemsLimitSingleTable;\n } else {\n // if there are no records in table continue current foreach\n $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)\n ->getQueryBuilderForTable($tableName);\n $queryBuilder->getRestrictions()\n ->removeAll()\n ->add(GeneralUtility::makeInstance(DeletedRestriction::class))\n ->add(GeneralUtility::makeInstance(BackendWorkspaceRestriction::class));\n $queryBuilder = $this->addPageIdConstraint($tableName, $queryBuilder);\n $firstRow = $queryBuilder->select('uid')\n ->from($tableName)\n ->execute()\n ->fetch();\n if (!is_array($firstRow)) {\n continue;\n }\n $this->iLimit = isset($GLOBALS['TCA'][$tableName]['interface']['maxDBListItems'])\n ? (int)$GLOBALS['TCA'][$tableName]['interface']['maxDBListItems']\n : $this->itemsLimitPerTable;\n }\n if ($this->showLimit) {\n $this->iLimit = $this->showLimit;\n }\n // Setting fields to select:\n if ($this->allFields) {\n $fields = $this->makeFieldList($tableName);\n $fields[] = 'tstamp';\n $fields[] = 'crdate';\n $fields[] = '_PATH_';\n $fields[] = '_CONTROL_';\n if (is_array($this->setFields[$tableName])) {\n $fields = array_intersect($fields, $this->setFields[$tableName]);\n } else {\n $fields = [];\n }\n } else {\n $fields = [];\n }\n\n // Finally, render the list:\n $this->HTMLcode .= $this->getTable($tableName, $this->id, implode(',', $fields));\n }\n }", "private function getNumPages() {\n //display all in one page\n if (($this->limit < 1) || ($this->limit > $this->itemscount)) {\n $this->numpages = 1;\n } else {\n //Calculate rest numbers from dividing operation so we can add one\n //more page for this items\n $restItemsNum = $this->itemscount % $this->limit;\n //if rest items > 0 then add one more page else just divide items\n //by limit\n $restItemsNum > 0 ? $this->numpages = intval($this->itemscount / $this->limit) + 1 : $this->numpages = intval($this->itemscount / $this->limit);\n }\n }", "public function page_list($limit='0')\n\t{\n\t\tif(!$this->session->userdata('logged_in')){\n\t\t\tredirect('login');\n\t\t\t\n\t\t}\n\t\t$logged_in=$this->session->userdata('logged_in');\n\t\tif($logged_in['base_url'] != base_url()){\n\t\t$this->session->unset_userdata('logged_in');\t\t\n\t\tredirect('login');\n\t\t}\n\t\t\n\t \t\t$logged_in=$this->session->userdata('logged_in');\n $acp=explode(',',$logged_in['setting']);\n\t\t\tif(!in_array('All',$acp)){\n\t\t\texit($this->lang->line('permission_denied'));\n\t\t\t}\n\t\t\t\n\t\t\n\t\t \t \n\t\t\t\n\t\t\t\n\t $data['title']=$this->lang->line('page_list');\n\t\t\t\t$data['result']=$this->Cms_model->page_list_all($limit);\n\t\t\t\t \n\t\t$this->load->view('header',$data);\n\t\t $this->load->view('page_list',$data);\n\t\t$this->load->view('footer',$data);\n\t}", "public function testListPagination()\n {\n $this->browse(function (Browser $browser) {\n $browser->loginAs(User::find(1))\n ->visit('admin/users')\n ->assertSee('Users Gestion')\n ->clickLink('3')\n ->assertSee('GreatRedactor');\n });\n }", "function get_paged_template()\n {\n }", "function generate_pagination($url, $items, $per_page, $start, $start_variable='start'){\r\n global $eqdkp_root_path, $user;\r\n\r\n $uri_symbol = ( strpos($url, '?') ) ? '&amp;' : '?';\r\n\t\t//On what page we are?\r\n\t\t$recent_page = (int)floor($start / $per_page) + 1;\r\n\t\t//Calculate total pages\r\n\t\t$total_pages = ceil($items / $per_page);\r\n\t\t//Return if we don't have at least 2 Pages\r\n\t\tif (!$items || $total_pages < 2){\r\n return '';\r\n }\r\n\r\n\t\t//First Page\r\n $pagination = '<div class=\"pagination\">';\r\n\t\tif ($recent_page == 1){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">1</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol . $start_variable.'='.( ($recent_page - 2) * $per_page).'\" title=\"'.$user->lang['previous_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/left_arrow.png\" border=\"0\"></a>&nbsp;&nbsp;<a href=\"'.$url.'\" class=\"pagination\">1</a>';\r\n\t\t}\r\n\r\n\t\t//If total-pages < 4 show all page-links\r\n\t\tif ($total_pages < 4){\r\n\t\t\t\t$pagination .= ' ';\r\n\t\t\t\tfor ( $i = 2; $i < $total_pages; $i++ ){\r\n\t\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$pagination .= ' ';\r\n\t\t\t\t}\r\n\t\t//Don't show all page-links\r\n\t\t} else {\r\n\t\t\t$start_count = min(max(1, $recent_page - 5), $total_pages - 4);\r\n\t\t\t$end_count = max(min($total_pages, $recent_page + 5), 4);\r\n\r\n\t\t\t$pagination .= ( $start_count > 1 ) ? ' ... ' : ' ';\r\n\r\n\t\t\tfor ( $i = $start_count + 1; $i < $end_count; $i++ ){\r\n\t\t\t\tif ($i == $recent_page){\r\n\t\t\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$i.'</span> ';\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.( ($i - 1) * $per_page).'\" title=\"'.$user->lang['page'].' '.$i.'\" class=\"pagination\">'.$i.'</a> ';\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$pagination .= ($end_count < $total_pages ) ? ' ... ' : ' ';\r\n\t\t} //close else\r\n\r\n\r\n\t\t//Last Page\r\n\t\tif ($recent_page == $total_pages){\r\n\t\t\t$pagination .= '<span class=\"pagination_activ\">'.$recent_page.'</span>';\r\n\t\t} else {\r\n\t\t\t$pagination .= '<a href=\"'.$url.$uri_symbol.$start_variable.'='.(($total_pages - 1) * $per_page) . '\" class=\"pagination\" title=\"'.$user->lang['page'].' '.$total_pages.'\">'.$total_pages.'</a>&nbsp;&nbsp;<a href=\"'.$base. $uri_symbol .$start_variable.'='.($recent_page * $per_page).'\" title=\"'.$user->lang['next_page'].'\"><img src=\"'.$eqdkp_root_path.'images/arrows/right_arrow.png\" border=\"0\"></a>';\r\n\t\t}\r\n\r\n\t$pagination .= '</div>';\r\n\treturn $pagination;\r\n}", "function draw_pager(){\r\n\t\treturn $this->pager;\r\n\t}", "function pager($margin=10)\n {\n $path = $_GET;\n $newpath = $PHP_SELF.\"?\";\n foreach($path as $key => $value)\n {\n if($key!=$this->getvar)\n {\n $newpath .= $key.\"=\".$value;\n $newpath .=\"&amp;\";\n }\n }\n $newpath .= $this->getvar;\n\n $linkpaths = array();\n $current = $this->start / $this->length + 1;\n $pages = ceil(($this->rows/$this->length));\n $pagerstart = $current-$margin;\n $pagerstart = ($pagerstart<1)?1:$pagerstart;\n $pagerend = $current+$margin;\n \n $pagerend = ( $pagerend > $pages ) ? ( ceil( ( $this->rows / $this->length ) ) ): $pagerend;\n\n for($i=$pagerstart;$i < ($pagerend+1);$i++)\n {\n $linkpaths[$i] = $newpath.\"=\".($i);\n }\n if($linkpaths[($current+1)]!=null)\n {\n $linkpaths['next']=$linkpaths[($current+1)];\n }\n if($linkpaths[($current-1)]!=null)\n {\n $linkpaths['last']=$linkpaths[($current-1)];\n }\n return $linkpaths;\n }", "function results_are_paged()\n {\n }", "function create_links()\n\t{\n\t\t// If our item count or per-page total is zero there is no need to continue.\n\t\tif ($this->total_rows == 0 OR $this->per_page == 0)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t// Calculate the total number of pages\n\t\t$num_pages = ceil($this->total_rows / $this->per_page);\n\n\t\t// Is there only one page? Hm... nothing more to do here then.\n\t\tif ($num_pages == 1)\n\t\t{\n\t\t\treturn '';\n\t\t}\n\n\t\t// Set the base page index for starting page number\n\t\tif ($this->use_page_numbers)\n\t\t{\n\t\t\t$base_page = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$base_page = 0;\n\t\t}\n\n\t\t// Determine the current page number.\n\t\t$CI =& get_instance();\n\n\t\tif ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)\n\t\t{\n\t\t\tif ($CI->input->get($this->query_string_segment) != $base_page)\n\t\t\t{\n\t\t\t\t$this->cur_page = $CI->input->get($this->query_string_segment);\n\n\t\t\t\t// Prep the current page - no funny business!\n\t\t\t\t$this->cur_page = (int) $this->cur_page;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($CI->uri->segment($this->uri_segment) != $base_page)\n\t\t\t{\n\t\t\t\t$this->cur_page = $CI->uri->segment($this->uri_segment);\n\n\t\t\t\t// Prep the current page - no funny business!\n\t\t\t\t$this->cur_page = (int) $this->cur_page;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Set current page to 1 if using page numbers instead of offset\n\t\tif ($this->use_page_numbers AND $this->cur_page == 0)\n\t\t{\n\t\t\t$this->cur_page = $base_page;\n\t\t}\n\n\t\t$this->num_links = (int)$this->num_links;\n\n\t\tif ($this->num_links < 1)\n\t\t{\n\t\t\tshow_error('Your number of links must be a positive number.');\n\t\t}\n\n\t\tif ( ! is_numeric($this->cur_page))\n\t\t{\n\t\t\t$this->cur_page = $base_page;\n\t\t}\n\n\t\t// Is the page number beyond the result range?\n\t\t// If so we show the last page\n\t\tif ($this->use_page_numbers)\n\t\t{\n\t\t\tif ($this->cur_page > $num_pages)\n\t\t\t{\n\t\t\t\t$this->cur_page = $num_pages;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->cur_page > $this->total_rows)\n\t\t\t{\n\t\t\t\t$this->cur_page = ($num_pages - 1) * $this->per_page;\n\t\t\t}\n\t\t}\n\n\t\t$uri_page_number = $this->cur_page;\n\t\t\n\t\tif ( ! $this->use_page_numbers)\n\t\t{\n\t\t\t$this->cur_page = floor(($this->cur_page/$this->per_page) + 1);\n\t\t}\n\n\t\t// Calculate the start and end numbers. These determine\n\t\t// which number to start and end the digit links with\n\t\t$start = (($this->cur_page - $this->num_links) > 0) ? $this->cur_page - ($this->num_links - 1) : 1;\n\t\t$end = (($this->cur_page + $this->num_links) < $num_pages) ? $this->cur_page + $this->num_links : $num_pages;\n\n\t\t// Is pagination being used over GET or POST? If get, add a per_page query\n\t\t// string. If post, add a trailing slash to the base URL if needed\n\t\tif ($CI->config->item('enable_query_strings') === TRUE OR $this->page_query_string === TRUE)\n\t\t{\n\t\t\t$this->base_url = rtrim($this->base_url).'&amp;'.$this->query_string_segment.'=';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->base_url = rtrim($this->base_url, '/') .'/';\n\t\t}\n\n\t\t// And here we go...\n\t\t$output = '';\n\n\t\t// Render the \"First\" link\n\t\tif ($this->first_link !== FALSE AND $this->cur_page > ($this->num_links + 1))\n\t\t{\n\t\t\t$first_url = ($this->first_url == '') ? $this->base_url : $this->first_url;\n\t\t\t$output .= $this->first_tag_open.'<a '.$this->anchor_class.'href=\"'.$first_url.'\">'.$this->first_link.'</a>'.$this->first_tag_close;\n\t\t}\n\n\t\t// Render the \"previous\" link\n\t\tif ($this->prev_link !== FALSE AND $this->cur_page != 1)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $uri_page_number - 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = $uri_page_number - $this->per_page;\n\t\t\t}\n\n\t\t\tif ($i == 0 && $this->first_url != '')\n\t\t\t{\n\t\t\t\t$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->first_url.'\">'.$this->prev_link.'</a>'.$this->prev_tag_close;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = ($i == 0) ? '' : $this->prefix.$i.$this->suffix;\n\t\t\t\t$output .= $this->prev_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$i.'\">'.$this->prev_link.'</a>'.$this->prev_tag_close;\n\t\t\t}\n\n\t\t}\n\n\t\t// Render the pages\n\t\tif ($this->display_pages !== FALSE)\n\t\t{\n\t\t\t// Write the digit links\n\t\t\tfor ($loop = $start -1; $loop <= $end; $loop++)\n\t\t\t{\n\t\t\t\tif ($this->use_page_numbers)\n\t\t\t\t{\n\t\t\t\t\t$i = $loop;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$i = ($loop * $this->per_page) - $this->per_page;\n\t\t\t\t}\n\n\t\t\t\tif ($i >= $base_page)\n\t\t\t\t{\n\t\t\t\t\tif ($this->cur_page == $loop)\n\t\t\t\t\t{\n\t\t\t\t\t\t$output .= $this->cur_tag_open.$loop.$this->cur_tag_close; // Current page\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$n = ($i == $base_page) ? '' : $i;\n\n\t\t\t\t\t\tif ($n == '' && $this->first_url != '')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->first_url.'\">'.$loop.'</a>'.$this->num_tag_close;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$n = ($n == '') ? '' : $this->prefix.$n.$this->suffix;\n\n\t\t\t\t\t\t\t$output .= $this->num_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$n.'\">'.$loop.'</a>'.$this->num_tag_close;\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// Render the \"next\" link\n\t\tif ($this->next_link !== FALSE AND $this->cur_page < $num_pages)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $this->cur_page + 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = ($this->cur_page * $this->per_page);\n\t\t\t}\n\n\t\t\t$output .= $this->next_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$this->prefix.$i.$this->suffix.'\">'.$this->next_link.'</a>'.$this->next_tag_close;\n\t\t}\n\n\t\t// Render the \"Last\" link\n\t\tif ($this->last_link !== FALSE AND ($this->cur_page + $this->num_links) < $num_pages)\n\t\t{\n\t\t\tif ($this->use_page_numbers)\n\t\t\t{\n\t\t\t\t$i = $num_pages;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$i = (($num_pages * $this->per_page) - $this->per_page);\n\t\t\t}\n\t\t\t$output .= $this->last_tag_open.'<a '.$this->anchor_class.'href=\"'.$this->base_url.$this->prefix.$i.$this->suffix.'\">'.$this->last_link.'</a>'.$this->last_tag_close;\n\t\t}\n\n\t\t// Kill double slashes. Note: Sometimes we can end up with a double slash\n\t\t// in the penultimate link so we'll kill all double slashes.\n\t\t$output = preg_replace(\"#([^:])//+#\", \"\\\\1/\", $output);\n\n\t\t// Add the wrapper HTML if exists\n\t\t$output = $this->full_tag_open.$output.$this->full_tag_close;\n\n\t\treturn $output;\n\t}", "protected function itemPaging()\n {\n $controller_class_namespace = $this->controller_namespace;\n $controller = new $controller_class_namespace();\n $controller->getModelRegistry(\n $this->get('model_type', 'datasource'),\n $this->get('model_name', '', 'runtime_data'),\n 1\n );\n\n $controller->set('get_customfields', 0);\n $controller->set('use_special_joins', 0);\n $controller->set('process_events', 0);\n $controller->set('get_item_children', 0);\n\n $controller->select(\n 'a'\n . '.'\n . $controller->get('primary_key', 'id')\n );\n\n $controller->select(\n 'a'\n . '.'\n . $controller->get('name_key', 'title')\n );\n\n $controller->where(\n 'a'\n . '.' . $controller->get('primary_key', 'id')\n . ' = '\n . (int)$this->runtime_data->catalog->source_id\n );\n\n//@todo ordering\n $item = $this->runQuery();\n\n $model_registry_name = ucfirst(strtolower($this->get('model_name', '', 'runtime_data')))\n . ucfirst(strtolower($this->get('model_type', 'datasource')));\n\n if ($item === false || count($item) === 0) {\n return $this;\n }\n }", "public function getPaginatedList($offset, $limit, $criteria = array());", "function shAddPaginationInfo($limit, $limitstart, $showall, $iteration, $url, $location, $shSeparator = null, $defaultListLimitValue = null,\n $suppressPagination = false)\n{\n\t$mainframe = JFactory::getApplication();\n\n\t$pageInfo = Sh404sefFactory::getPageInfo(); // get page details gathered by system plugin\n\t$sefConfig = Sh404sefFactory::getConfig();\n\t$database = ShlDbHelper::getDb();\n\n\t//echo 'Incoming pagination : $listLimit : ' . $listLimit . ' | $defaultListLimit : ' . $defaultListLimit . \"\\n\";\n\n\t// clean suffix and index file before starting to add things to the url\n\t// clean suffix\n\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'format=pdf') !== false)\n\t{\n\t\t$shSuffix = '.pdf';\n\t}\n\telse\n\t{\n\t\t$shSuffix = $sefConfig->suffix;\n\t}\n\t$suffixLength = JString::strLen($shSuffix);\n\tif (!empty($shSuffix) && ($shSuffix != '/') && JString::substr($location, -$suffixLength) == $shSuffix)\n\t{\n\t\t$location = JString::substr($location, 0, JString::strlen($location) - $suffixLength);\n\t}\n\n\t// clean index file\n\tif ($sefConfig->addFile && (empty($shSuffix) || JString::subStr($location, -$suffixLength) != $shSuffix))\n\t{\n\t\t$indexFileLength = JString::strlen($sefConfig->addFile);\n\t\tif (($sefConfig->addFile != '/') && JString::substr($location, -$indexFileLength) == $sefConfig->addFile)\n\t\t{\n\t\t\t$location = JString::substr($location, 0, JString::strlen($location) - $indexFileLength);\n\t\t}\n\t}\n\n\t// get a default limit value, for urls where it's missing\n\t$listLimit = shGetDefaultDisplayNumFromURL($url, $includeBlogLinks = true);\n\t$defaultListLimit = is_null($defaultListLimitValue) ? shGetDefaultDisplayNumFromConfig($url, $includeBlogLinks = false) : $defaultListLimitValue;\n\n\t// do we have a trailing slash ?\n\tif (empty($shSeparator))\n\t{\n\t\t$shSeparator = (JString::substr($location, -1) == '/') ? '' : '/';\n\t}\n\n\tif (!$suppressPagination)\n\t{\n\t\t// start computing pagination\n\t\tif (!empty($limit) && is_numeric($limit))\n\t\t{\n\t\t\t$pagenum = intval($limitstart / $limit);\n\t\t\t$pagenum++;\n\t\t}\n\t\telse if (!isset($limit) && !empty($limitstart))\n\t\t{\n\t\t\t// only limitstart\n\t\t\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false)\n\t\t\t{\n\t\t\t\t$pagenum = intval($limitstart + 1); // multipage article\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$pagenum = intval($limitstart / $listLimit) + 1; // blogs, tables, ...\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$pagenum = $iteration;\n\t\t}\n\t\t// Make sure we do not end in infite loop here.\n\t\tif ($pagenum < $iteration)\n\t\t\t$pagenum = $iteration;\n\t\t// shumisha added to handle table-category and table-section which may have variable number of items per page\n\t\t// There still will be a problem with filter, which may reduce the total number of items. Thus the item we are looking for\n\t\tif ($sefConfig->alwaysAppendItemsPerPage || (strpos($url, 'option=com_virtuemart') && $sefConfig->shVmUsingItemsPerPage))\n\t\t{\n\t\t\t$shMultPageLength = $sefConfig->pagerep . (empty($limit) ? $listLimit : $limit);\n\t\t}\n\t\telse\n\t\t\t$shMultPageLength = '';\n\t\t// shumisha : modified to add # of items per page to URL, for table-category or section-category\n\n\t\tif (!empty($sefConfig->pageTexts[$pageInfo->currentLanguageTag])\n\t\t\t&& (false !== strpos($sefConfig->pageTexts[$pageInfo->currentLanguageTag], '%s'))\n\t\t)\n\t\t{\n\t\t\t$page = str_replace('%s', $pagenum, $sefConfig->pageTexts[$pageInfo->currentLanguageTag]) . $shMultPageLength;\n\t\t\tif ($sefConfig->LowerCase)\n\t\t\t{\n\t\t\t\t$page = JString::strtolower($page);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$page = $sefConfig->pagerep . $pagenum . $shMultPageLength;\n\t\t}\n\n\t\t// V 1.2.4.t special processing to replace page number by headings\n\t\t$shPageNumberWasReplaced = false;\n\t\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false && !empty($limitstart))\n\t\t{\n\t\t\t// this is multipage article - limitstart instead of limit in J1.5\n\t\t\tif ($sefConfig->shMultipagesTitle)\n\t\t\t{\n\t\t\t\tparse_str($url, $shParams);\n\t\t\t\tif (!empty($shParams['id']))\n\t\t\t\t{\n\t\t\t\t\t$shPageTitle = '';\n\t\t\t\t\ttry\n\t\t\t\t\t{\n\t\t\t\t\t\t$contentElement = ShlDbHelper::selectObject('#__content', array('id', 'fulltext', 'introtext'),\n\t\t\t\t\t\t\tarray('id' => $shParams['id']));\n\t\t\t\t\t}\n\t\t\t\t\tcatch (Exception $e)\n\t\t\t\t\t{\n\t\t\t\t\t\tJError::raise(E_ERROR, 500, $e->getMessage());\n\t\t\t\t\t}\n\t\t\t\t\t$contentText = $contentElement->introtext . $contentElement->fulltext;\n\t\t\t\t\tif (!empty($contentElement) && (strpos($contentText, 'class=\"system-pagebreak') !== false))\n\t\t\t\t\t{\n\t\t\t\t\t\t// search for mospagebreak tags\n\t\t\t\t\t\t// copied over from pagebreak plugin\n\t\t\t\t\t\t// expression to search for\n\t\t\t\t\t\t$regex = '#<hr([^>]*)class=(\\\"|\\')system-pagebreak(\\\"|\\')([^>]*)\\/>#iU';\n\t\t\t\t\t\t// find all instances of mambot and put in $matches\n\t\t\t\t\t\t$shMatches = array();\n\t\t\t\t\t\tpreg_match_all($regex, $contentText, $shMatches, PREG_SET_ORDER);\n\t\t\t\t\t\t// adds heading or title to <site> Title\n\t\t\t\t\t\tif (empty($limitstart))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// if first page use heading of first mospagebreak\n\t\t\t\t\t\t\t/* if ( $shMatches[0][2] ) {\n\t\t\t\t\t\t\t parse_str( html_entity_decode( $shMatches[0][2] ), $args );\n\t\t\t\t\t\t\tif ( @$args['heading'] ) {\n\t\t\t\t\t\t\t$shPageTitle = stripslashes( $args['heading'] );\n\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\telse\n\t\t\t\t\t\t{ // for other pages use title of mospagebreak\n\t\t\t\t\t\t\tif ($limitstart > 0 && $shMatches[$limitstart - 1][1])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$args = JUtility::parseAttributes($shMatches[$limitstart - 1][0]);\n\t\t\t\t\t\t\t\tif (@$args['title'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$shPageTitle = $args['title'];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (@$args['alt'])\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$shPageTitle = $args['alt'];\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{ // there is a page break, but no title. Use a page number\n\t\t\t\t\t\t\t\t\t$shPageTitle = str_replace('%s', $limitstart + 1, $sefConfig->pageTexts[$pageInfo->currentLanguageTag]);\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 (!empty($shPageTitle))\n\t\t\t\t\t{\n\t\t\t\t\t\t// found a heading, we should use that as a Title\n\t\t\t\t\t\t$location .= $shSeparator . titleToLocation($shPageTitle);\n\t\t\t\t\t}\n\t\t\t\t\t$shPageNumberWasReplaced = true; // always set the flag, otherwise we'll a Page-1 added\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// mutiple pages article, but we don't want to use smart title.\n\t\t\t\t// directly use limitstart\n\t\t\t\t$page = str_replace('%s', $limitstart + 1, $sefConfig->pageTexts[$pageInfo->currentLanguageTag]);\n\t\t\t}\n\t\t}\n\t\t// maybe this is a multipage with \"showall=1\"\n\t\tif (strpos($url, 'option=com_content') !== false && strpos($url, 'view=article') !== false && strpos($url, 'showall=1') !== false)\n\t\t{\n\t\t\t// this is multipage article with showall\n\t\t\t$tempTitle = JText::_('All Pages');\n\t\t\t$location .= $shSeparator . titleToLocation($tempTitle);\n\t\t\t$shPageNumberWasReplaced = true; // always set the flag, otherwise we'll a Page-1 added\n\t\t}\n\n\t\t// make sure we remove bad characters\n\t\t$takethese = str_replace('|', '', $sefConfig->friendlytrim);\n\t\t$location = JString::trim($location, $takethese);\n\n\t\t// add page number\n\t\tif (!$shPageNumberWasReplaced\n\t\t\t&& ((!isset($limitstart) && (isset($limit) && $limit != 1 && $limit != $listLimit && $limit != $defaultListLimit)) || !empty($limitstart))\n\t\t)\n\t\t{\n\t\t\t$location .= $shSeparator . $page;\n\t\t}\n\t}\n\t// add suffix\n\t$format = Sh404sefHelperUrl::getUrlVar($url, 'format');\n\t$shouldAddSuffix = empty($format) || $format == 'html';\n\tif ($shouldAddSuffix && !empty($shSuffix) && !empty($location) && $location != '/' && JString::substr($location, -1) != '/')\n\t{\n\t\t$location = $shSuffix == '/' ? $location . $shSuffix : str_replace($shSuffix, '', $location) . $shSuffix;\n\t}\n\n\t// add default index file\n\tif ($sefConfig->addFile)\n\t{\n\t\tif ((empty($shSuffix) || (!empty($shSuffix) && $shouldAddSuffix && JString::subStr($location, -$suffixLength) != $shSuffix)) && JString::substr($location, -1) == '/')\n\t\t{\n\t\t\t$location .= $sefConfig->addFile;\n\t\t}\n\t}\n\treturn JString::ltrim($location, '/');\n}", "function create_links() {\n $total_rows = $this->total_rows;\n if ($total_rows == 0) {\n return '';\n }\n\n // Calculate the total number of pages\n $CI = & get_instance();\n $_quantity = $CI->_quantity;\n $per_page = $this->per_page;\n $num_pages = ceil($total_rows / $per_page);\n\n // Is there only one page? Hm... nothing more to do here then.\n if ($num_pages == 1) {\n return '';\n }\n\n // Determine the current page number.\n $_offset = $CI->_offset;\n $cur_page = $_quantity == -1 ? -1 : floor($CI->_offset / $per_page) + 1;\n\n // And here we go...\n $output = '';\n\n // Render the \"First\" link\n if ($cur_page != 1) {\n $i = 0;\n $output .= $this->first_tag_open . $i . $this->first_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Render the \"previous\" link\n if ($cur_page != 1 && $_quantity != -1) {\n $i = $_offset - $per_page;\n $output .= $this->prev_tag_open . $i . $this->prev_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Write the digit links\n $output .= \"<select tabindex='-1'>\";\n $start = 1;\n $end = $per_page;\n if ($_quantity == -1)\n $output .= '<option selected=\"selected\" > - </option>';\n for ($loop = 1; $loop <= $num_pages; $loop++) {\n if ($end > $total_rows)\n $end = $total_rows;\n $output .= '<option value=\"' . (($loop - 1) * $per_page) . '\" ' . ($loop == $cur_page ? \"selected='selected'\" : \"\") . ' >Trang ' . $loop . '/' . $num_pages . '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . $start . \"-\" . $end . '/' . $total_rows . '</option>';\n $start+=$per_page;\n $end+=$per_page;\n }\n $output .= \"</select>\";\n\n // Render the \"next\" link\n if ($cur_page != $num_pages && $_quantity != -1) {\n $i = $_offset + $per_page;\n $output .= $this->next_tag_open . $i . $this->next_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Render the \"Last\" link\n if ($cur_page != $num_pages) {\n $i = ($num_pages - 1) * $per_page;\n $output .= $this->last_tag_open . $i . $this->last_tag_close;\n } else {\n $output .= \"<li class='null'></li>\";\n }\n\n // Add the wrapper HTML if exists\n $output = $this->full_tag_open . $output . str_replace(array(\"{class}\", \"{style}\"), array(($_quantity == -1 ? \"ui-state-hover\" : \"icon\"), ($_quantity == -1 ? \"cursor:default\" : \"\")), $this->full_tag_close);\n\n return $output;\n }", "public static function doPager($params=NULL, $selectPage=0, $itemsPerPage=20) {\n\t\t$count = (int) self::doCount($params);\n\t\t$conn = parent::_initwgConnector($params, self::PRIMARY_KEY);\n\t\t$conn->select(self::TABLE_NAME);\n\t\tparent::doSelectParameters($conn, $params, self::PRIMARY_KEY);\n\t\treturn DbModel::doPager($conn, new ProjectsListingsModel(), $itemsPerPage, $selectPage, $count, $params);\n\t}", "protected function _renderPaginationStart()\n {\n return '<div id=\"ZVHPContainer\"><ul id=\"ZVHPList\">';\n }", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function emm_paginate_loop($start, $max, $page = 0) {\n\t$output = \"\";\n\tfor ($i = $start; $i <= $max; $i++) {\n\t\t$output .= ($page === intval($i)) \n\t\t\t? \"<li class='current'><a href='#'>$i</a></li>\" \n\t\t\t: \"<li><a href='\" . get_pagenum_link($i) . \"'>$i</a></li>\";\n\t}\n\treturn $output;\n}", "function show_page_links($base_url, $num_items, $per_page, $page)\n{\n //$base_url contains the address of the page and the order it is called with\n //e.g., 'asc' or 'desc' - the page handles this so we have to worry about it.\n\n $total_pages = ceil($num_items/$per_page);\n\n if ($total_pages == 1)\n {\n return '';\n }\n\n //initialize our $page_string variable wich will hold the links\n $page_string = '<p><span class=\"page_numbers\">';\n\n //SHOW UP TO 4 LINKS ON EITHER SIDE OF THE CURRENT PAGE\n\n //get the number of page links are available after the current page\n $num_succeeding_links = $total_pages - $page;\n\n //get the number of preceding links available before the current page\n $num_preceding_links = $page -1;\n\n //calculate our start and end values\n $start = $page - 4;\n if ( $start < 1)\n {\n $start = 1;\n }\n //if we have less than 10 total_page, use the number we have ($total_pages)\n $end = $total_pages;\n //but if end is more than 9 higher than $start, make $end 9 higher than $start\n //we only want to show 10 records per page (e.g., 1..10)\n if ( ($end - $start) > 9 )\n {\n $end= $start + 9;\n }\n\n //if the total number of succeeding links exceeds 4 show 4 and a >> at the end\n //the >> at the end is just the 5th succeeding link\n //do the same for preceding links if they are more than 4\n if ($total_pages > 10 && $page > 1) //don't show first page link except when we're not the first page\n {\n //create a << which points to the first page\n $page_string .= '<a title=\"first page\" href=\"'.$base_url.'&page=1\">&lt;&lt;</a>&nbsp;&nbsp;';\n //create a < which points to the current page -1 (shifts us left one)\n $val = $page-1;\n $page_string .= '<a title=\"previous page\" href=\"'.$base_url.'&page='.$val.'\">&lt;</a>&nbsp;&nbsp;';\n }\n for ($i=$start; $i<=$end; $i++)\n {\n if ($i == $page)\n {\n $page_string .= \" <b>[$i]</b> \";\n }\n else\n {\n $page_string .= ' <a title=\"page ' . $i . '\" href=\"'.$base_url.'&page='.$i.'\">'.$i.'</a> ';\n }\n }\n if ($total_pages > 10 && $page < $total_pages) //don't show last page link except when we're not on the last page\n {\n //create a > which points to the current page +1 (shifts us right one)\n $val = $page + 1;\n $page_string .= '&nbsp;&nbsp;<a title=\"next page\" href=\"'.$base_url.'&page='.$val.'\">&gt</a>';\n\n //create a >> which point to the last page\n $page_string .= '&nbsp;&nbsp;<a title=\"last page\" href=\"'.$base_url.'&page='.$total_pages.'\">&gt;&gt</a> ';\n }\n\n $page_string .= '</span></p>';\n\n return $page_string;\n\n}", "public function getPagesLinks()\r\n\t{\r\n\t\t$app = JFactory::getApplication();\r\n\t\t// Yjsg instance\r\n\t\t$yjsg = Yjsg::getInstance(); \r\n\t\t\r\n\t\t// Build the page navigation list.\r\n\t\t$data = $this->_buildDataObject();\r\n\r\n\t\t$list = array();\r\n\t\t$list['prefix'] = $this->prefix;\r\n\r\n\t\t$itemOverride = false;\r\n\t\t$listOverride = false;\r\n\r\n\t\t$chromePath \t= JPATH_THEMES . '/' . $app->getTemplate() . '/html/pagination.php';\r\n\t\t//yjsg start\r\n\t\tif (!file_exists($chromePath)){\r\n\t\t\tif($yjsg->preplugin()){\r\n\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'legacy' . YJDS . 'html' . YJDS . 'pagination.php';\r\n\t\t\t\t\r\n\t\t\t}else{\r\n\t\t\t\t\r\n\t\t\t\t$chromePath = YJSGPATH . 'includes' . YJDS . 'html' . YJDS . 'pagination.php';\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t//yjsg end\r\n\t\tif (file_exists($chromePath))\r\n\t\t{\r\n\t\t\tinclude_once $chromePath;\r\n\t\t\tif (function_exists('pagination_item_active') && function_exists('pagination_item_inactive'))\r\n\t\t\t{\r\n\t\t\t\t$itemOverride = true;\r\n\t\t\t}\r\n\t\t\tif (function_exists('pagination_list_render'))\r\n\t\t\t{\r\n\t\t\t\t$listOverride = true;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// Build the select list\r\n\t\tif ($data->all->base !== null)\r\n\t\t{\r\n\t\t\t$list['all']['active'] = true;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_active($data->all) : $this->_item_active($data->all);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['all']['active'] = false;\r\n\t\t\t$list['all']['data'] = ($itemOverride) ? pagination_item_inactive($data->all) : $this->_item_inactive($data->all);\r\n\t\t}\r\n\r\n\t\tif ($data->start->base !== null)\r\n\t\t{\r\n\t\t\t$list['start']['active'] = true;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_active($data->start) : $this->_item_active($data->start);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['start']['active'] = false;\r\n\t\t\t$list['start']['data'] = ($itemOverride) ? pagination_item_inactive($data->start) : $this->_item_inactive($data->start);\r\n\t\t}\r\n\t\tif ($data->previous->base !== null)\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = true;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_active($data->previous) : $this->_item_active($data->previous);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['previous']['active'] = false;\r\n\t\t\t$list['previous']['data'] = ($itemOverride) ? pagination_item_inactive($data->previous) : $this->_item_inactive($data->previous);\r\n\t\t}\r\n\r\n\t\t$list['pages'] = array(); //make sure it exists\r\n\t\tforeach ($data->pages as $i => $page)\r\n\t\t{\r\n\t\t\tif ($page->base !== null)\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = true;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_active($page) : $this->_item_active($page);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$list['pages'][$i]['active'] = false;\r\n\t\t\t\t$list['pages'][$i]['data'] = ($itemOverride) ? pagination_item_inactive($page) : $this->_item_inactive($page);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif ($data->next->base !== null)\r\n\t\t{\r\n\t\t\t$list['next']['active'] = true;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_active($data->next) : $this->_item_active($data->next);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['next']['active'] = false;\r\n\t\t\t$list['next']['data'] = ($itemOverride) ? pagination_item_inactive($data->next) : $this->_item_inactive($data->next);\r\n\t\t}\r\n\r\n\t\tif ($data->end->base !== null)\r\n\t\t{\r\n\t\t\t$list['end']['active'] = true;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_active($data->end) : $this->_item_active($data->end);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$list['end']['active'] = false;\r\n\t\t\t$list['end']['data'] = ($itemOverride) ? pagination_item_inactive($data->end) : $this->_item_inactive($data->end);\r\n\t\t}\r\n\r\n\t\tif ($this->total > $this->limit)\r\n\t\t{\r\n\t\t\treturn ($listOverride) ? pagination_list_render($list) : $this->_list_render($list);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn '';\r\n\t\t}\r\n\t}", "static public function genPagingFor(\n int $pageNum, int $totalItems, int $numItemsPerPage = 4, \n string $pagingFor = '', int $viewNumber = 0, \n string $listUrl = '#', int $numPagingIdxsPerPagingView = 0\n ) {\n return self::genPagination2(\n $pageNum, $numItemsPerPage, $totalItems, \n $numPagingIdxsPerPagingView, $pagingFor, \n $viewNumber, $listUrl\n );\n }", "function pager($page, $total, $pnumber, $page_link, $parameters)\n {\n $number = (int)($total/$pnumber);\n if((float)($total/$pnumber) - $number != 0) $number++;\n // Check on left links\n if($page - $page_link > 1)\n {\n echo \"<a href=$_SERVER[PHP_SELF]?page=1{$parameters}> <nobr>[1-$pnumber]</nobr></a>&nbsp;<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;\";\n // Have one\n for($i = $page - $page_link; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n else\n {\n // Have no\n for($i = 1; $i<$page; $i++)\n {\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n // Check on right links\n if($page + $page_link < $number)\n {\n // Have one\n for($i = $page; $i<=$page + $page_link; $i++)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n echo \"<em class=currentpage><nobr>&nbsp;...&nbsp;</nobr> </em>&nbsp;<a href=$_SERVER[PHP_SELF]?page=$number{$parameters}> <nobr>[\".(($number - 1)*$pnumber + 1).\"-$total]</nobr></a>&nbsp;\";\n }\n else\n {\n // Have no\n for($i = $page; $i<=$number; $i++)\n {\n if($number == $i)\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-$total]&nbsp;</nobr></em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}>[\".(($i - 1)*$pnumber + 1).\"-$total]</a>&nbsp;\";\n }\n else\n {\n if($page == $i)\n echo \"<em class=currentpage><nobr>&nbsp;[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]&nbsp;</nobr> </em>\";\n else\n echo \"&nbsp;<a href=$_SERVER[PHP_SELF]?page=$i{$parameters}> <nobr>[\".(($i - 1)*$pnumber + 1).\"-\".$i*$pnumber.\"]</nobr></a>&nbsp;\";\n }\n }\n }\n //echo \"<br><br>\";\n }", "function Paging(){\n\tif(isset($_GET['page']))\t$page=$_GET['page'];\n\telse $page=5;\n\n\t$onePage=2;\n\t$allPage=ceil($num_row/$onePage);\n\n\tif($page < 1 && $page > $allPage)\texit;\n\n\t$oneSection=2;\n\t$currentSection=ceil($page/$oneSection);\n\t$allSection=ceil($allPage/$oneSection);\n\n\t$firstPage=($currentSection * $oneSection) - ($oneSection - 1);\n\n\tif($currentSection == $allSection)\t$lastPage=$allPage;\n\telse \t$lastPage=$currentSection * $oneSection;\n\n\t$prevPage=(($currentSection-1) * $oneSection);\n\t$nextPage=(($currentSection+1) * $oneSection)-($oneSection-1);\n\n\t$paging='<ul>';\n\n\tif($page != 1)\t\t\t\t\t\t$paging .='<li><a href=\"./Board_list.php?page=1\">First</a></li>';\n\tif($currentSection != 1)\t\t\t\t$paging .='<li><a href=\"./Board_list.php?page='.$prevPage.'\">Prev</a></li>';\n\n\tfor($i=$firstPage;$i<=$lastPage;$i++){\n\t\tif($i==$page)\t\t\t\t\t$paging.='<li>'.$i.'</li>';\n\t\telse \t\t\t\t\t\t\t$paging.='<li><a href=\"./Board_list.php?page='.$i.'\">'.$i.'</a></li>';\n\t}\n\n\tif($currentSection != $allSection)\t$paging.='<li><a href=\"./Board_list.php?page='.$nextPage.'\">Next</a></li>';\n\tif($page!=$allPage)\t\t\t\t\t$paging.='<li><a href=\"./Board_list.php?page='.$allPage.'\">End</a></li>';\n\t\n\t$paging.='</ul>';\n\n\t$currentLimit=($onePage * $page)-$onePage;\n\t$sqlLimit='limit '.$currentLimit.','.$onePage;\n\t\n\t$sql=\"select * from board \".$sqlLimit;\n\t$result=$con->query($sql);\n\techo $sql;\n}", "function createPaging($table,$cond=\"\",$id=\"\") {\n\n\t\tglobal $db, $start, $num, $pageFrom, $pageNum, $query, $field;\n\n\t\tif (strlen($cond)) $condString= \"WHERE \".$cond;\n\n\t\t$strSQL\t\t= \"SELECT * from $table $condString \";\n\t\t$result\t\t= $db->Execute($strSQL);\n\t\tif (!$result) print $db->ErrorMsg();\n\t\t$totalData\t= $result->RecordCount();\n\n\t\t$totalPage\t= ceil($totalData/$num);\n\t\t$sisa\t\t= $totalPage - $pageFrom;\n\n\t\tif ( $sisa < $pageNum ) $pageTo = $pageFrom + $sisa; else $pageTo = $pageFrom + $pageNum;\n\n\t\tif ( ($pageFrom - $pageNum) < 0 ) $pageBefore = 0; else $pageBefore = $pageFrom - $pageNum;\n\t\tif ( ($pageFrom + $pageNum) > ($totalPage - $pageNum) ) $pageNext = $totalPage - $pageNum; else $pageNext = $pageFrom + $pageNum;\n\t\tif ( $pageNext < 0 ) $pageNext = 0;\n\n\t\tif ( ($totalPage-$pageNum)<0 ) $pageLast = 0; else $pageLast = $totalPage-$pageNum;\n\n\t\tfor ($i=$pageFrom; $i<$pageTo; ++$i) {\n\t\t\t$page_i = $i + 1;\n\t\t\t$next_i = $i * $num;\n\t\t\tif ($next_i == $start) {\n\t\t\t\t$page .= \" <a href=$PHP_SELF?act=list&start=$next_i&num=$num&pageFrom=$pageFrom&pageNum=$pageNum&id=$id&query=\".rawurlencode($query).\"&field=$field><b>$page_i</b></a> \";\n\t\t\t} else {\n\t\t\t\t$page .= \" <a href=$PHP_SELF?act=list&start=$next_i&num=$num&pageFrom=$pageFrom&pageNum=$pageNum&id=$id&query=\".rawurlencode($query).\"&field=$field>$page_i</a> \";\n\t\t\t}\n\t\t}\n\n\t\t$final =\t\"<a \t\thref=$PHP_SELF?act=list&start=0&num=$num&pageFrom=0&pageNum=$pageNum&id=$id&query=\".rawurlencode($query).\"&field=$field>awal</a>\".\n\t\t\" | <a href=$PHP_SELF?act=list&start=\".($pageBefore*$num).\"&num=$num&pageFrom=$pageBefore&pageNum=$pageNum&id=$id&query=\".rawurlencode($query).\"&field=$field><<</a> \".\n\t\t$page.\n\t\t\" <a href=$PHP_SELF?act=list&start=\".($pageNext*$num).\"&num=$num&pageFrom=$pageNext&pageNum=$pageNum&id=$id&query=\".rawurlencode($query).\"&field=$field>>></a> | \".\n\t\t\"<a href=$PHP_SELF?act=list&start=\".(($totalPage-1)*$num).\"&num=$num&pageFrom=\".$pageLast.\"&pageNum=$pageNum&id=$id&query=\".rawurlencode($query).\"&field=$field>akhir</a>\";\n\n\t\treturn $final;\n\t}", "public function getPagerInput();", "private function getLinks(Pagerfanta $pagerFanta)\n {\n $route = $this->request->attributes->get('_route');\n // make sure we read the route parameters from the passed option array\n $defaultRouteParams = array_merge($this->request->query->all(), $this->request->attributes->get('_route_params', array()));\n $createLinkUrl = function ($targetPage) use ($route, $defaultRouteParams) {\n $router = $this->container->get('router');\n\n return $router->generate($route, array_merge(\n $defaultRouteParams,\n array('page' => $targetPage)\n ));\n };\n\n $this->addLink('self', $createLinkUrl($pagerFanta->getCurrentPage()));\n $this->addLink('first', $createLinkUrl(1));\n $this->addLink('last', $createLinkUrl($pagerFanta->getNbPages()));\n\n if ($pagerFanta->hasNextPage()) {\n $this->addLink('next', $createLinkUrl($pagerFanta->getNextPage()));\n }\n\n if ($pagerFanta->hasPreviousPage()) {\n $this->addLink('prev', $createLinkUrl($pagerFanta->getPreviousPage()));\n }\n\n return $this->links;\n }", "public function index() {\n $exploded = explode(\"/\", $this->_url);\n if (count($exploded) > 1) {\n $this->page(intval($exploded[1]));\n } else {\n $this->page(0);\n }\n }", "function paginator($data = [], $row_counts, $items_per_page = 10, $current_page = 1){\n\n\t$paginationCtrls = '';\n\n\t$last_page = ceil($row_counts/$items_per_page);\n\t$last_page = ($last_page < 1) ? 1 : $last_page;\n\n\t$current_page = preg_replace('/[^0-9]/', '', $current_page);\n\tif ( $current_page < 1 ) {\n\t\t$current_page = 1;\n\t}elseif ( $current_page > $last_page ) {\n\t\t$current_page = $last_page;\n\t}\n\t$limit_from = ($current_page - 1) * $items_per_page;\n\t$limit_to = $items_per_page;\n\n\t$result = array_slice($data, $limit_from, $limit_to);\n\n\t// Start first if\n\tif ( $last_page != 1 )\n\t{\n\t\t// Start second if\n\t\tif ( $current_page > 1 )\n\t\t{\n\t\t\t$previous = $current_page -1;\n\t\t\t$paginationCtrls .= '<a href=\"'. $_SERVER['PHP_SELF']. '?page='. $previous .'\">Previous</a> &nbsp;&nbsp;';\n\n\t\t\tfor($i=$current_page-4; $i < $current_page; $i++){\n\t\t\t\n\t\t\t\tif( $i > 0 ){\n\t\t\t\t\t$paginationCtrls .= '<a href=\"'. $_SERVER['PHP_SELF'] .'?page=' .$i. '\">'.$i.'</a> &nbsp;&nbsp; ';\n\t\t\t\t}\n\t\t\t}\n\t\t} // End second if\n\n\t\t$paginationCtrls .= ''.$current_page. ' &nbsp; ';\n\n\t\t\n\t\tfor($i=$current_page+1; $i <= $last_page ; $i++){\n\t\t\t$paginationCtrls .= '<a href=\"'. $_SERVER['PHP_SELF'] .'?page=' .$i. '\">'.$i.'</a> &nbsp;&nbsp; ';\n\t\t\t\n\t\t\tif( $i >= $current_page+4 ){\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\n\n\n\t\tif( $current_page != $last_page ){\n\n\t\t\t$next = $current_page + 1;\n\t\t\t$paginationCtrls .= '&nbsp;&nbsp; <a href=\"'. $_SERVER['PHP_SELF'] .'?page=' .$next. '\">Next</a> &nbsp;&nbsp; ';\n\t\t}\n\t}\n\t// End first if\n\n\t// dd( ['last page => '.$last_page, 'current page => '.$current_page, 'limit => '.$limit_from] );\n\n\treturn ['result' => $result, 'links' => $paginationCtrls];\n}" ]
[ "0.7457535", "0.731643", "0.69026375", "0.6886421", "0.6886421", "0.679177", "0.6775701", "0.67440784", "0.6713334", "0.66876215", "0.65640026", "0.65474916", "0.64812887", "0.6462723", "0.6413442", "0.6350926", "0.63221353", "0.63139397", "0.6313218", "0.630388", "0.6288795", "0.62705374", "0.625615", "0.6240518", "0.6199395", "0.61578953", "0.6151989", "0.6147808", "0.613381", "0.61327547", "0.61228895", "0.6119867", "0.6107994", "0.6092686", "0.60724974", "0.607176", "0.6071036", "0.60647434", "0.6035596", "0.602542", "0.60157037", "0.60133225", "0.6007346", "0.60072106", "0.60034764", "0.6003309", "0.5989349", "0.5973533", "0.5964589", "0.59397805", "0.5929931", "0.5929931", "0.5929837", "0.5928145", "0.5918816", "0.59082824", "0.59078383", "0.5899797", "0.5890548", "0.588917", "0.58785325", "0.5866424", "0.5854872", "0.58545685", "0.5850441", "0.5841414", "0.583144", "0.58287024", "0.5822486", "0.58156574", "0.5809367", "0.58088666", "0.5804892", "0.580474", "0.58017147", "0.5796325", "0.57927996", "0.5786667", "0.5784899", "0.5769151", "0.57666624", "0.5763674", "0.5762553", "0.5759928", "0.57584053", "0.5757501", "0.5755551", "0.5752024", "0.5750487", "0.57426596", "0.57426596", "0.57407147", "0.57383126", "0.57370263", "0.5735293", "0.57336146", "0.57283854", "0.57281417", "0.57188183", "0.57137203", "0.57136106" ]
0.0
-1
Display a listing of the resource.
public function index(Request $request) { if($request->isMethod("get")){ $pivotStatus = PivotStatus::with("user")->paginate(5); $response = array( "pivotStatus" => $pivotStatus, "request" => $request->all(), ); return response()->json($response); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }", "public function listing();", "function index() {\n\t\t$this->show_list();\n\t}", "public function actionList() {\n $this->_getList();\n }", "public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }", "public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }", "public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }", "function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}", "public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }", "public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }", "public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}", "function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}", "public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }", "public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}", "public function actionRestList() {\n\t $this->doRestList();\n\t}", "public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}", "public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }", "public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }", "public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}", "public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}", "public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }", "public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }", "public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }", "public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }", "public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}", "public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }", "public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}", "public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }", "public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function index()\n {\n $this->list_view();\n }", "public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }", "public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }", "public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}", "public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }", "public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }", "public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }", "public function index()\n {\n return Resources::collection(Checking::paginate());\n }", "public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }", "public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }", "public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }", "public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }", "public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }", "public function view(){\n\t\t$this->buildListing();\n\t}", "public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }", "public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }", "public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }", "public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }", "public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }", "public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }", "public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }", "public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }", "public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }", "public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}", "public function listAction() {}", "public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }", "public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }", "public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }", "public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }", "public function executeList()\n {\n $this->setTemplate('list');\n }", "public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }", "function listing() {\r\n\r\n }", "public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }", "public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }", "public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}", "public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }", "public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }", "public function _index(){\n\t $this->_list();\n\t}", "public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}", "function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}", "public function index()\n {\n $this->booklist();\n }", "public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }", "public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }", "public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }", "public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }", "public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }", "public function indexAction() {\n $this->_forward('list');\n }", "public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }", "public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }", "public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}", "public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }", "public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }", "public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }", "public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }", "public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }", "public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }", "public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }", "public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }", "public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}", "public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }", "public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }", "public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }", "public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}", "public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }", "public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }", "public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }", "public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }", "public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }", "public function index()\n {\n return view('admin.resources.index');\n }", "public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}" ]
[ "0.7446777", "0.736227", "0.73005503", "0.72478926", "0.71631265", "0.71489686", "0.7131636", "0.7105969", "0.71029514", "0.7101372", "0.70508176", "0.6995128", "0.69890636", "0.6934895", "0.6900203", "0.6899281", "0.6891734", "0.6887235", "0.68670005", "0.6849741", "0.6830523", "0.6802689", "0.6797", "0.67957735", "0.67871135", "0.6760129", "0.67427456", "0.6730486", "0.67272323", "0.67255723", "0.67255723", "0.67255723", "0.67177945", "0.6707866", "0.6706713", "0.6704375", "0.6664782", "0.6662871", "0.6660302", "0.6659404", "0.6656656", "0.6653517", "0.6647965", "0.6620322", "0.66185474", "0.6618499", "0.6606105", "0.6600617", "0.65996987", "0.6594775", "0.6587389", "0.6585109", "0.6581641", "0.6581017", "0.6577157", "0.65747666", "0.6572513", "0.65721947", "0.6570553", "0.65646994", "0.6563556", "0.6554194", "0.65529937", "0.65460825", "0.65368485", "0.653429", "0.65328294", "0.6526759", "0.6526695", "0.6526284", "0.65191334", "0.65183175", "0.65174305", "0.651703", "0.65141153", "0.6507088", "0.65061647", "0.6504046", "0.64942145", "0.6491893", "0.64883405", "0.6486392", "0.6485077", "0.64846045", "0.6478858", "0.64756656", "0.64726377", "0.6471126", "0.64701074", "0.6467418", "0.6462195", "0.64618355", "0.6459199", "0.6457831", "0.6454631", "0.64533997", "0.6451915", "0.6450861", "0.6449301", "0.64492667", "0.64469045" ]
0.0
-1
Show the form for creating a new resource.
public function create() { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return $this->showForm('create');\n }", "public function create()\n {\n return view('admin.resources.create');\n }", "public function create(){\n\n return view('resource.create');\n }", "public function create()\n\t{\n\t\treturn $this->showForm('create');\n\t}", "public function create()\n {\n return \"Display a form for creating a new catalogue\";\n }", "public function newAction()\n {\n $entity = new Resource();\n $current = $this->get('security.context')->getToken()->getUser();\n $entity->setMember($current);\n $form = $this->createCreateForm($entity);\n\n return array(\n 'nav_active'=>'admin_resource',\n 'entity' => $entity,\n 'form' => $form->createView(),\n );\n }", "public function create()\n {\n return view ('forms.create');\n }", "public function create ()\n {\n return view('forms.create');\n }", "public function create()\n\t{\n\t\treturn view('faith.form');\n\t}", "public function create(NebulaResource $resource): View\n {\n $this->authorize('create', $resource->model());\n\n return view('nebula::resources.create', [\n 'resource' => $resource,\n ]);\n }", "public function create()\n {\n return view(\"request_form.form\");\n }", "public function create()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.create\")) {\n $view = \"admin.{$this->name}.create\";\n } else {\n $view = 'admin.includes.actions.create';\n }\n\n /* Show the form for creating a new resource. */\n return view($view)\n ->with('name', $this->name);\n }", "public function newAction()\n\t{\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => 'Ajouter une nouvelle &eacute;cole'\n\t\t) ) );\n\t}", "public function create()\n {\n return view($this->forms . '.create');\n }", "public function create()\n {\n return view('restful.add');\n }", "public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }", "public function create()\n {\n return view('admin.createform');\n }", "public function create()\n {\n return view('admin.forms.create');\n }", "public function create()\n {\n return view('backend.student.form');\n }", "public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function create()\n {\n return view('client.form');\n }", "public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }", "public function create()\n {\n return view('Form');\n }", "public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }", "public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}", "public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n return view('form');\n }", "public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }", "public function create()\n {\n return view('backend.schoolboard.addform');\n }", "public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}", "public function create()\n {\n //\n return view('form');\n }", "public function create()\n {\n return view('rests.create');\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return $this->showForm();\n }", "public function create()\n {\n return view(\"Add\");\n }", "public function create(){\n return view('form.create');\n }", "public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }", "public function create()\n {\n\n return view('control panel.student.add');\n\n }", "public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}", "public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }", "public function create()\n {\n return $this->cView(\"form\");\n }", "public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }", "public function create()\n {\n return view(\"dresses.form\");\n }", "public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}", "public function createAction()\n {\n// $this->view->form = $form;\n }", "public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }", "public function create()\n {\n return view('fish.form');\n }", "public function create()\n {\n return view('users.forms.create');\n }", "public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }", "public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}", "public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }", "public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }", "public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }", "public function create()\n {\n return view('essentials::create');\n }", "public function create()\n {\n return view('student.add');\n }", "public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}", "public function create()\n {\n return view('url.form');\n }", "public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }", "public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}", "public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }", "public function create()\n {\n return view('libro.create');\n }", "public function create()\n {\n return view('libro.create');\n }", "public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view('crud/add'); }", "public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}", "public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n return view(\"List.form\");\n }", "public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}", "public function create()\n {\n //load create form\n return view('products.create');\n }", "public function create()\n {\n return view('article.addform');\n }", "public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }", "public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}", "public function create()\n {\n return view('saldo.form');\n }", "public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}", "public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }", "public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }", "public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }", "public function create()\n {\n return view('admin.inverty.add');\n }", "public function create()\n {\n return view('Libro.create');\n }", "public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }", "public function create()\n {\n return view(\"familiasPrograma.create\");\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n {\n return view('admin.car.create');\n }", "public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}", "public function create()\n {\n return view(\"create\");\n }", "public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}", "public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }", "public function create()\n {\n return view('forming');\n }", "public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }", "public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }", "public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }", "public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }", "public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }", "public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}", "public function create()\n {\n return view('student::students.student.create');\n }", "public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}" ]
[ "0.75948673", "0.75948673", "0.75863165", "0.7577412", "0.75727344", "0.7500887", "0.7434847", "0.7433956", "0.73892003", "0.73531085", "0.73364776", "0.73125", "0.7296102", "0.7281891", "0.72741455", "0.72424185", "0.7229325", "0.7226713", "0.7187349", "0.7179176", "0.7174283", "0.7150356", "0.71444064", "0.71442676", "0.713498", "0.71283126", "0.7123691", "0.71158516", "0.71158516", "0.71158516", "0.7112176", "0.7094388", "0.7085711", "0.708025", "0.70800644", "0.70571953", "0.70571953", "0.70556754", "0.70396435", "0.7039549", "0.7036275", "0.703468", "0.70305896", "0.7027638", "0.70265305", "0.70199823", "0.7018007", "0.7004984", "0.7003889", "0.7000935", "0.69973785", "0.6994679", "0.6993764", "0.6989918", "0.6986989", "0.6966502", "0.69656384", "0.69564354", "0.69518244", "0.6951109", "0.6947306", "0.69444615", "0.69423944", "0.6941156", "0.6937871", "0.6937871", "0.6936686", "0.69345254", "0.69318026", "0.692827", "0.69263744", "0.69242257", "0.6918349", "0.6915889", "0.6912884", "0.691146", "0.69103104", "0.69085974", "0.69040126", "0.69014287", "0.69012105", "0.6900397", "0.68951064", "0.6893521", "0.68932164", "0.6891899", "0.6891616", "0.6891616", "0.6889246", "0.68880934", "0.6887128", "0.6884732", "0.68822503", "0.68809193", "0.6875949", "0.68739206", "0.68739134", "0.6870358", "0.6869779", "0.68696856", "0.686877" ]
0.0
-1
Store a newly created resource in storage.
public function store(Request $request) { $validation = Validator::make( $request->all(), [ "user_id" => 'required|integer|numeric', 'name' => 'required|max:255', ] ); $errors = $validation->errors(); if($validation->fails()){ $response = array( "message" => "Failed", "errors" => $errors, ); return response()->json($response); } else{ if($request->isMethod("post")){ $pivotStatus = new PivotStatus; $pivotStatus->name = $request->name; $pivotStatus->user_id = $request->name; $this->authorize('create', $pivotStatus); $pivotStatus->save(); $response = array( "message" => "bravo", "request" => $request->all(), ); return response()->json($response); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function store($data, Resource $resource);", "public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }", "public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }", "public function createStorage();", "public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "function storeAndNew() {\n $this->store();\n }", "public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }", "public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }", "public function store()\n\t{\n\t\t\n\t\t//\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\r\n\t{\r\n\t\t//\r\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}", "public function store()\n\t{\n\t\t//\n\t}" ]
[ "0.72865677", "0.7145327", "0.71325725", "0.6640912", "0.66209733", "0.65685713", "0.652643", "0.65095705", "0.64490104", "0.637569", "0.63736665", "0.63657933", "0.63657933", "0.63657933", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437", "0.6342437" ]
0.0
-1
Display the specified resource.
public function show(Request $request) { $user_id = $request->user_id; $validation = Validator::make( $request->all(), [ 'status_id' => 'required|integer|numeric', ] ); $errors = $validation->errors(); if($validation->fails()){ $response = array( "message" => "Failed", "errors" => $errors, ); return response()->json($response); } else{ if($request->isMethod("get")){ $pivotStatus = PivotStatus::find($request->status_id); $response = array( "pivotStatus" => $pivotStatus, "request" => $request->all(), ); return response()->json($response); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function show(Resource $resource)\n {\n // not available for now\n }", "public function show(Resource $resource)\n {\n //\n }", "function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }", "private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }", "function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}", "public function show(ResourceSubject $resourceSubject)\n {\n //\n }", "public function show(ResourceManagement $resourcesManagement)\n {\n //\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function retrieve(Resource $resource);", "public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }", "public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function show(Dispenser $dispenser)\n {\n //\n }", "public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }", "public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}", "public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }", "function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}", "public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }", "public function get(Resource $resource);", "public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }", "public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }", "function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}", "public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }", "function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}", "public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function show(rc $rc)\n {\n //\n }", "public function show(Resolucion $resolucion)\n {\n //\n }", "public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show()\n\t{\n\t\t//\n\t}", "public function show(Resena $resena)\n {\n }", "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }", "public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}", "public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }", "public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }", "public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }", "public function display()\n\t{\n\t\tparent::display();\n\t}", "public function get_resource();", "public function show()\n\t{\n\t\t\n\t}", "function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}", "public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }", "public function display($title = null)\n {\n echo $this->fetch($title);\n }", "public function display(){}", "public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}", "public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}", "public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }", "#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}", "public function display() {\n echo $this->render();\n }", "public function show($id)\n\t{\n\t//\n\t}", "public function show($id)\n\t{\n\t//\n\t}", "function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }", "public function show($id)\n {\n //\n $this->_show($id);\n }", "public function show()\n\t{\n\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {\n\t\t//\n\t}", "public function show($id) {}", "static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}", "public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}", "public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }", "public abstract function display();", "abstract public function resource($resource);", "public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show( $id ) {\n\t\t//\n\t}", "public function show(Response $response)\n {\n //\n }", "public function show()\n {\n return auth()->user()->getResource();\n }", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}", "public function show($id)\n\t{\n\t\t//\n\t}" ]
[ "0.8233718", "0.8190437", "0.6828712", "0.64986944", "0.6495974", "0.6469629", "0.6462615", "0.6363665", "0.6311607", "0.62817234", "0.6218966", "0.6189695", "0.61804265", "0.6171014", "0.61371076", "0.61207956", "0.61067593", "0.6105954", "0.6094066", "0.6082806", "0.6045245", "0.60389996", "0.6016584", "0.598783", "0.5961788", "0.59606946", "0.5954321", "0.59295714", "0.59182066", "0.5904556", "0.59036547", "0.59036547", "0.59036547", "0.5891874", "0.58688277", "0.5868107", "0.58676815", "0.5851883", "0.58144855", "0.58124036", "0.58112013", "0.5803467", "0.58012545", "0.5791527", "0.57901084", "0.5781528", "0.5779676", "0.5757105", "0.5756208", "0.57561266", "0.57453394", "0.57435393", "0.57422745", "0.5736634", "0.5736634", "0.5730559", "0.57259274", "0.5724891", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5722562", "0.5718969", "0.5713412", "0.57091093", "0.5706405", "0.57057405", "0.5704541", "0.5704152", "0.57026845", "0.57026845", "0.56981397", "0.5693083", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962", "0.5684962" ]
0.0
-1
Show the form for editing the specified resource.
public function edit($id) { // }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }", "public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }", "public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }", "public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }", "public function edit()\n {\n return view('hirmvc::edit');\n }", "public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}", "public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }", "public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}", "public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }", "public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }", "private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function edit($id)\n {\n return $this->showForm('update', $id);\n }", "public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }", "public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }", "public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}", "public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }", "public function edit($model, $form);", "function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}", "public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}", "public function edit()\n { \n return view('admin.control.edit');\n }", "public function edit(Form $form)\n {\n //\n }", "public function edit()\n {\n return view('common::edit');\n }", "public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\n {\n return view('admin::edit');\n }", "public function edit()\r\n {\r\n return view('petro::edit');\r\n }", "public function edit($id)\n {\n // show form edit user info\n }", "public function edit()\n {\n return view('escrow::edit');\n }", "public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }", "public function edit()\n {\n return view('commonmodule::edit');\n }", "public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit()\n {\n return view('catalog::edit');\n }", "public function edit(form $form)\n {\n //\n }", "public function actionEdit($id) { }", "public function edit()\n {\n return view('admincp::edit');\n }", "public function edit()\n {\n return view('scaffold::edit');\n }", "public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }", "public function edit()\n {\n return view('Person.edit');\n }", "public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }", "public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}", "public function edit(Flight $exercise, FlightResource $resource)\n {\n return $this->viewMake('adm.smartcars.exercise-resources.edit')\n ->with('flight', $exercise)\n ->with('resource', $resource);\n }", "public function edit($id)\n\t{\n\t\t// get the material\n\t\t$material = Material::find($id);\n\n\t\t// show the edit form and pass the material\n\t\t$this->layout->content = View::make('material.edit')\n\t\t\t->with('material', $material);\n\t}", "public function edit($id, Request $request)\n {\n $formObj = $this->modelObj->find($id);\n\n if(!$formObj)\n {\n abort(404);\n } \n\n $data = array();\n $data['formObj'] = $formObj;\n $data['page_title'] = \"Edit \".$this->module;\n $data['buttonText'] = \"Update\";\n\n $data['action_url'] = $this->moduleRouteText.\".update\";\n $data['action_params'] = $formObj->id;\n $data['method'] = \"PUT\"; \n\n return view($this->moduleViewName.'.add', $data);\n }", "public function edit()\n {\n $id = $this->getId();\n return view('panel.user.form', [\n 'user' => $this->userRepository->findById($id),\n 'method' => 'PUT',\n 'routePrefix' => 'profile',\n 'route' => 'profile.update',\n 'parameters' => [$id],\n 'breadcrumbs' => $this->getBreadcrumb('Editar')\n ]);\n }", "public function edit()\r\n {\r\n return view('mpcs::edit');\r\n }", "function edit()\n\t{\n\t\t// hien thi form sua san pham\n\t\t$id = getParameter('id');\n\t\t$product = $this->model->product->find_by_id($id);\n\t\t$this->layout->set('auth_layout');\n\t\t$this->view->load('product/edit', [\n\t\t\t'product' => $product\n\t\t]);\n\t}", "public function edit($id)\n {\n //\n $data = Diskon::find($id);\n\n $form = $this->form;\n $edit = $this->edit;\n $field = $this->field;\n $page = $this->page;\n $id = $id;\n $title = $this->title;\n return view('admin/page/'.$this->page.'/edit',compact('form','edit','data','field','page','id','title'));\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "public function edit($id)\n {\n return $this->showForm($id);\n }", "protected function _edit(){\n\t\treturn $this->_editForm();\n\t}", "public function editAction()\n {\n $robot = Robots::findFirst($this->session->get(\"robot-id\"));\n if ($this->request->isGet()) {\n $this->tag->prependTitle(\"Редактировать робота :: \");\n $user = $this->session->get(\"auth-id\");\n if (!$robot) {\n $this->flashSession->error(\n \"Робот не найден\"\n );\n return $this->response->redirect(\"users/usershow/$user->name\");\n }\n\n }\n\n $this->view->form = new RobotForm(\n $robot,\n [\n \"edit\" => true,\n ]\n );\n }", "public function editAction()\n {\n $form = new $this->form();\n\n $request = $this->getRequest();\n $param = $this->params()->fromRoute('id', 0);\n\n $repository = $this->getEm()->getRepository($this->entity);\n $entity = $repository->find($param);\n\n if ($entity) {\n\n $form->setData($entity->toArray());\n\n if ( $request->isPost() ) {\n\n $form->setData($request->getPost());\n\n if ( $form->isValid() ) {\n\n $service = $this->getServiceLocator()->get($this->service);\n $service->update($request->getPost()->toArray());\n\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n }\n } else {\n return $this->redirect()->toRoute($this->route, array('controller' => $this->controller));\n }\n\n return new ViewModel(array('form' => $form, 'id' => $param));\n\n }", "public function edit($id)\n\t{\n\t\t$SysApplication = \\Javan\\Dynaflow\\Domain\\Model\\SysApplication::find($id);\n\t\t$form = \\FormBuilder::create('Javan\\Dynaflow\\FormBuilder\\SysApplicationForm', [\n \t'method' => 'POST',\n \t'url' => 'sysapplication/update/'.$id,\n \t'model' => $SysApplication,\n \t'data' => [ 'flow_id' => $SysApplication->flow_id]\n \t]);\n\t\treturn View::make('dynaflow::sysapplication.form', compact('form', 'SysApplication'));\n\t}", "public function editAction() {\n\t\t$id = (int) $this->_getParam('id');\n\t\t$modelName = $this->_getParam('model');\n\t\t\n\t\t$model = Marcel_Backoffice_Model::factory($modelName);\n\t\t$item = $model->find($id)->current();\n\t\tif (!$item) {\n\t\t\t$item = $model->createRow();\n\t\t}\n\t\t$form = $item->getForm();\n\t\tif ($this->_request->isPost()) {\n\t\t\t$newId = $form->populate($this->_request->getPost())->save();\n\t\t\tif ($newId) {\n\t\t\t\t$this->_helper->flashMessenger('Saved successfully!');\n\t\t\t\t$this->_helper->redirector('edit', null, null, array('id' => $newId, 'model' => $modelName));\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t\t$this->view->messages = $this->_helper->flashMessenger->getMessages();\n\t}", "public function edit($id)\n {\n return view('models::edit');\n }", "public function edit()\n {\n return view('home::edit');\n }", "public function editAction()\n {\n $id = $this->params()->fromRoute('id');\n $entity = $this->entityManager->find(Entity\\CourtClosing::class, $id);\n if (! $entity) {\n // to do: deal with it\n }\n $form = $this->getForm('update');\n $form->bind($entity);\n if ($this->getRequest()->isPost()) {\n return $this->post();\n }\n\n return new ViewModel(['form' => $form]);\n }", "public function editAction($id)\n {\n $entity = $this->getManager()->find($id);\n\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Editar');\n\n if (!$entity) {\n throw $this->createNotFoundException('No se ha encontrado el elemento');\n }\n\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:edit.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit()\n {\n return view('user::edit');\n }", "public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }", "public function editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }", "public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('consultas::edit');\n }", "public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }", "public function edit()\n {\n return view('dashboard::edit');\n }", "public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }", "public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }", "public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }", "public function edit() {\n return view('routes::edit');\n }", "public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }", "public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return view('cataloguemodule::edit');\n }", "public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }", "public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\n }", "public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }", "public function edit()\n {\n return view('website::edit');\n }", "public function edit()\n {\n return view('inventory::edit');\n }", "public function edit()\n {\n return view('initializer::edit');\n }", "public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }", "public function edit($id)\n {\n return view('backend::edit');\n }", "public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n return view('crm::edit');\n }", "public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }", "public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}", "public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }", "public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}", "public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }", "public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }", "public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }", "public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }", "public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }", "public function edit($id)\n {\n return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }", "public function edit($id)\n\t{\n\t\t // get the project\n $project = Project::find($id);\n\n // show the edit form and pass the project\n return View::make('logicViews.projects.edit')->with('project', $project);\n\t}" ]
[ "0.78550774", "0.7692893", "0.7273195", "0.7242132", "0.7170847", "0.70622855", "0.7053459", "0.6982539", "0.69467914", "0.6945275", "0.6941114", "0.6928077", "0.69019294", "0.68976134", "0.68976134", "0.6877213", "0.68636996", "0.68592185", "0.68566656", "0.6844697", "0.68336326", "0.6811471", "0.68060875", "0.68047357", "0.68018645", "0.6795623", "0.6791791", "0.6791791", "0.6787701", "0.67837197", "0.67791027", "0.677645", "0.6768301", "0.6760122", "0.67458534", "0.67458534", "0.67443407", "0.67425704", "0.6739898", "0.6735328", "0.6725465", "0.6712817", "0.6693891", "0.6692419", "0.6688581", "0.66879624", "0.6687282", "0.6684741", "0.6682786", "0.6668777", "0.6668427", "0.6665287", "0.6665287", "0.66610634", "0.6660843", "0.66589665", "0.66567147", "0.66545695", "0.66527975", "0.6642529", "0.6633056", "0.6630304", "0.6627662", "0.6627662", "0.66192114", "0.6619003", "0.66153085", "0.6614968", "0.6609744", "0.66086483", "0.66060555", "0.6596137", "0.65950733", "0.6594648", "0.65902114", "0.6589043", "0.6587102", "0.65799844", "0.65799403", "0.65799177", "0.657708", "0.65760696", "0.65739626", "0.656931", "0.6567826", "0.65663105", "0.65660435", "0.65615267", "0.6561447", "0.6561447", "0.65576506", "0.655686", "0.6556527", "0.6555543", "0.6555445", "0.65552044", "0.65543956", "0.65543705", "0.6548264", "0.65475875", "0.65447706" ]
0.0
-1
Update the specified resource in storage.
public function update(Request $request) { $validation = Validator::make( $request->all(), [ "status_id" => 'required|integer', 'name' => 'required|max:255', ] ); $errors = $validation->errors(); if($validation->fails()){ $response = array( "message" => "Failed", "errors" => $errors, ); return response()->json($response); } else{ if($request->isMethod("patch")){ $pivotStatus = PivotStatus::find($request->status_id); $pivotStatus->name = $request->name; $this->authorize('update', $pivotStatus); $pivotStatus->save(); $response = array( "message" => "bravo", "request" => $request->all(), ); return response()->json($response); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }", "public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }", "public function update(Request $request, Resource $resource)\n {\n //\n }", "public function updateStream($resource);", "public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }", "protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }", "public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }", "public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}", "public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }", "public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }", "protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }", "public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }", "public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }", "public function update($path);", "public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }", "public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }", "public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}", "public function updateStream($path, $resource, Config $config)\n {\n }", "public function edit(Resource $resource)\n {\n //\n }", "public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }", "public function update($data) {}", "public function update($data) {}", "public function putStream($resource);", "public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }", "public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }", "public function update($entity);", "public function update($entity);", "public function setResource($resource);", "public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }", "public function isUpdateResource();", "public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }", "public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }", "public function store($data, Resource $resource);", "public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }", "public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }", "public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }", "public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }", "public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }", "public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }", "public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }", "public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }", "public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }", "public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }", "public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }", "public function update(Qstore $request, $id)\n {\n //\n }", "public function update(IEntity $entity);", "protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }", "public function update($request, $id);", "function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}", "public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }", "public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }", "protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }", "abstract public function put($data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function update($id, $data);", "public function testUpdateSupplierUsingPUT()\n {\n }", "public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }", "public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }", "public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }", "public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }", "public abstract function update($object);", "public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }", "public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }", "public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }", "public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }", "public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }", "public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }", "public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }", "public function update($entity)\n {\n \n }", "public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }", "public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }", "public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }", "public function update($id, $input);", "public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }", "public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}", "public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }", "public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }", "public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }", "public function update($id);", "public function update($id);", "private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }", "public function put($path, $data = null);", "public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }", "public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }", "public function update(Entity $entity);", "public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }", "public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}", "public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }", "public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }", "public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }", "public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }", "public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }", "public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }" ]
[ "0.7425105", "0.70612276", "0.70558053", "0.6896673", "0.6582159", "0.64491373", "0.6346954", "0.62114537", "0.6145042", "0.6119944", "0.61128503", "0.6099993", "0.6087866", "0.6052593", "0.6018941", "0.60060275", "0.59715486", "0.5946516", "0.59400934", "0.59377414", "0.5890722", "0.5860816", "0.5855127", "0.5855127", "0.58513457", "0.5815068", "0.5806887", "0.57525045", "0.57525045", "0.57337505", "0.5723295", "0.5714311", "0.5694472", "0.5691319", "0.56879413", "0.5669989", "0.56565005", "0.56505877", "0.5646085", "0.5636683", "0.5633498", "0.5633378", "0.5632906", "0.5628826", "0.56196684", "0.5609126", "0.5601397", "0.55944353", "0.5582592", "0.5581908", "0.55813426", "0.5575312", "0.55717176", "0.55661047", "0.55624634", "0.55614686", "0.55608666", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55599797", "0.55573726", "0.5556878", "0.5554201", "0.5553069", "0.55530256", "0.5543788", "0.55435944", "0.55412996", "0.55393505", "0.55368495", "0.5535236", "0.5534954", "0.55237365", "0.5520468", "0.55163723", "0.55125296", "0.5511168", "0.5508345", "0.55072427", "0.5502385", "0.5502337", "0.5501029", "0.54995877", "0.54979175", "0.54949397", "0.54949397", "0.54946727", "0.5494196", "0.54941916", "0.54925025", "0.5491807", "0.5483321", "0.5479606", "0.5479408", "0.5478678", "0.54667485", "0.5463411", "0.5460588", "0.5458525" ]
0.0
-1
Remove the specified resource from storage.
public function destroy(Request $request) { $validation = Validator::make( $request->all(), [ 'status_id' => 'required|integer|numeric', ] ); $errors = $validation->errors(); if($validation->fails()){ $response = array( "message" => "Failed", "errors" => $errors, ); return response()->json($response); } else{ if($request->isMethod("delete")){ $pivotStatus = PivotStatus::find($request->status_id); $this->authorize('delete', $pivotStatus); $pivotStatus->delete(); $response = array( "message" => "Deleted", "request" => $request->all(), ); return response()->json($response); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }", "public function destroy(Resource $resource)\n {\n //\n }", "public function removeResource($resourceID)\n\t\t{\n\t\t}", "public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }", "public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }", "public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }", "public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }", "protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }", "public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }", "public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }", "public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}", "public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}", "public function delete(): void\n {\n unlink($this->getPath());\n }", "public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }", "public function remove($path);", "function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}", "public function delete(): void\n {\n unlink($this->path);\n }", "private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }", "public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }", "public function remove() {}", "public function remove() {}", "public function remove();", "public function remove();", "public function remove();", "public function remove();", "function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}", "public function deleteImage(){\n\n\n Storage::delete($this->image);\n }", "public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }", "public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}", "public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }", "public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }", "public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}", "public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }", "public function deleteImage(){\n \tStorage::delete($this->image);\n }", "public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }", "public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }", "public function destroy($id)\n {\n Myfile::find($id)->delete();\n }", "public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }", "public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }", "public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }", "public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }", "public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }", "public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }", "public function delete($path);", "public function delete($path);", "public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }", "public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }", "public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }", "public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }", "public function delete($path, $data = null);", "public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }", "public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }", "public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }", "public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }", "public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }", "public function del($path){\n\t\treturn $this->remove($path);\n\t}", "public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }", "public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}", "public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }", "public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }", "public function revoke($resource, $permission = null);", "public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }", "function delete($path);", "public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}", "public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }", "public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }", "public function remove($filePath){\n return Storage::delete($filePath);\n }", "public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }", "public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }", "public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }", "public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }", "function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }", "public function remove($id);", "public function remove($id);", "public function deleted(Storage $storage)\n {\n //\n }", "public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }", "public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }", "public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }", "public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }", "function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function delete();", "public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}", "public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }", "public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}", "public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }", "public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }" ]
[ "0.6672584", "0.6659381", "0.6635911", "0.6632799", "0.6626075", "0.65424126", "0.65416265", "0.64648265", "0.62882507", "0.6175931", "0.6129922", "0.60893893", "0.6054415", "0.60428125", "0.60064924", "0.59337646", "0.5930772", "0.59199584", "0.5919811", "0.5904504", "0.5897263", "0.58962846", "0.58951396", "0.58951396", "0.58951396", "0.58951396", "0.5880124", "0.58690923", "0.5863659", "0.5809161", "0.57735413", "0.5760811", "0.5753559", "0.57492644", "0.5741712", "0.57334286", "0.5726379", "0.57144034", "0.57096", "0.5707689", "0.5705895", "0.5705634", "0.5703902", "0.5696585", "0.5684331", "0.5684331", "0.56780374", "0.5677111", "0.5657287", "0.5648262", "0.5648085", "0.5648012", "0.5640759", "0.5637738", "0.5629985", "0.5619264", "0.56167465", "0.5606877", "0.56021434", "0.5601949", "0.55992156", "0.5598557", "0.55897516", "0.5581397", "0.5566926", "0.5566796", "0.55642897", "0.55641", "0.5556583", "0.5556536", "0.5550097", "0.5543172", "0.55422723", "0.5540013", "0.5540013", "0.55371785", "0.55365825", "0.55300397", "0.552969", "0.55275744", "0.55272335", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.55271083", "0.5525997", "0.5525624", "0.5523911", "0.5521122", "0.5517412" ]
0.0
-1