`, and ``.
-$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
-$font-family-base: $font-family-sans-serif !default;
-
-$font-size-base: 14px !default;
-$font-size-large: ceil(($font-size-base * 1.25)) !default; // ~18px
-$font-size-small: ceil(($font-size-base * 0.85)) !default; // ~12px
-
-$font-size-h1: floor(($font-size-base * 2.6)) !default; // ~36px
-$font-size-h2: floor(($font-size-base * 2.15)) !default; // ~30px
-$font-size-h3: ceil(($font-size-base * 1.7)) !default; // ~24px
-$font-size-h4: ceil(($font-size-base * 1.25)) !default; // ~18px
-$font-size-h5: $font-size-base !default;
-$font-size-h6: ceil(($font-size-base * 0.85)) !default; // ~12px
-
-//** Unit-less `line-height` for use in components like buttons.
-$line-height-base: 1.428571429 !default; // 20/14
-//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
-$line-height-computed: floor(($font-size-base * $line-height-base)) !default; // ~20px
-
-//** By default, this inherits from the ``.
-$headings-font-family: inherit !default;
-$headings-font-weight: 500 !default;
-$headings-line-height: 1.1 !default;
-$headings-color: inherit !default;
-
-
-//== Iconography
-//
-//## Specify custom location and filename of the included Glyphicons icon font. Useful for those including Bootstrap via Bower.
-
-//** Load fonts from this directory.
-
-// [converter] If $bootstrap-sass-asset-helper if used, provide path relative to the assets load path.
-// [converter] This is because some asset helpers, such as Sprockets, do not work with file-relative paths.
-$icon-font-path: if($bootstrap-sass-asset-helper, "bootstrap/", "../fonts/bootstrap/") !default;
-
-//** File name for all font files.
-$icon-font-name: "glyphicons-halflings-regular" !default;
-//** Element ID within SVG icon file.
-$icon-font-svg-id: "glyphicons_halflingsregular" !default;
-
-
-//== Components
-//
-//## Define common padding and border radius sizes and more. Values based on 14px text and 1.428 line-height (~20px to start).
-
-$padding-base-vertical: 6px !default;
-$padding-base-horizontal: 12px !default;
-
-$padding-large-vertical: 10px !default;
-$padding-large-horizontal: 16px !default;
-
-$padding-small-vertical: 5px !default;
-$padding-small-horizontal: 10px !default;
-
-$padding-xs-vertical: 1px !default;
-$padding-xs-horizontal: 5px !default;
-
-$line-height-large: 1.3333333 !default; // extra decimals for Win 8.1 Chrome
-$line-height-small: 1.5 !default;
-
-$border-radius-base: 4px !default;
-$border-radius-large: 6px !default;
-$border-radius-small: 3px !default;
-
-//** Global color for active items (e.g., navs or dropdowns).
-$component-active-color: #fff !default;
-//** Global background color for active items (e.g., navs or dropdowns).
-$component-active-bg: $brand-primary !default;
-
-//** Width of the `border` for generating carets that indicate dropdowns.
-$caret-width-base: 4px !default;
-//** Carets increase slightly in size for larger components.
-$caret-width-large: 5px !default;
-
-
-//== Tables
-//
-//## Customizes the `.table` component with basic values, each used across all table variations.
-
-//** Padding for ``s and ` `s.
-$table-cell-padding: 8px !default;
-//** Padding for cells in `.table-condensed`.
-$table-condensed-cell-padding: 5px !default;
-
-//** Default background color used for all tables.
-$table-bg: transparent !default;
-//** Background color used for `.table-striped`.
-$table-bg-accent: #f9f9f9 !default;
-//** Background color used for `.table-hover`.
-$table-bg-hover: #f5f5f5 !default;
-$table-bg-active: $table-bg-hover !default;
-
-//** Border color for table and cell borders.
-$table-border-color: #ddd !default;
-
-
-//== Buttons
-//
-//## For each of Bootstrap's buttons, define text, background and border color.
-
-$btn-font-weight: normal !default;
-
-$btn-default-color: #333 !default;
-$btn-default-bg: #fff !default;
-$btn-default-border: #ccc !default;
-
-$btn-primary-color: #fff !default;
-$btn-primary-bg: $brand-primary !default;
-$btn-primary-border: darken($btn-primary-bg, 5%) !default;
-
-$btn-success-color: #fff !default;
-$btn-success-bg: $brand-success !default;
-$btn-success-border: darken($btn-success-bg, 5%) !default;
-
-$btn-info-color: #fff !default;
-$btn-info-bg: $brand-info !default;
-$btn-info-border: darken($btn-info-bg, 5%) !default;
-
-$btn-warning-color: #fff !default;
-$btn-warning-bg: $brand-warning !default;
-$btn-warning-border: darken($btn-warning-bg, 5%) !default;
-
-$btn-danger-color: #fff !default;
-$btn-danger-bg: $brand-danger !default;
-$btn-danger-border: darken($btn-danger-bg, 5%) !default;
-
-$btn-link-disabled-color: $gray-light !default;
-
-// Allows for customizing button radius independently from global border radius
-$btn-border-radius-base: $border-radius-base !default;
-$btn-border-radius-large: $border-radius-large !default;
-$btn-border-radius-small: $border-radius-small !default;
-
-
-//== Forms
-//
-//##
-
-//** ` ` background color
-$input-bg: #fff !default;
-//** ` ` background color
-$input-bg-disabled: $gray-lighter !default;
-
-//** Text color for ` `s
-$input-color: $gray !default;
-//** ` ` border color
-$input-border: #ccc !default;
-
-// TODO: Rename `$input-border-radius` to `$input-border-radius-base` in v4
-//** Default `.form-control` border radius
-// This has no effect on ``s in some browsers, due to the limited stylability of ``s in CSS.
-$input-border-radius: $border-radius-base !default;
-//** Large `.form-control` border radius
-$input-border-radius-large: $border-radius-large !default;
-//** Small `.form-control` border radius
-$input-border-radius-small: $border-radius-small !default;
-
-//** Border color for inputs on focus
-$input-border-focus: #66afe9 !default;
-
-//** Placeholder text color
-$input-color-placeholder: #999 !default;
-
-//** Default `.form-control` height
-$input-height-base: ($line-height-computed + ($padding-base-vertical * 2) + 2) !default;
-//** Large `.form-control` height
-$input-height-large: (ceil($font-size-large * $line-height-large) + ($padding-large-vertical * 2) + 2) !default;
-//** Small `.form-control` height
-$input-height-small: (floor($font-size-small * $line-height-small) + ($padding-small-vertical * 2) + 2) !default;
-
-//** `.form-group` margin
-$form-group-margin-bottom: 15px !default;
-
-$legend-color: $gray-dark !default;
-$legend-border-color: #e5e5e5 !default;
-
-//** Background color for textual input addons
-$input-group-addon-bg: $gray-lighter !default;
-//** Border color for textual input addons
-$input-group-addon-border-color: $input-border !default;
-
-//** Disabled cursor for form controls and buttons.
-$cursor-disabled: not-allowed !default;
-
-
-//== Dropdowns
-//
-//## Dropdown menu container and contents.
-
-//** Background for the dropdown menu.
-$dropdown-bg: #fff !default;
-//** Dropdown menu `border-color`.
-$dropdown-border: rgba(0,0,0,.15) !default;
-//** Dropdown menu `border-color` **for IE8**.
-$dropdown-fallback-border: #ccc !default;
-//** Divider color for between dropdown items.
-$dropdown-divider-bg: #e5e5e5 !default;
-
-//** Dropdown link text color.
-$dropdown-link-color: $gray-dark !default;
-//** Hover color for dropdown links.
-$dropdown-link-hover-color: darken($gray-dark, 5%) !default;
-//** Hover background for dropdown links.
-$dropdown-link-hover-bg: #f5f5f5 !default;
-
-//** Active dropdown menu item text color.
-$dropdown-link-active-color: $component-active-color !default;
-//** Active dropdown menu item background color.
-$dropdown-link-active-bg: $component-active-bg !default;
-
-//** Disabled dropdown menu item background color.
-$dropdown-link-disabled-color: $gray-light !default;
-
-//** Text color for headers within dropdown menus.
-$dropdown-header-color: $gray-light !default;
-
-//** Deprecated `$dropdown-caret-color` as of v3.1.0
-$dropdown-caret-color: #000 !default;
-
-
-//-- Z-index master list
-//
-// Warning: Avoid customizing these values. They're used for a bird's eye view
-// of components dependent on the z-axis and are designed to all work together.
-//
-// Note: These variables are not generated into the Customizer.
-
-$zindex-navbar: 1000 !default;
-$zindex-dropdown: 1000 !default;
-$zindex-popover: 1060 !default;
-$zindex-tooltip: 1070 !default;
-$zindex-navbar-fixed: 1030 !default;
-$zindex-modal-background: 1040 !default;
-$zindex-modal: 1050 !default;
-
-
-//== Media queries breakpoints
-//
-//## Define the breakpoints at which your layout will change, adapting to different screen sizes.
-
-// Extra small screen / phone
-//** Deprecated `$screen-xs` as of v3.0.1
-$screen-xs: 480px !default;
-//** Deprecated `$screen-xs-min` as of v3.2.0
-$screen-xs-min: $screen-xs !default;
-//** Deprecated `$screen-phone` as of v3.0.1
-$screen-phone: $screen-xs-min !default;
-
-// Small screen / tablet
-//** Deprecated `$screen-sm` as of v3.0.1
-$screen-sm: 768px !default;
-$screen-sm-min: $screen-sm !default;
-//** Deprecated `$screen-tablet` as of v3.0.1
-$screen-tablet: $screen-sm-min !default;
-
-// Medium screen / desktop
-//** Deprecated `$screen-md` as of v3.0.1
-$screen-md: 992px !default;
-$screen-md-min: $screen-md !default;
-//** Deprecated `$screen-desktop` as of v3.0.1
-$screen-desktop: $screen-md-min !default;
-
-// Large screen / wide desktop
-//** Deprecated `$screen-lg` as of v3.0.1
-$screen-lg: 1200px !default;
-$screen-lg-min: $screen-lg !default;
-//** Deprecated `$screen-lg-desktop` as of v3.0.1
-$screen-lg-desktop: $screen-lg-min !default;
-
-// So media queries don't overlap when required, provide a maximum
-$screen-xs-max: ($screen-sm-min - 1) !default;
-$screen-sm-max: ($screen-md-min - 1) !default;
-$screen-md-max: ($screen-lg-min - 1) !default;
-
-
-//== Grid system
-//
-//## Define your custom responsive grid.
-
-//** Number of columns in the grid.
-$grid-columns: 12 !default;
-//** Padding between columns. Gets divided in half for the left and right.
-$grid-gutter-width: 30px !default;
-// Navbar collapse
-//** Point at which the navbar becomes uncollapsed.
-$grid-float-breakpoint: $screen-sm-min !default;
-//** Point at which the navbar begins collapsing.
-$grid-float-breakpoint-max: ($grid-float-breakpoint - 1) !default;
-
-
-//== Container sizes
-//
-//## Define the maximum width of `.container` for different screen sizes.
-
-// Small screen / tablet
-$container-tablet: (720px + $grid-gutter-width) !default;
-//** For `$screen-sm-min` and up.
-$container-sm: $container-tablet !default;
-
-// Medium screen / desktop
-$container-desktop: (940px + $grid-gutter-width) !default;
-//** For `$screen-md-min` and up.
-$container-md: $container-desktop !default;
-
-// Large screen / wide desktop
-$container-large-desktop: (1140px + $grid-gutter-width) !default;
-//** For `$screen-lg-min` and up.
-$container-lg: $container-large-desktop !default;
-
-
-//== Navbar
-//
-//##
-
-// Basics of a navbar
-$navbar-height: 50px !default;
-$navbar-margin-bottom: $line-height-computed !default;
-$navbar-border-radius: $border-radius-base !default;
-$navbar-padding-horizontal: floor(($grid-gutter-width / 2)) !default;
-$navbar-padding-vertical: (($navbar-height - $line-height-computed) / 2) !default;
-$navbar-collapse-max-height: 340px !default;
-
-$navbar-default-color: #777 !default;
-$navbar-default-bg: #f8f8f8 !default;
-$navbar-default-border: darken($navbar-default-bg, 6.5%) !default;
-
-// Navbar links
-$navbar-default-link-color: #777 !default;
-$navbar-default-link-hover-color: #333 !default;
-$navbar-default-link-hover-bg: transparent !default;
-$navbar-default-link-active-color: #555 !default;
-$navbar-default-link-active-bg: darken($navbar-default-bg, 6.5%) !default;
-$navbar-default-link-disabled-color: #ccc !default;
-$navbar-default-link-disabled-bg: transparent !default;
-
-// Navbar brand label
-$navbar-default-brand-color: $navbar-default-link-color !default;
-$navbar-default-brand-hover-color: darken($navbar-default-brand-color, 10%) !default;
-$navbar-default-brand-hover-bg: transparent !default;
-
-// Navbar toggle
-$navbar-default-toggle-hover-bg: #ddd !default;
-$navbar-default-toggle-icon-bar-bg: #888 !default;
-$navbar-default-toggle-border-color: #ddd !default;
-
-
-//=== Inverted navbar
-// Reset inverted navbar basics
-$navbar-inverse-color: lighten($gray-light, 15%) !default;
-$navbar-inverse-bg: #222 !default;
-$navbar-inverse-border: darken($navbar-inverse-bg, 10%) !default;
-
-// Inverted navbar links
-$navbar-inverse-link-color: lighten($gray-light, 15%) !default;
-$navbar-inverse-link-hover-color: #fff !default;
-$navbar-inverse-link-hover-bg: transparent !default;
-$navbar-inverse-link-active-color: $navbar-inverse-link-hover-color !default;
-$navbar-inverse-link-active-bg: darken($navbar-inverse-bg, 10%) !default;
-$navbar-inverse-link-disabled-color: #444 !default;
-$navbar-inverse-link-disabled-bg: transparent !default;
-
-// Inverted navbar brand label
-$navbar-inverse-brand-color: $navbar-inverse-link-color !default;
-$navbar-inverse-brand-hover-color: #fff !default;
-$navbar-inverse-brand-hover-bg: transparent !default;
-
-// Inverted navbar toggle
-$navbar-inverse-toggle-hover-bg: #333 !default;
-$navbar-inverse-toggle-icon-bar-bg: #fff !default;
-$navbar-inverse-toggle-border-color: #333 !default;
-
-
-//== Navs
-//
-//##
-
-//=== Shared nav styles
-$nav-link-padding: 10px 15px !default;
-$nav-link-hover-bg: $gray-lighter !default;
-
-$nav-disabled-link-color: $gray-light !default;
-$nav-disabled-link-hover-color: $gray-light !default;
-
-//== Tabs
-$nav-tabs-border-color: #ddd !default;
-
-$nav-tabs-link-hover-border-color: $gray-lighter !default;
-
-$nav-tabs-active-link-hover-bg: $body-bg !default;
-$nav-tabs-active-link-hover-color: $gray !default;
-$nav-tabs-active-link-hover-border-color: #ddd !default;
-
-$nav-tabs-justified-link-border-color: #ddd !default;
-$nav-tabs-justified-active-link-border-color: $body-bg !default;
-
-//== Pills
-$nav-pills-border-radius: $border-radius-base !default;
-$nav-pills-active-link-hover-bg: $component-active-bg !default;
-$nav-pills-active-link-hover-color: $component-active-color !default;
-
-
-//== Pagination
-//
-//##
-
-$pagination-color: $link-color !default;
-$pagination-bg: #fff !default;
-$pagination-border: #ddd !default;
-
-$pagination-hover-color: $link-hover-color !default;
-$pagination-hover-bg: $gray-lighter !default;
-$pagination-hover-border: #ddd !default;
-
-$pagination-active-color: #fff !default;
-$pagination-active-bg: $brand-primary !default;
-$pagination-active-border: $brand-primary !default;
-
-$pagination-disabled-color: $gray-light !default;
-$pagination-disabled-bg: #fff !default;
-$pagination-disabled-border: #ddd !default;
-
-
-//== Pager
-//
-//##
-
-$pager-bg: $pagination-bg !default;
-$pager-border: $pagination-border !default;
-$pager-border-radius: 15px !default;
-
-$pager-hover-bg: $pagination-hover-bg !default;
-
-$pager-active-bg: $pagination-active-bg !default;
-$pager-active-color: $pagination-active-color !default;
-
-$pager-disabled-color: $pagination-disabled-color !default;
-
-
-//== Jumbotron
-//
-//##
-
-$jumbotron-padding: 30px !default;
-$jumbotron-color: inherit !default;
-$jumbotron-bg: $gray-lighter !default;
-$jumbotron-heading-color: inherit !default;
-$jumbotron-font-size: ceil(($font-size-base * 1.5)) !default;
-$jumbotron-heading-font-size: ceil(($font-size-base * 4.5)) !default;
-
-
-//== Form states and alerts
-//
-//## Define colors for form feedback states and, by default, alerts.
-
-$state-success-text: #3c763d !default;
-$state-success-bg: #dff0d8 !default;
-$state-success-border: darken(adjust-hue($state-success-bg, -10), 5%) !default;
-
-$state-info-text: #31708f !default;
-$state-info-bg: #d9edf7 !default;
-$state-info-border: darken(adjust-hue($state-info-bg, -10), 7%) !default;
-
-$state-warning-text: #8a6d3b !default;
-$state-warning-bg: #fcf8e3 !default;
-$state-warning-border: darken(adjust-hue($state-warning-bg, -10), 5%) !default;
-
-$state-danger-text: #a94442 !default;
-$state-danger-bg: #f2dede !default;
-$state-danger-border: darken(adjust-hue($state-danger-bg, -10), 5%) !default;
-
-
-//== Tooltips
-//
-//##
-
-//** Tooltip max width
-$tooltip-max-width: 200px !default;
-//** Tooltip text color
-$tooltip-color: #fff !default;
-//** Tooltip background color
-$tooltip-bg: #000 !default;
-$tooltip-opacity: .9 !default;
-
-//** Tooltip arrow width
-$tooltip-arrow-width: 5px !default;
-//** Tooltip arrow color
-$tooltip-arrow-color: $tooltip-bg !default;
-
-
-//== Popovers
-//
-//##
-
-//** Popover body background color
-$popover-bg: #fff !default;
-//** Popover maximum width
-$popover-max-width: 276px !default;
-//** Popover border color
-$popover-border-color: rgba(0,0,0,.2) !default;
-//** Popover fallback border color
-$popover-fallback-border-color: #ccc !default;
-
-//** Popover title background color
-$popover-title-bg: darken($popover-bg, 3%) !default;
-
-//** Popover arrow width
-$popover-arrow-width: 10px !default;
-//** Popover arrow color
-$popover-arrow-color: $popover-bg !default;
-
-//** Popover outer arrow width
-$popover-arrow-outer-width: ($popover-arrow-width + 1) !default;
-//** Popover outer arrow color
-$popover-arrow-outer-color: fade_in($popover-border-color, 0.05) !default;
-//** Popover outer arrow fallback color
-$popover-arrow-outer-fallback-color: darken($popover-fallback-border-color, 20%) !default;
-
-
-//== Labels
-//
-//##
-
-//** Default label background color
-$label-default-bg: $gray-light !default;
-//** Primary label background color
-$label-primary-bg: $brand-primary !default;
-//** Success label background color
-$label-success-bg: $brand-success !default;
-//** Info label background color
-$label-info-bg: $brand-info !default;
-//** Warning label background color
-$label-warning-bg: $brand-warning !default;
-//** Danger label background color
-$label-danger-bg: $brand-danger !default;
-
-//** Default label text color
-$label-color: #fff !default;
-//** Default text color of a linked label
-$label-link-hover-color: #fff !default;
-
-
-//== Modals
-//
-//##
-
-//** Padding applied to the modal body
-$modal-inner-padding: 15px !default;
-
-//** Padding applied to the modal title
-$modal-title-padding: 15px !default;
-//** Modal title line-height
-$modal-title-line-height: $line-height-base !default;
-
-//** Background color of modal content area
-$modal-content-bg: #fff !default;
-//** Modal content border color
-$modal-content-border-color: rgba(0,0,0,.2) !default;
-//** Modal content border color **for IE8**
-$modal-content-fallback-border-color: #999 !default;
-
-//** Modal backdrop background color
-$modal-backdrop-bg: #000 !default;
-//** Modal backdrop opacity
-$modal-backdrop-opacity: .5 !default;
-//** Modal header border color
-$modal-header-border-color: #e5e5e5 !default;
-//** Modal footer border color
-$modal-footer-border-color: $modal-header-border-color !default;
-
-$modal-lg: 900px !default;
-$modal-md: 600px !default;
-$modal-sm: 300px !default;
-
-
-//== Alerts
-//
-//## Define alert colors, border radius, and padding.
-
-$alert-padding: 15px !default;
-$alert-border-radius: $border-radius-base !default;
-$alert-link-font-weight: bold !default;
-
-$alert-success-bg: $state-success-bg !default;
-$alert-success-text: $state-success-text !default;
-$alert-success-border: $state-success-border !default;
-
-$alert-info-bg: $state-info-bg !default;
-$alert-info-text: $state-info-text !default;
-$alert-info-border: $state-info-border !default;
-
-$alert-warning-bg: $state-warning-bg !default;
-$alert-warning-text: $state-warning-text !default;
-$alert-warning-border: $state-warning-border !default;
-
-$alert-danger-bg: $state-danger-bg !default;
-$alert-danger-text: $state-danger-text !default;
-$alert-danger-border: $state-danger-border !default;
-
-
-//== Progress bars
-//
-//##
-
-//** Background color of the whole progress component
-$progress-bg: #f5f5f5 !default;
-//** Progress bar text color
-$progress-bar-color: #fff !default;
-//** Variable for setting rounded corners on progress bar.
-$progress-border-radius: $border-radius-base !default;
-
-//** Default progress bar color
-$progress-bar-bg: $brand-primary !default;
-//** Success progress bar color
-$progress-bar-success-bg: $brand-success !default;
-//** Warning progress bar color
-$progress-bar-warning-bg: $brand-warning !default;
-//** Danger progress bar color
-$progress-bar-danger-bg: $brand-danger !default;
-//** Info progress bar color
-$progress-bar-info-bg: $brand-info !default;
-
-
-//== List group
-//
-//##
-
-//** Background color on `.list-group-item`
-$list-group-bg: #fff !default;
-//** `.list-group-item` border color
-$list-group-border: #ddd !default;
-//** List group border radius
-$list-group-border-radius: $border-radius-base !default;
-
-//** Background color of single list items on hover
-$list-group-hover-bg: #f5f5f5 !default;
-//** Text color of active list items
-$list-group-active-color: $component-active-color !default;
-//** Background color of active list items
-$list-group-active-bg: $component-active-bg !default;
-//** Border color of active list elements
-$list-group-active-border: $list-group-active-bg !default;
-//** Text color for content within active list items
-$list-group-active-text-color: lighten($list-group-active-bg, 40%) !default;
-
-//** Text color of disabled list items
-$list-group-disabled-color: $gray-light !default;
-//** Background color of disabled list items
-$list-group-disabled-bg: $gray-lighter !default;
-//** Text color for content within disabled list items
-$list-group-disabled-text-color: $list-group-disabled-color !default;
-
-$list-group-link-color: #555 !default;
-$list-group-link-hover-color: $list-group-link-color !default;
-$list-group-link-heading-color: #333 !default;
-
-
-//== Panels
-//
-//##
-
-$panel-bg: #fff !default;
-$panel-body-padding: 15px !default;
-$panel-heading-padding: 10px 15px !default;
-$panel-footer-padding: $panel-heading-padding !default;
-$panel-border-radius: $border-radius-base !default;
-
-//** Border color for elements within panels
-$panel-inner-border: #ddd !default;
-$panel-footer-bg: #f5f5f5 !default;
-
-$panel-default-text: $gray-dark !default;
-$panel-default-border: #ddd !default;
-$panel-default-heading-bg: #f5f5f5 !default;
-
-$panel-primary-text: #fff !default;
-$panel-primary-border: $brand-primary !default;
-$panel-primary-heading-bg: $brand-primary !default;
-
-$panel-success-text: $state-success-text !default;
-$panel-success-border: $state-success-border !default;
-$panel-success-heading-bg: $state-success-bg !default;
-
-$panel-info-text: $state-info-text !default;
-$panel-info-border: $state-info-border !default;
-$panel-info-heading-bg: $state-info-bg !default;
-
-$panel-warning-text: $state-warning-text !default;
-$panel-warning-border: $state-warning-border !default;
-$panel-warning-heading-bg: $state-warning-bg !default;
-
-$panel-danger-text: $state-danger-text !default;
-$panel-danger-border: $state-danger-border !default;
-$panel-danger-heading-bg: $state-danger-bg !default;
-
-
-//== Thumbnails
-//
-//##
-
-//** Padding around the thumbnail image
-$thumbnail-padding: 4px !default;
-//** Thumbnail background color
-$thumbnail-bg: $body-bg !default;
-//** Thumbnail border color
-$thumbnail-border: #ddd !default;
-//** Thumbnail border radius
-$thumbnail-border-radius: $border-radius-base !default;
-
-//** Custom text color for thumbnail captions
-$thumbnail-caption-color: $text-color !default;
-//** Padding around the thumbnail caption
-$thumbnail-caption-padding: 9px !default;
-
-
-//== Wells
-//
-//##
-
-$well-bg: #f5f5f5 !default;
-$well-border: darken($well-bg, 7%) !default;
-
-
-//== Badges
-//
-//##
-
-$badge-color: #fff !default;
-//** Linked badge text color on hover
-$badge-link-hover-color: #fff !default;
-$badge-bg: $gray-light !default;
-
-//** Badge text color in active nav link
-$badge-active-color: $link-color !default;
-//** Badge background color in active nav link
-$badge-active-bg: #fff !default;
-
-$badge-font-weight: bold !default;
-$badge-line-height: 1 !default;
-$badge-border-radius: 10px !default;
-
-
-//== Breadcrumbs
-//
-//##
-
-$breadcrumb-padding-vertical: 8px !default;
-$breadcrumb-padding-horizontal: 15px !default;
-//** Breadcrumb background color
-$breadcrumb-bg: #f5f5f5 !default;
-//** Breadcrumb text color
-$breadcrumb-color: #ccc !default;
-//** Text color of current page in the breadcrumb
-$breadcrumb-active-color: $gray-light !default;
-//** Textual separator for between breadcrumb elements
-$breadcrumb-separator: "/" !default;
-
-
-//== Carousel
-//
-//##
-
-$carousel-text-shadow: 0 1px 2px rgba(0,0,0,.6) !default;
-
-$carousel-control-color: #fff !default;
-$carousel-control-width: 15% !default;
-$carousel-control-opacity: .5 !default;
-$carousel-control-font-size: 20px !default;
-
-$carousel-indicator-active-bg: #fff !default;
-$carousel-indicator-border-color: #fff !default;
-
-$carousel-caption-color: #fff !default;
-
-
-//== Close
-//
-//##
-
-$close-font-weight: bold !default;
-$close-color: #000 !default;
-$close-text-shadow: 0 1px 0 #fff !default;
-
-
-//== Code
-//
-//##
-
-$code-color: #c7254e !default;
-$code-bg: #f9f2f4 !default;
-
-$kbd-color: #fff !default;
-$kbd-bg: #333 !default;
-
-$pre-bg: #f5f5f5 !default;
-$pre-color: $gray-dark !default;
-$pre-border-color: #ccc !default;
-$pre-scrollable-max-height: 340px !default;
-
-
-//== Type
-//
-//##
-
-//** Horizontal offset for forms and lists.
-$component-offset-horizontal: 180px !default;
-//** Text muted color
-$text-muted: $gray-light !default;
-//** Abbreviations and acronyms border color
-$abbr-border-color: $gray-light !default;
-//** Headings small color
-$headings-small-color: $gray-light !default;
-//** Blockquote small color
-$blockquote-small-color: $gray-light !default;
-//** Blockquote font size
-$blockquote-font-size: ($font-size-base * 1.25) !default;
-//** Blockquote border color
-$blockquote-border-color: $gray-lighter !default;
-//** Page header border color
-$page-header-border-color: $gray-lighter !default;
-//** Width of horizontal description list titles
-$dl-horizontal-offset: $component-offset-horizontal !default;
-//** Point at which .dl-horizontal becomes horizontal
-$dl-horizontal-breakpoint: $grid-float-breakpoint !default;
-//** Horizontal line color.
-$hr-border: $gray-lighter !default;
diff --git a/assets/sass/bootstrap/bootstrap/_wells.scss b/assets/sass/bootstrap/bootstrap/_wells.scss
deleted file mode 100644
index b865711..0000000
--- a/assets/sass/bootstrap/bootstrap/_wells.scss
+++ /dev/null
@@ -1,29 +0,0 @@
-//
-// Wells
-// --------------------------------------------------
-
-
-// Base class
-.well {
- min-height: 20px;
- padding: 19px;
- margin-bottom: 20px;
- background-color: $well-bg;
- border: 1px solid $well-border;
- border-radius: $border-radius-base;
- @include box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
- blockquote {
- border-color: #ddd;
- border-color: rgba(0,0,0,.15);
- }
-}
-
-// Sizes
-.well-lg {
- padding: 24px;
- border-radius: $border-radius-large;
-}
-.well-sm {
- padding: 9px;
- border-radius: $border-radius-small;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_alerts.scss b/assets/sass/bootstrap/bootstrap/mixins/_alerts.scss
deleted file mode 100644
index 3faf0b5..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_alerts.scss
+++ /dev/null
@@ -1,14 +0,0 @@
-// Alerts
-
-@mixin alert-variant($background, $border, $text-color) {
- background-color: $background;
- border-color: $border;
- color: $text-color;
-
- hr {
- border-top-color: darken($border, 5%);
- }
- .alert-link {
- color: darken($text-color, 10%);
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_background-variant.scss b/assets/sass/bootstrap/bootstrap/mixins/_background-variant.scss
deleted file mode 100644
index 4c7769e..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_background-variant.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-// Contextual backgrounds
-
-// [converter] $parent hack
-@mixin bg-variant($parent, $color) {
- #{$parent} {
- background-color: $color;
- }
- a#{$parent}:hover,
- a#{$parent}:focus {
- background-color: darken($color, 10%);
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_border-radius.scss b/assets/sass/bootstrap/bootstrap/mixins/_border-radius.scss
deleted file mode 100644
index ce19499..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_border-radius.scss
+++ /dev/null
@@ -1,18 +0,0 @@
-// Single side border-radius
-
-@mixin border-top-radius($radius) {
- border-top-right-radius: $radius;
- border-top-left-radius: $radius;
-}
-@mixin border-right-radius($radius) {
- border-bottom-right-radius: $radius;
- border-top-right-radius: $radius;
-}
-@mixin border-bottom-radius($radius) {
- border-bottom-right-radius: $radius;
- border-bottom-left-radius: $radius;
-}
-@mixin border-left-radius($radius) {
- border-bottom-left-radius: $radius;
- border-top-left-radius: $radius;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_buttons.scss b/assets/sass/bootstrap/bootstrap/mixins/_buttons.scss
deleted file mode 100644
index b93f84b..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_buttons.scss
+++ /dev/null
@@ -1,65 +0,0 @@
-// Button variants
-//
-// Easily pump out default styles, as well as :hover, :focus, :active,
-// and disabled options for all buttons
-
-@mixin button-variant($color, $background, $border) {
- color: $color;
- background-color: $background;
- border-color: $border;
-
- &:focus,
- &.focus {
- color: $color;
- background-color: darken($background, 10%);
- border-color: darken($border, 25%);
- }
- &:hover {
- color: $color;
- background-color: darken($background, 10%);
- border-color: darken($border, 12%);
- }
- &:active,
- &.active,
- .open > &.dropdown-toggle {
- color: $color;
- background-color: darken($background, 10%);
- border-color: darken($border, 12%);
-
- &:hover,
- &:focus,
- &.focus {
- color: $color;
- background-color: darken($background, 17%);
- border-color: darken($border, 25%);
- }
- }
- &:active,
- &.active,
- .open > &.dropdown-toggle {
- background-image: none;
- }
- &.disabled,
- &[disabled],
- fieldset[disabled] & {
- &:hover,
- &:focus,
- &.focus {
- background-color: $background;
- border-color: $border;
- }
- }
-
- .badge {
- color: $background;
- background-color: $color;
- }
-}
-
-// Button sizes
-@mixin button-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
- padding: $padding-vertical $padding-horizontal;
- font-size: $font-size;
- line-height: $line-height;
- border-radius: $border-radius;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_center-block.scss b/assets/sass/bootstrap/bootstrap/mixins/_center-block.scss
deleted file mode 100644
index e06fb5e..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_center-block.scss
+++ /dev/null
@@ -1,7 +0,0 @@
-// Center-align a block level element
-
-@mixin center-block() {
- display: block;
- margin-left: auto;
- margin-right: auto;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_clearfix.scss b/assets/sass/bootstrap/bootstrap/mixins/_clearfix.scss
deleted file mode 100644
index dc3e2ab..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_clearfix.scss
+++ /dev/null
@@ -1,22 +0,0 @@
-// Clearfix
-//
-// For modern browsers
-// 1. The space content is one way to avoid an Opera bug when the
-// contenteditable attribute is included anywhere else in the document.
-// Otherwise it causes space to appear at the top and bottom of elements
-// that are clearfixed.
-// 2. The use of `table` rather than `block` is only necessary if using
-// `:before` to contain the top-margins of child elements.
-//
-// Source: http://nicolasgallagher.com/micro-clearfix-hack/
-
-@mixin clearfix() {
- &:before,
- &:after {
- content: " "; // 1
- display: table; // 2
- }
- &:after {
- clear: both;
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_forms.scss b/assets/sass/bootstrap/bootstrap/mixins/_forms.scss
deleted file mode 100644
index 277aa5f..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_forms.scss
+++ /dev/null
@@ -1,88 +0,0 @@
-// Form validation states
-//
-// Used in forms.less to generate the form validation CSS for warnings, errors,
-// and successes.
-
-@mixin form-control-validation($text-color: #555, $border-color: #ccc, $background-color: #f5f5f5) {
- // Color the label and help text
- .help-block,
- .control-label,
- .radio,
- .checkbox,
- .radio-inline,
- .checkbox-inline,
- &.radio label,
- &.checkbox label,
- &.radio-inline label,
- &.checkbox-inline label {
- color: $text-color;
- }
- // Set the border and box shadow on specific inputs to match
- .form-control {
- border-color: $border-color;
- @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work
- &:focus {
- border-color: darken($border-color, 10%);
- $shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten($border-color, 20%);
- @include box-shadow($shadow);
- }
- }
- // Set validation states also for addons
- .input-group-addon {
- color: $text-color;
- border-color: $border-color;
- background-color: $background-color;
- }
- // Optional feedback icon
- .form-control-feedback {
- color: $text-color;
- }
-}
-
-
-// Form control focus state
-//
-// Generate a customized focus state and for any input with the specified color,
-// which defaults to the `$input-border-focus` variable.
-//
-// We highly encourage you to not customize the default value, but instead use
-// this to tweak colors on an as-needed basis. This aesthetic change is based on
-// WebKit's default styles, but applicable to a wider range of browsers. Its
-// usability and accessibility should be taken into account with any change.
-//
-// Example usage: change the default blue border and shadow to white for better
-// contrast against a dark gray background.
-@mixin form-control-focus($color: $input-border-focus) {
- $color-rgba: rgba(red($color), green($color), blue($color), .6);
- &:focus {
- border-color: $color;
- outline: 0;
- @include box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px $color-rgba);
- }
-}
-
-// Form control sizing
-//
-// Relative text size, padding, and border-radii changes for form controls. For
-// horizontal sizing, wrap controls in the predefined grid classes. ``
-// element gets special love because it's special, and that's a fact!
-// [converter] $parent hack
-@mixin input-size($parent, $input-height, $padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
- #{$parent} {
- height: $input-height;
- padding: $padding-vertical $padding-horizontal;
- font-size: $font-size;
- line-height: $line-height;
- border-radius: $border-radius;
- }
-
- select#{$parent} {
- height: $input-height;
- line-height: $input-height;
- }
-
- textarea#{$parent},
- select[multiple]#{$parent} {
- height: auto;
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_gradients.scss b/assets/sass/bootstrap/bootstrap/mixins/_gradients.scss
deleted file mode 100644
index a8939f5..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_gradients.scss
+++ /dev/null
@@ -1,58 +0,0 @@
-// Gradients
-
-
-
-// Horizontal gradient, from left to right
-//
-// Creates two color stops, start and end, by specifying a color and position for each color stop.
-// Color stops are not available in IE9 and below.
-@mixin gradient-horizontal($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
- background-image: -webkit-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+
- background-image: -o-linear-gradient(left, $start-color $start-percent, $end-color $end-percent); // Opera 12
- background-image: linear-gradient(to right, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down
-}
-
-// Vertical gradient, from top to bottom
-//
-// Creates two color stops, start and end, by specifying a color and position for each color stop.
-// Color stops are not available in IE9 and below.
-@mixin gradient-vertical($start-color: #555, $end-color: #333, $start-percent: 0%, $end-percent: 100%) {
- background-image: -webkit-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Safari 5.1-6, Chrome 10+
- background-image: -o-linear-gradient(top, $start-color $start-percent, $end-color $end-percent); // Opera 12
- background-image: linear-gradient(to bottom, $start-color $start-percent, $end-color $end-percent); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
- background-repeat: repeat-x;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down
-}
-
-@mixin gradient-directional($start-color: #555, $end-color: #333, $deg: 45deg) {
- background-repeat: repeat-x;
- background-image: -webkit-linear-gradient($deg, $start-color, $end-color); // Safari 5.1-6, Chrome 10+
- background-image: -o-linear-gradient($deg, $start-color, $end-color); // Opera 12
- background-image: linear-gradient($deg, $start-color, $end-color); // Standard, IE10, Firefox 16+, Opera 12.10+, Safari 7+, Chrome 26+
-}
-@mixin gradient-horizontal-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
- background-image: -webkit-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
- background-image: -o-linear-gradient(left, $start-color, $mid-color $color-stop, $end-color);
- background-image: linear-gradient(to right, $start-color, $mid-color $color-stop, $end-color);
- background-repeat: no-repeat;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=1); // IE9 and down, gets no color-stop at all for proper fallback
-}
-@mixin gradient-vertical-three-colors($start-color: #00b3ee, $mid-color: #7a43b6, $color-stop: 50%, $end-color: #c3325f) {
- background-image: -webkit-linear-gradient($start-color, $mid-color $color-stop, $end-color);
- background-image: -o-linear-gradient($start-color, $mid-color $color-stop, $end-color);
- background-image: linear-gradient($start-color, $mid-color $color-stop, $end-color);
- background-repeat: no-repeat;
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#{ie-hex-str($start-color)}', endColorstr='#{ie-hex-str($end-color)}', GradientType=0); // IE9 and down, gets no color-stop at all for proper fallback
-}
-@mixin gradient-radial($inner-color: #555, $outer-color: #333) {
- background-image: -webkit-radial-gradient(circle, $inner-color, $outer-color);
- background-image: radial-gradient(circle, $inner-color, $outer-color);
- background-repeat: no-repeat;
-}
-@mixin gradient-striped($color: rgba(255,255,255,.15), $angle: 45deg) {
- background-image: -webkit-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
- background-image: -o-linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
- background-image: linear-gradient($angle, $color 25%, transparent 25%, transparent 50%, $color 50%, $color 75%, transparent 75%, transparent);
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_grid-framework.scss b/assets/sass/bootstrap/bootstrap/mixins/_grid-framework.scss
deleted file mode 100644
index 16d038c..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_grid-framework.scss
+++ /dev/null
@@ -1,81 +0,0 @@
-// Framework grid generation
-//
-// Used only by Bootstrap to generate the correct number of grid classes given
-// any value of `$grid-columns`.
-
-// [converter] This is defined recursively in LESS, but Sass supports real loops
-@mixin make-grid-columns($i: 1, $list: ".col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}") {
- @for $i from (1 + 1) through $grid-columns {
- $list: "#{$list}, .col-xs-#{$i}, .col-sm-#{$i}, .col-md-#{$i}, .col-lg-#{$i}";
- }
- #{$list} {
- position: relative;
- // Prevent columns from collapsing when empty
- min-height: 1px;
- // Inner gutter via padding
- padding-left: ceil(($grid-gutter-width / 2));
- padding-right: floor(($grid-gutter-width / 2));
- }
-}
-
-
-// [converter] This is defined recursively in LESS, but Sass supports real loops
-@mixin float-grid-columns($class, $i: 1, $list: ".col-#{$class}-#{$i}") {
- @for $i from (1 + 1) through $grid-columns {
- $list: "#{$list}, .col-#{$class}-#{$i}";
- }
- #{$list} {
- float: left;
- }
-}
-
-
-@mixin calc-grid-column($index, $class, $type) {
- @if ($type == width) and ($index > 0) {
- .col-#{$class}-#{$index} {
- width: percentage(($index / $grid-columns));
- }
- }
- @if ($type == push) and ($index > 0) {
- .col-#{$class}-push-#{$index} {
- left: percentage(($index / $grid-columns));
- }
- }
- @if ($type == push) and ($index == 0) {
- .col-#{$class}-push-0 {
- left: auto;
- }
- }
- @if ($type == pull) and ($index > 0) {
- .col-#{$class}-pull-#{$index} {
- right: percentage(($index / $grid-columns));
- }
- }
- @if ($type == pull) and ($index == 0) {
- .col-#{$class}-pull-0 {
- right: auto;
- }
- }
- @if ($type == offset) {
- .col-#{$class}-offset-#{$index} {
- margin-left: percentage(($index / $grid-columns));
- }
- }
-}
-
-// [converter] This is defined recursively in LESS, but Sass supports real loops
-@mixin loop-grid-columns($columns, $class, $type) {
- @for $i from 0 through $columns {
- @include calc-grid-column($i, $class, $type);
- }
-}
-
-
-// Create grid for specific class
-@mixin make-grid($class) {
- @include float-grid-columns($class);
- @include loop-grid-columns($grid-columns, $class, width);
- @include loop-grid-columns($grid-columns, $class, pull);
- @include loop-grid-columns($grid-columns, $class, push);
- @include loop-grid-columns($grid-columns, $class, offset);
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_grid.scss b/assets/sass/bootstrap/bootstrap/mixins/_grid.scss
deleted file mode 100644
index 59551da..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_grid.scss
+++ /dev/null
@@ -1,122 +0,0 @@
-// Grid system
-//
-// Generate semantic grid columns with these mixins.
-
-// Centered container element
-@mixin container-fixed($gutter: $grid-gutter-width) {
- margin-right: auto;
- margin-left: auto;
- padding-left: floor(($gutter / 2));
- padding-right: ceil(($gutter / 2));
- @include clearfix;
-}
-
-// Creates a wrapper for a series of columns
-@mixin make-row($gutter: $grid-gutter-width) {
- margin-left: ceil(($gutter / -2));
- margin-right: floor(($gutter / -2));
- @include clearfix;
-}
-
-// Generate the extra small columns
-@mixin make-xs-column($columns, $gutter: $grid-gutter-width) {
- position: relative;
- float: left;
- width: percentage(($columns / $grid-columns));
- min-height: 1px;
- padding-left: ($gutter / 2);
- padding-right: ($gutter / 2);
-}
-@mixin make-xs-column-offset($columns) {
- margin-left: percentage(($columns / $grid-columns));
-}
-@mixin make-xs-column-push($columns) {
- left: percentage(($columns / $grid-columns));
-}
-@mixin make-xs-column-pull($columns) {
- right: percentage(($columns / $grid-columns));
-}
-
-// Generate the small columns
-@mixin make-sm-column($columns, $gutter: $grid-gutter-width) {
- position: relative;
- min-height: 1px;
- padding-left: ($gutter / 2);
- padding-right: ($gutter / 2);
-
- @media (min-width: $screen-sm-min) {
- float: left;
- width: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-sm-column-offset($columns) {
- @media (min-width: $screen-sm-min) {
- margin-left: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-sm-column-push($columns) {
- @media (min-width: $screen-sm-min) {
- left: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-sm-column-pull($columns) {
- @media (min-width: $screen-sm-min) {
- right: percentage(($columns / $grid-columns));
- }
-}
-
-// Generate the medium columns
-@mixin make-md-column($columns, $gutter: $grid-gutter-width) {
- position: relative;
- min-height: 1px;
- padding-left: ($gutter / 2);
- padding-right: ($gutter / 2);
-
- @media (min-width: $screen-md-min) {
- float: left;
- width: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-md-column-offset($columns) {
- @media (min-width: $screen-md-min) {
- margin-left: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-md-column-push($columns) {
- @media (min-width: $screen-md-min) {
- left: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-md-column-pull($columns) {
- @media (min-width: $screen-md-min) {
- right: percentage(($columns / $grid-columns));
- }
-}
-
-// Generate the large columns
-@mixin make-lg-column($columns, $gutter: $grid-gutter-width) {
- position: relative;
- min-height: 1px;
- padding-left: ($gutter / 2);
- padding-right: ($gutter / 2);
-
- @media (min-width: $screen-lg-min) {
- float: left;
- width: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-lg-column-offset($columns) {
- @media (min-width: $screen-lg-min) {
- margin-left: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-lg-column-push($columns) {
- @media (min-width: $screen-lg-min) {
- left: percentage(($columns / $grid-columns));
- }
-}
-@mixin make-lg-column-pull($columns) {
- @media (min-width: $screen-lg-min) {
- right: percentage(($columns / $grid-columns));
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_hide-text.scss b/assets/sass/bootstrap/bootstrap/mixins/_hide-text.scss
deleted file mode 100644
index 1767e02..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_hide-text.scss
+++ /dev/null
@@ -1,21 +0,0 @@
-// CSS image replacement
-//
-// Heads up! v3 launched with only `.hide-text()`, but per our pattern for
-// mixins being reused as classes with the same name, this doesn't hold up. As
-// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`.
-//
-// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757
-
-// Deprecated as of v3.0.1 (has been removed in v4)
-@mixin hide-text() {
- font: 0/0 a;
- color: transparent;
- text-shadow: none;
- background-color: transparent;
- border: 0;
-}
-
-// New mixin to use as of v3.0.1
-@mixin text-hide() {
- @include hide-text;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_image.scss b/assets/sass/bootstrap/bootstrap/mixins/_image.scss
deleted file mode 100644
index c8dcf5e..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_image.scss
+++ /dev/null
@@ -1,33 +0,0 @@
-// Image Mixins
-// - Responsive image
-// - Retina image
-
-
-// Responsive image
-//
-// Keep images from scaling beyond the width of their parents.
-@mixin img-responsive($display: block) {
- display: $display;
- max-width: 100%; // Part 1: Set a maximum relative to the parent
- height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching
-}
-
-
-// Retina image
-//
-// Short retina mixin for setting background-image and -size. Note that the
-// spelling of `min--moz-device-pixel-ratio` is intentional.
-@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {
- background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-1x}"), "#{$file-1x}"));
-
- @media
- only screen and (-webkit-min-device-pixel-ratio: 2),
- only screen and ( min--moz-device-pixel-ratio: 2),
- only screen and ( -o-min-device-pixel-ratio: 2/1),
- only screen and ( min-device-pixel-ratio: 2),
- only screen and ( min-resolution: 192dpi),
- only screen and ( min-resolution: 2dppx) {
- background-image: url(if($bootstrap-sass-asset-helper, twbs-image-path("#{$file-2x}"), "#{$file-2x}"));
- background-size: $width-1x $height-1x;
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_labels.scss b/assets/sass/bootstrap/bootstrap/mixins/_labels.scss
deleted file mode 100644
index eda6dfd..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_labels.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-// Labels
-
-@mixin label-variant($color) {
- background-color: $color;
-
- &[href] {
- &:hover,
- &:focus {
- background-color: darken($color, 10%);
- }
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_list-group.scss b/assets/sass/bootstrap/bootstrap/mixins/_list-group.scss
deleted file mode 100644
index c478eeb..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_list-group.scss
+++ /dev/null
@@ -1,32 +0,0 @@
-// List Groups
-
-@mixin list-group-item-variant($state, $background, $color) {
- .list-group-item-#{$state} {
- color: $color;
- background-color: $background;
-
- // [converter] extracted a&, button& to a.list-group-item-#{$state}, button.list-group-item-#{$state}
- }
-
- a.list-group-item-#{$state},
- button.list-group-item-#{$state} {
- color: $color;
-
- .list-group-item-heading {
- color: inherit;
- }
-
- &:hover,
- &:focus {
- color: $color;
- background-color: darken($background, 5%);
- }
- &.active,
- &.active:hover,
- &.active:focus {
- color: #fff;
- background-color: $color;
- border-color: $color;
- }
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_nav-divider.scss b/assets/sass/bootstrap/bootstrap/mixins/_nav-divider.scss
deleted file mode 100644
index 2e6da02..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_nav-divider.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-// Horizontal dividers
-//
-// Dividers (basically an hr) within dropdowns and nav lists
-
-@mixin nav-divider($color: #e5e5e5) {
- height: 1px;
- margin: (($line-height-computed / 2) - 1) 0;
- overflow: hidden;
- background-color: $color;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_nav-vertical-align.scss b/assets/sass/bootstrap/bootstrap/mixins/_nav-vertical-align.scss
deleted file mode 100644
index c8fbf1a..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_nav-vertical-align.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-// Navbar vertical align
-//
-// Vertically center elements in the navbar.
-// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin.
-
-@mixin navbar-vertical-align($element-height) {
- margin-top: (($navbar-height - $element-height) / 2);
- margin-bottom: (($navbar-height - $element-height) / 2);
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_opacity.scss b/assets/sass/bootstrap/bootstrap/mixins/_opacity.scss
deleted file mode 100644
index 88e9a57..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_opacity.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-// Opacity
-
-@mixin opacity($opacity) {
- opacity: $opacity;
- // IE8 filter
- $opacity-ie: ($opacity * 100);
- filter: alpha(opacity=$opacity-ie);
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_pagination.scss b/assets/sass/bootstrap/bootstrap/mixins/_pagination.scss
deleted file mode 100644
index d4a5404..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_pagination.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-// Pagination
-
-@mixin pagination-size($padding-vertical, $padding-horizontal, $font-size, $line-height, $border-radius) {
- > li {
- > a,
- > span {
- padding: $padding-vertical $padding-horizontal;
- font-size: $font-size;
- line-height: $line-height;
- }
- &:first-child {
- > a,
- > span {
- @include border-left-radius($border-radius);
- }
- }
- &:last-child {
- > a,
- > span {
- @include border-right-radius($border-radius);
- }
- }
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_panels.scss b/assets/sass/bootstrap/bootstrap/mixins/_panels.scss
deleted file mode 100644
index 3ff31ae..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_panels.scss
+++ /dev/null
@@ -1,24 +0,0 @@
-// Panels
-
-@mixin panel-variant($border, $heading-text-color, $heading-bg-color, $heading-border) {
- border-color: $border;
-
- & > .panel-heading {
- color: $heading-text-color;
- background-color: $heading-bg-color;
- border-color: $heading-border;
-
- + .panel-collapse > .panel-body {
- border-top-color: $border;
- }
- .badge {
- color: $heading-bg-color;
- background-color: $heading-text-color;
- }
- }
- & > .panel-footer {
- + .panel-collapse > .panel-body {
- border-bottom-color: $border;
- }
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_progress-bar.scss b/assets/sass/bootstrap/bootstrap/mixins/_progress-bar.scss
deleted file mode 100644
index 90a62af..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_progress-bar.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-// Progress bars
-
-@mixin progress-bar-variant($color) {
- background-color: $color;
-
- // Deprecated parent class requirement as of v3.2.0
- .progress-striped & {
- @include gradient-striped;
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_reset-filter.scss b/assets/sass/bootstrap/bootstrap/mixins/_reset-filter.scss
deleted file mode 100644
index bf73051..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_reset-filter.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-// Reset filters for IE
-//
-// When you need to remove a gradient background, do not forget to use this to reset
-// the IE filter for IE9 and below.
-
-@mixin reset-filter() {
- filter: progid:DXImageTransform.Microsoft.gradient(enabled = false);
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_reset-text.scss b/assets/sass/bootstrap/bootstrap/mixins/_reset-text.scss
deleted file mode 100644
index c9c2841..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_reset-text.scss
+++ /dev/null
@@ -1,18 +0,0 @@
-@mixin reset-text() {
- font-family: $font-family-base;
- // We deliberately do NOT reset font-size.
- font-style: normal;
- font-weight: normal;
- letter-spacing: normal;
- line-break: auto;
- line-height: $line-height-base;
- text-align: left; // Fallback for where `start` is not supported
- text-align: start;
- text-decoration: none;
- text-shadow: none;
- text-transform: none;
- white-space: normal;
- word-break: normal;
- word-spacing: normal;
- word-wrap: normal;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_resize.scss b/assets/sass/bootstrap/bootstrap/mixins/_resize.scss
deleted file mode 100644
index 83fa637..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_resize.scss
+++ /dev/null
@@ -1,6 +0,0 @@
-// Resize anything
-
-@mixin resizable($direction) {
- resize: $direction; // Options: horizontal, vertical, both
- overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible`
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_responsive-visibility.scss b/assets/sass/bootstrap/bootstrap/mixins/_responsive-visibility.scss
deleted file mode 100644
index cbdf777..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_responsive-visibility.scss
+++ /dev/null
@@ -1,21 +0,0 @@
-// Responsive utilities
-
-//
-// More easily include all the states for responsive-utilities.less.
-// [converter] $parent hack
-@mixin responsive-visibility($parent) {
- #{$parent} {
- display: block !important;
- }
- table#{$parent} { display: table !important; }
- tr#{$parent} { display: table-row !important; }
- th#{$parent},
- td#{$parent} { display: table-cell !important; }
-}
-
-// [converter] $parent hack
-@mixin responsive-invisibility($parent) {
- #{$parent} {
- display: none !important;
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_size.scss b/assets/sass/bootstrap/bootstrap/mixins/_size.scss
deleted file mode 100644
index abbe246..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_size.scss
+++ /dev/null
@@ -1,10 +0,0 @@
-// Sizing shortcuts
-
-@mixin size($width, $height) {
- width: $width;
- height: $height;
-}
-
-@mixin square($size) {
- @include size($size, $size);
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_tab-focus.scss b/assets/sass/bootstrap/bootstrap/mixins/_tab-focus.scss
deleted file mode 100644
index f16ed64..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_tab-focus.scss
+++ /dev/null
@@ -1,9 +0,0 @@
-// WebKit-style focus
-
-@mixin tab-focus() {
- // WebKit-specific. Other browsers will keep their default outline style.
- // (Initially tried to also force default via `outline: initial`,
- // but that seems to erroneously remove the outline in Firefox altogether.)
- outline: 5px auto -webkit-focus-ring-color;
- outline-offset: -2px;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_table-row.scss b/assets/sass/bootstrap/bootstrap/mixins/_table-row.scss
deleted file mode 100644
index 1367950..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_table-row.scss
+++ /dev/null
@@ -1,28 +0,0 @@
-// Tables
-
-@mixin table-row-variant($state, $background) {
- // Exact selectors below required to override `.table-striped` and prevent
- // inheritance to nested tables.
- .table > thead > tr,
- .table > tbody > tr,
- .table > tfoot > tr {
- > td.#{$state},
- > th.#{$state},
- &.#{$state} > td,
- &.#{$state} > th {
- background-color: $background;
- }
- }
-
- // Hover states for `.table-hover`
- // Note: this is not available for cells or rows within `thead` or `tfoot`.
- .table-hover > tbody > tr {
- > td.#{$state}:hover,
- > th.#{$state}:hover,
- &.#{$state}:hover > td,
- &:hover > .#{$state},
- &.#{$state}:hover > th {
- background-color: darken($background, 5%);
- }
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_text-emphasis.scss b/assets/sass/bootstrap/bootstrap/mixins/_text-emphasis.scss
deleted file mode 100644
index 3b446c4..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_text-emphasis.scss
+++ /dev/null
@@ -1,12 +0,0 @@
-// Typography
-
-// [converter] $parent hack
-@mixin text-emphasis-variant($parent, $color) {
- #{$parent} {
- color: $color;
- }
- a#{$parent}:hover,
- a#{$parent}:focus {
- color: darken($color, 10%);
- }
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_text-overflow.scss b/assets/sass/bootstrap/bootstrap/mixins/_text-overflow.scss
deleted file mode 100644
index 1593b25..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_text-overflow.scss
+++ /dev/null
@@ -1,8 +0,0 @@
-// Text overflow
-// Requires inline-block or block for proper styling
-
-@mixin text-overflow() {
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
-}
diff --git a/assets/sass/bootstrap/bootstrap/mixins/_vendor-prefixes.scss b/assets/sass/bootstrap/bootstrap/mixins/_vendor-prefixes.scss
deleted file mode 100644
index b3d0371..0000000
--- a/assets/sass/bootstrap/bootstrap/mixins/_vendor-prefixes.scss
+++ /dev/null
@@ -1,222 +0,0 @@
-// Vendor Prefixes
-//
-// All vendor mixins are deprecated as of v3.2.0 due to the introduction of
-// Autoprefixer in our Gruntfile. They have been removed in v4.
-
-// - Animations
-// - Backface visibility
-// - Box shadow
-// - Box sizing
-// - Content columns
-// - Hyphens
-// - Placeholder text
-// - Transformations
-// - Transitions
-// - User Select
-
-
-// Animations
-@mixin animation($animation) {
- -webkit-animation: $animation;
- -o-animation: $animation;
- animation: $animation;
-}
-@mixin animation-name($name) {
- -webkit-animation-name: $name;
- animation-name: $name;
-}
-@mixin animation-duration($duration) {
- -webkit-animation-duration: $duration;
- animation-duration: $duration;
-}
-@mixin animation-timing-function($timing-function) {
- -webkit-animation-timing-function: $timing-function;
- animation-timing-function: $timing-function;
-}
-@mixin animation-delay($delay) {
- -webkit-animation-delay: $delay;
- animation-delay: $delay;
-}
-@mixin animation-iteration-count($iteration-count) {
- -webkit-animation-iteration-count: $iteration-count;
- animation-iteration-count: $iteration-count;
-}
-@mixin animation-direction($direction) {
- -webkit-animation-direction: $direction;
- animation-direction: $direction;
-}
-@mixin animation-fill-mode($fill-mode) {
- -webkit-animation-fill-mode: $fill-mode;
- animation-fill-mode: $fill-mode;
-}
-
-// Backface visibility
-// Prevent browsers from flickering when using CSS 3D transforms.
-// Default value is `visible`, but can be changed to `hidden`
-
-@mixin backface-visibility($visibility) {
- -webkit-backface-visibility: $visibility;
- -moz-backface-visibility: $visibility;
- backface-visibility: $visibility;
-}
-
-// Drop shadows
-//
-// Note: Deprecated `.box-shadow()` as of v3.1.0 since all of Bootstrap's
-// supported browsers that have box shadow capabilities now support it.
-
-@mixin box-shadow($shadow...) {
- -webkit-box-shadow: $shadow; // iOS <4.3 & Android <4.1
- box-shadow: $shadow;
-}
-
-// Box sizing
-@mixin box-sizing($boxmodel) {
- -webkit-box-sizing: $boxmodel;
- -moz-box-sizing: $boxmodel;
- box-sizing: $boxmodel;
-}
-
-// CSS3 Content Columns
-@mixin content-columns($column-count, $column-gap: $grid-gutter-width) {
- -webkit-column-count: $column-count;
- -moz-column-count: $column-count;
- column-count: $column-count;
- -webkit-column-gap: $column-gap;
- -moz-column-gap: $column-gap;
- column-gap: $column-gap;
-}
-
-// Optional hyphenation
-@mixin hyphens($mode: auto) {
- word-wrap: break-word;
- -webkit-hyphens: $mode;
- -moz-hyphens: $mode;
- -ms-hyphens: $mode; // IE10+
- -o-hyphens: $mode;
- hyphens: $mode;
-}
-
-// Placeholder text
-@mixin placeholder($color: $input-color-placeholder) {
- // Firefox
- &::-moz-placeholder {
- color: $color;
- opacity: 1; // Override Firefox's unusual default opacity; see https://github.com/twbs/bootstrap/pull/11526
- }
- &:-ms-input-placeholder { color: $color; } // Internet Explorer 10+
- &::-webkit-input-placeholder { color: $color; } // Safari and Chrome
-}
-
-// Transformations
-@mixin scale($ratio...) {
- -webkit-transform: scale($ratio);
- -ms-transform: scale($ratio); // IE9 only
- -o-transform: scale($ratio);
- transform: scale($ratio);
-}
-
-@mixin scaleX($ratio) {
- -webkit-transform: scaleX($ratio);
- -ms-transform: scaleX($ratio); // IE9 only
- -o-transform: scaleX($ratio);
- transform: scaleX($ratio);
-}
-@mixin scaleY($ratio) {
- -webkit-transform: scaleY($ratio);
- -ms-transform: scaleY($ratio); // IE9 only
- -o-transform: scaleY($ratio);
- transform: scaleY($ratio);
-}
-@mixin skew($x, $y) {
- -webkit-transform: skewX($x) skewY($y);
- -ms-transform: skewX($x) skewY($y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+
- -o-transform: skewX($x) skewY($y);
- transform: skewX($x) skewY($y);
-}
-@mixin translate($x, $y) {
- -webkit-transform: translate($x, $y);
- -ms-transform: translate($x, $y); // IE9 only
- -o-transform: translate($x, $y);
- transform: translate($x, $y);
-}
-@mixin translate3d($x, $y, $z) {
- -webkit-transform: translate3d($x, $y, $z);
- transform: translate3d($x, $y, $z);
-}
-@mixin rotate($degrees) {
- -webkit-transform: rotate($degrees);
- -ms-transform: rotate($degrees); // IE9 only
- -o-transform: rotate($degrees);
- transform: rotate($degrees);
-}
-@mixin rotateX($degrees) {
- -webkit-transform: rotateX($degrees);
- -ms-transform: rotateX($degrees); // IE9 only
- -o-transform: rotateX($degrees);
- transform: rotateX($degrees);
-}
-@mixin rotateY($degrees) {
- -webkit-transform: rotateY($degrees);
- -ms-transform: rotateY($degrees); // IE9 only
- -o-transform: rotateY($degrees);
- transform: rotateY($degrees);
-}
-@mixin perspective($perspective) {
- -webkit-perspective: $perspective;
- -moz-perspective: $perspective;
- perspective: $perspective;
-}
-@mixin perspective-origin($perspective) {
- -webkit-perspective-origin: $perspective;
- -moz-perspective-origin: $perspective;
- perspective-origin: $perspective;
-}
-@mixin transform-origin($origin) {
- -webkit-transform-origin: $origin;
- -moz-transform-origin: $origin;
- -ms-transform-origin: $origin; // IE9 only
- transform-origin: $origin;
-}
-
-
-// Transitions
-
-@mixin transition($transition...) {
- -webkit-transition: $transition;
- -o-transition: $transition;
- transition: $transition;
-}
-@mixin transition-property($transition-property...) {
- -webkit-transition-property: $transition-property;
- transition-property: $transition-property;
-}
-@mixin transition-delay($transition-delay) {
- -webkit-transition-delay: $transition-delay;
- transition-delay: $transition-delay;
-}
-@mixin transition-duration($transition-duration...) {
- -webkit-transition-duration: $transition-duration;
- transition-duration: $transition-duration;
-}
-@mixin transition-timing-function($timing-function) {
- -webkit-transition-timing-function: $timing-function;
- transition-timing-function: $timing-function;
-}
-@mixin transition-transform($transition...) {
- -webkit-transition: -webkit-transform $transition;
- -moz-transition: -moz-transform $transition;
- -o-transition: -o-transform $transition;
- transition: transform $transition;
-}
-
-
-// User select
-// For selecting text on the page
-
-@mixin user-select($select) {
- -webkit-user-select: $select;
- -moz-user-select: $select;
- -ms-user-select: $select; // IE10+
- user-select: $select;
-}
diff --git a/assets/sass/editor-style.scss b/assets/sass/editor-style.scss
deleted file mode 100644
index 22b8330..0000000
--- a/assets/sass/editor-style.scss
+++ /dev/null
@@ -1,15 +0,0 @@
-// ==========================================================================
-// Style used to style the TinyMCE editor
-// ==========================================================================
-
-@import
- "variables", // Theme Custom Variables
- "bootstrap/bootstrap", // Bootstrap Styles Core
- "wordpress/wordpress" // WordPress Styles Core
-;
-
-// Custom Editor Styles
-// ==========================================================================
-body {
- padding: 10px;
-}
diff --git a/assets/sass/odin/_core.scss b/assets/sass/odin/_core.scss
deleted file mode 100644
index 5b32f69..0000000
--- a/assets/sass/odin/_core.scss
+++ /dev/null
@@ -1,52 +0,0 @@
-/* =Odin Core Styles
--------------------------------------------------------------- */
-
-/* Fix pagination */
-ul.page-numbers {
- @extend .pagination;
-
- > li > span.current {
-
- &,
- &:hover,
- &:focus {
- z-index: 2;
- color: $pagination-active-color;
- background-color: $pagination-active-bg;
- border-color: $pagination-active-bg;
- cursor: default;
- }
- }
-}
-
-/* Fix Foms */
-input[type="submit"],
-input[type="reset"],
-button {
- @extend .btn;
- @extend .btn-default;
-}
-
-select {
- max-width: 100%;
-}
-
-.form-radio-group .radio {
- &:first-child {
- margin-top: 0;
- }
-
- &:last-child {
- margin-bottom: 0;
- }
-}
-
-/* Shortcodes */
-
-.hentry,
-.widget {
- // Fix odin gmaps shortcode
- .odin-map img {
- max-width: none !important;
- }
-}
diff --git a/assets/sass/style.scss b/assets/sass/style.scss
deleted file mode 100644
index d00ecd0..0000000
--- a/assets/sass/style.scss
+++ /dev/null
@@ -1,20 +0,0 @@
-// ==========================================================================
-// Theme Style Main
-// ==========================================================================
-
-/*!
-Theme Name: Odin
-Author URI: http://wpod.in/
-Description: Odin main stylesheet.
-Author: the Odin team
-Author URI: http://wpod.in/#colaboradores
-*/
-
-@import
- "variables", // Theme Custom Variables
- "bootstrap/bootstrap", // Bootstrap Styles Core
- "wordpress/wordpress", // WordPress Styles Core
- //"woocommerce", // WooCommerce Styles Core
- "odin/core", // Odin Styles Core
- "layout" // Theme Custom Layout
-;
diff --git a/assets/sass/wordpress/_wordpress.scss b/assets/sass/wordpress/_wordpress.scss
deleted file mode 100644
index 7a76a44..0000000
--- a/assets/sass/wordpress/_wordpress.scss
+++ /dev/null
@@ -1,257 +0,0 @@
-// ==========================================================================
-// WordPress Core Styles (Table of contents)
-// ==========================================================================
-//
-// # Alignment
-// # Content
-// # Galleries
-// # Images
-// # Widgets
-// ## Calendar
-// ## Search
-// ## TagCloud
-// # Shortcodes
-// ## Video
-// # Forms
-//
-
-// Alignment
-// ==========================================================================
-.alignnone {
- margin: 0.5em 0;
-}
-
-.alignright {
- @extend .pull-right;
- margin: 0.5em 0 1em 1em;
-}
-
-.alignleft {
- @extend .pull-left;
- margin: 0.5em 1em 1em 0;
-}
-
-.aligncenter {
- @extend .center-block;
- margin: 0.5em auto;
-}
-
-// Content
-// ==========================================================================
-.hentry,
-.widget {
- -ms-word-wrap: break-word;
- word-wrap: break-word;
-}
-
-.page-content,
-.entry-content {
- @include clearfix;
- table {
- @extend .table;
- }
- .table-condensed {
- @extend .table-condensed;
- }
-}
-
-.entry-attachment {
- .attachment {
- @extend .text-center;
- margin-bottom: 1em;
- }
- #nav-below {
- .nav-next {
- @extend .pull-right;
- }
- .nav-previous {
- @extend .pull-left;
- }
- }
-}
-
-.entry-caption {
- color: #666;
-}
-
-// Override the Twitter embed fixed width
-.twitter-tweet-rendered {
- max-width: 100% !important;
-}
-
-// Galleries
-// ==========================================================================
-.gallery {
- @include clearfix;
- margin: 0 auto 1em;
- .gallery-item {
- @extend .pull-left;
- @extend .text-center;
- img {
- @extend .img-thumbnail;
- }
- }
- @for $gallery from 1 through 9 {
- &.gallery-columns-#{$gallery} .gallery-item {
- @if 1 == $gallery {
- float: none;
- }
- @if 6 <= $gallery {
- margin: 2em 1%;
- width: unquote(100 / $gallery - 2 + "%");
- }
- @else {
- margin: 2em 2%;
- width: unquote(100 / $gallery - 4 + "%");
- }
- }
- }
- .gallery-caption {
- color: $thumbnail-caption-color;
- margin-left: 0;
- }
- dl {
- margin: 0;
- }
- br + br {
- display: none;
- }
-}
-
-// Images
-// ==========================================================================
-.hentry,
-.widget {
- img {
- height: auto;
- max-width: 100%;
- width: auto;
- }
-}
-
-img {
- &.header-image,
- &.wp-post-image {
- max-width: 100%;
- height: auto;
- }
- &.wp-smiley, .rsswidget & {
- border: none;
- -webkit-border-radius: 0;
- -moz-border-radius: 0;
- border-radius: 0;
- -webkit-box-shadow: none;
- -moz-box-shadow: none;
- box-shadow: none;
- margin-bottom: 0;
- margin-top: 0;
- padding: 0;
- }
- // Remove WP.com Stats smile :)
- wpstats {
- display: none;
- }
- .comment-content &,
- .widget & {
- @extend .img-responsive;
- }
-}
-
-.entry-content p img,
-.wp-caption {
- @extend .img-responsive;
- &.alignleft,
- &.alignright,
- &.aligncenter,
- &.aligncenter,
- &.alignnone {
- margin-top: 1em;
- margin-bottom: 2em;
- }
-}
-
-.wp-caption {
- @extend .thumbnail;
- &.aligncenter,
- &.alignnone {
- clear: both !important;
- }
- .wp-caption-text {
- display: inline-block;
- padding: $thumbnail-caption-padding;
- color: $thumbnail-caption-color;
- &:before {
- color: #666;
- content: '\2014';
- font-size: 12px;
- font-style: normal;
- font-weight: bold;
- margin-right: 5px;
- }
- }
-}
-
-// Widgets
-// ==========================================================================
-
-//
-// Calendar
-//
-.widget_calendar #wp-calendar {
- @extend .table;
- @extend .table-bordered;
- @extend .table-condensed;
- @extend .table-striped;
- @extend .table-responsive;
- #prev {
- border-right: 0;
- a {
- @extend .pull-left;
- }
- }
- #next {
- border-left: 0;
- a {
- @extend .pull-right;
- }
- }
-}
-
-//
-// Search
-//
-.widget_search form {}
-
-.widget_search #s {}
-
-.widget_search #searchsubmit {}
-
-.widget_search #searchsubmit:active {}
-
-//
-// TagCloud
-//
-.widget_tag_cloud {
- @for $i from 1 through 12 {
- $random: 12 + random(20) + px;
- a:nth-child(#{$i}) {
- font-size: #{$random}!important;
- }
- }
-}
-
-// Shortcodes
-// ==========================================================================
-
-//
-// Video
-//
-.wp-video-shortcode {
- max-width: 100%;
-}
-
-// Forms
-// ==========================================================================
-input[name="post_password"] {
- @extend .form-control;
-}
diff --git a/audio.php b/audio.php
deleted file mode 100644
index 27a00f2..0000000
--- a/audio.php
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
-
+/**
+ * Main Component.
+ */
+get_template_part( 'components/main/main' );
-
-
-
-
-
-
-
-
- 1 && get_option( 'page_comments' ) ) : ?>
-
-
-
- 1 && get_option( 'page_comments' ) ) : ?>
-
-
-
-
-
-
- ' . __( 'Comment', 'odin' ) . ' * ' .
- '';
- $fields = array(
- 'author' => '',
- 'email' => '',
- 'url' => ''
- );
- comment_form( array(
- 'comment_notes_after' => '',
- 'comment_field' => $comment_field,
- 'fields' => apply_filters( 'comment_form_default_fields', $fields ),
- 'class_submit' => 'submit btn btn-default'
- ));
- ?>
-
+/**
+ * Comments component.
+ */
+get_template_part( 'components/comments/comments' );
diff --git a/components/_app.scss b/components/_app.scss
new file mode 100644
index 0000000..de0872a
--- /dev/null
+++ b/components/_app.scss
@@ -0,0 +1,15 @@
+/*!
+ * App Component
+ */
+
+.odin-app {
+ &-body {
+ @extend .container;
+
+ // Wrapper
+ &-wrapper{
+ @extend .row;
+ @extend .justify-content-around;
+ }
+ }
+}
diff --git a/components/_wordpress.scss b/components/_wordpress.scss
new file mode 100644
index 0000000..cba03f7
--- /dev/null
+++ b/components/_wordpress.scss
@@ -0,0 +1,153 @@
+/*!
+ * WordPress Native Classes
+ */
+
+//
+// Variables WordPress
+//
+
+$wp-spacer: 1.5rem !default;
+
+//
+// Image
+//
+
+.widget img,
+[class*="wp-image-"],
+.gallery-item .attachment-thumbnail,
+.gallery-item .gallery-icon {
+ max-width: 100%;
+ height: auto;
+ line-height: 1px;
+}
+
+//
+// Figure
+//
+
+.gallery-item,
+.wp-caption {
+ display: inline-block;
+ max-width: 100%;
+ height: auto;
+
+ img {
+ margin-bottom: 0.5rem;
+ line-height: 1;
+ }
+
+ figcaption {
+ font-size: 90%;
+ }
+}
+
+//
+// Gallery
+//
+
+@if mixin-exists(make-row) {
+ @for $i from 1 through 9 {
+ .gallery-columns-#{$i} {
+ @include make-row();
+
+ .gallery-item {
+ @include make-col-ready();
+ @include make-col(12 / $i);
+ }
+ }
+ }
+}
+
+
+//
+// Alignments
+//
+
+.alignnone {
+ margin: $wp-spacer 0;
+}
+
+.alignright {
+ @extend .float-right;
+ margin: $wp-spacer 0 $wp-spacer $wp-spacer;
+}
+
+.alignleft {
+ @extend .float-left;
+ margin: $wp-spacer $wp-spacer $wp-spacer 0;
+}
+
+.aligncenter {
+ display: block;
+ margin: $wp-spacer auto;
+}
+
+//
+// Fix break word
+//
+// Specify that the browser can break a line of text inside the targeted element onto multiple lines in an otherwise unbreakable place.
+// @link https://css-tricks.com/almanac/properties/o/overflow-wrap/
+//
+
+.hentry,
+.comment,
+#comments {
+ word-wrap: break-word;
+ overflow-wrap: break-word;
+ word-break: break-all;
+ hyphens: auto;
+}
+
+//
+// Default widget
+//
+.widget {
+
+ ul {
+ li {
+ word-wrap: break-word;
+ }
+ }
+
+ widgettitle {
+ @extend .h2;
+ @extend .mt-0;
+ @extend .mb-3;
+ }
+}
+
+//
+// Tag cloud widget
+//
+.widget_tag_cloud {
+ @each $child, $random in (1: 30, 2: 23, 3: 29, 4: 23, 5: 23, 6: 23, 7: 21, 8: 16, 9: 14, 10: 25, 11: 26, 12: 32) {
+ a:nth-child(#{$child}) {
+ font-size: #{$random}px !important;
+ }
+ }
+}
+
+//
+// Calendar widget
+//
+.widget_calendar {
+ .calendar_wrap > table {
+ @extend .table;
+ @extend .table-bordered;
+ @extend .table-sm;
+
+ > caption {
+ text-align: center;
+ }
+
+ > tfoot {
+ #prev {
+ @extend .text-sm-left;
+ }
+
+ #next {
+ @extend .text-sm-right;
+ }
+ }
+ }
+}
diff --git a/components/banner/_banner.scss b/components/banner/_banner.scss
new file mode 100644
index 0000000..21728fd
--- /dev/null
+++ b/components/banner/_banner.scss
@@ -0,0 +1,75 @@
+/*!
+ * Banner Component
+ */
+.odin-banner {
+ @extend .container-fluid;
+ @extend .clearfix;
+ position: relative;
+ min-height: $odin-banner-height;
+
+ // Background image with ::after
+ &::after {
+ background: $odin-banner-bg;
+ min-height: $odin-banner-height;
+ content: "";
+ opacity: 1;
+ top: 0;
+ left: 0;
+ bottom: 0;
+ right: 0;
+ position: absolute;
+ z-index: -1;
+ }
+
+ &-wrapper {
+ @extend .d-flex;
+ @extend .flex-column;
+ @extend .flex-md-row;
+ @extend .justify-content-center;
+ @extend .align-items-center;
+ min-height: $odin-banner-height;
+ }
+
+ // Content
+ &-content {
+ @extend .text-center;
+ word-break: break-all;
+
+ // Header title
+ &__title {
+ @extend .display-4;
+ @extend .mb-3;
+ color: $odin-banner-color;
+ }
+
+ // Header description
+ &__description {
+ @extend .h5;
+ @extend .px-1;
+ color: $odin-banner-color;
+ }
+ }
+
+ // Banner styled in phones and tables
+ @include media-breakpoint-down(md) {
+ &,
+ &::after,
+ &-wrapper {
+ min-height: 150px !important;
+ }
+
+ &-content {
+ word-break: normal;
+
+ &__title {
+ font-size: 1.5rem;
+ font-weight: bold;
+ }
+
+ &__description {
+ font-size: 1rem;
+ font-weight: bold;
+ }
+ }
+ }
+}
diff --git a/components/banner/banner.functions.php b/components/banner/banner.functions.php
new file mode 100644
index 0000000..4d94ec5
--- /dev/null
+++ b/components/banner/banner.functions.php
@@ -0,0 +1,69 @@
+ID ) ); // https://core.trac.wordpress.org/ticket/42814
+ } elseif ( is_archive() ) {
+ // Archive.
+ return get_the_archive_description();
+ } else {
+ return;
+ }
+ }
+}
+
+/**
+ * Get banner image.
+ */
+if ( ! function_exists( 'odin_get_banner_image' ) ) {
+ function odin_get_banner_image() {
+ if ( get_header_image() && is_home() ) {
+ // Header Image (support custom header support) only if is home.
+ return get_header_image();
+ } elseif ( has_post_thumbnail() ) {
+ // Thumbnail Post (get original size if not exists the correct).
+ $image = odin_get_attachment_image_src( get_post_thumbnail_id(), 1400, 600 );
+ return ( ! isset( $image ) ) ?: wp_get_attachment_url( get_post_thumbnail_id() );
+ } else {
+ return;
+ }
+ }
+}
diff --git a/components/banner/banner.php b/components/banner/banner.php
new file mode 100644
index 0000000..a808556
--- /dev/null
+++ b/components/banner/banner.php
@@ -0,0 +1,40 @@
+
+
+
+
+
+
+
diff --git a/components/comments/_comments.scss b/components/comments/_comments.scss
new file mode 100644
index 0000000..6be7048
--- /dev/null
+++ b/components/comments/_comments.scss
@@ -0,0 +1,58 @@
+/*!
+ * Comments Area
+ */
+
+.odin-comments {
+ @extend .my-5;
+
+ // Title
+ &__title {
+ @extend .h3;
+ }
+}
+
+/*!
+ * Comment Single
+ */
+
+.odin-comment {
+ // Wrappper
+ &-wrapper {
+ @extend .media;
+ @extend .mb-4;
+ }
+
+ // Avatar
+ &-avatar {
+ @extend .align-self-start;
+ @extend .mr-4;
+
+ img {
+ @extend .rounded-circle;
+ }
+ }
+
+ // Body
+ &-body {
+ @extend .media-body;
+
+ &__header {
+ @extend .h6;
+ }
+
+ &__content {
+ .odin-alert-info {
+ @extend .alert;
+ @extend .alert-info;
+ }
+
+ img {
+ @extend .img-fluid;
+ }
+
+ iframe {
+ @extend .embed-responsive;
+ }
+ }
+ }
+}
diff --git a/components/comments/comments.functions.php b/components/comments/comments.functions.php
new file mode 100644
index 0000000..885cdb1
--- /dev/null
+++ b/components/comments/comments.functions.php
@@ -0,0 +1,88 @@
+comment_type ) {
+ case 'pingback' :
+ case 'trackback' :
+ ?>
+
+
+ id="comment-">
+
+
+
+
+
+
+
diff --git a/components/footer/_footer.scss b/components/footer/_footer.scss
new file mode 100644
index 0000000..25e5668
--- /dev/null
+++ b/components/footer/_footer.scss
@@ -0,0 +1,41 @@
+/*!
+ * Footer Component
+ */
+.odin-footer {
+
+ // Wrapper
+ &-wrapper {
+ @extend .container;
+ @extend .py-5;
+ }
+
+ // Copyright
+ &__copyright {
+ @extend .text-center;
+ }
+
+ // Widgets
+ &__widgets {
+ @extend .row;
+ @extend .justify-content-around;
+
+ .odin-widget,
+ .widget {
+ @extend .col-lg-4;
+ @extend .d-print-none;
+ @extend .mb-3;
+ }
+ }
+
+ // Sticky footer styled
+ // @link https://css-tricks.com/couple-takes-sticky-footer
+ @at-root .odin-app-wrapper {
+ display: flex;
+ min-height: 100vh;
+ flex-direction: column;
+ }
+
+ @at-root .odin-app-body {
+ flex: 1;
+ }
+}
diff --git a/components/footer/footer.functions.php b/components/footer/footer.functions.php
new file mode 100644
index 0000000..56339a0
--- /dev/null
+++ b/components/footer/footer.functions.php
@@ -0,0 +1,35 @@
+ 'odin-widgets-footer',
+ 'name' => __( 'Footer', 'odin' ),
+ 'description' => __( 'Widgets in Footer', 'odin' ),
+ 'before_widget' => '',
+ 'before_title' => '',
+ )
+ );
+
+ }
+
+ add_action( 'widgets_init', 'odin_widgets_footer_init' );
+
+}
diff --git a/components/footer/footer.php b/components/footer/footer.php
new file mode 100644
index 0000000..f740c5d
--- /dev/null
+++ b/components/footer/footer.php
@@ -0,0 +1,31 @@
+
+
+
diff --git a/components/form/_form-comment.scss b/components/form/_form-comment.scss
new file mode 100644
index 0000000..396ec69
--- /dev/null
+++ b/components/form/_form-comment.scss
@@ -0,0 +1,18 @@
+/*!
+ * Form Comment Component
+ */
+.odin-commentForm {
+
+ &__group {
+ @extend .form-group;
+ }
+
+ &__control {
+ @extend .form-control;
+ }
+
+ &__btn {
+ @extend .btn;
+ @extend .btn-secondary;
+ }
+}
diff --git a/components/form/_form-search.scss b/components/form/_form-search.scss
new file mode 100644
index 0000000..17994aa
--- /dev/null
+++ b/components/form/_form-search.scss
@@ -0,0 +1,48 @@
+/*!
+ * Form Search Component
+ */
+.odin-formSearch {
+ @extend .form-inline;
+
+ &__group {
+ @extend .form-group;
+ }
+
+ &__label {
+ @extend .sr-only;
+ }
+
+ &__control {
+ @extend .form-control;
+ }
+
+ &__btn {
+ @extend .btn;
+ @extend .btn-primary;
+ @extend .mx-2;
+ }
+
+ // Inside Navigation Topbar Component
+ .odin-navigation-topbar & {
+
+ &__control {
+ background: $odin-navigation-topbar-formSearch-bg;
+ color: $odin-navigation-topbar-formSearch-color;
+ border-color: $odin-navigation-topbar-formSearch-border-color;
+
+ &:focus {
+ border-color: $odin-navigation-topbar-formSearch-color;
+ box-shadow: 0 0 0 0.2rem $odin-navigation-topbar-formSearch-placeholder-color;
+ }
+ &::placeholder {
+ color: $odin-navigation-topbar-formSearch-placeholder-color;
+ }
+ }
+
+ &__btn {
+ @extend .btn-outline-light;
+ @extend .mx-2;
+ }
+
+ }
+}
diff --git a/components/form/form-comment.php b/components/form/form-comment.php
new file mode 100644
index 0000000..ef2e6d7
--- /dev/null
+++ b/components/form/form-comment.php
@@ -0,0 +1,52 @@
+
+ '',
+ 'email' =>
+ '',
+ 'url' =>
+ '',
+);
+
+$comment_field =
+ '';
+
+/**
+ * Display comment form.
+ *
+ * @link https://developer.wordpress.org/reference/functions/comment_form
+ */
+comment_form( array(
+ 'format' => 'xhtml',
+ 'comment_notes_after' => '',
+ 'comment_field' => $comment_field,
+ 'fields' => apply_filters( 'comment_form_default_fields', $fields ),
+ 'class_form' => 'odin-commentForm',
+ 'class_submit' => 'odin-commentForm__btn',
+));
diff --git a/components/form/form-search.php b/components/form/form-search.php
new file mode 100644
index 0000000..4789ff1
--- /dev/null
+++ b/components/form/form-search.php
@@ -0,0 +1,24 @@
+
+
+
diff --git a/components/header/_header.scss b/components/header/_header.scss
new file mode 100644
index 0000000..059fa91
--- /dev/null
+++ b/components/header/_header.scss
@@ -0,0 +1,3 @@
+/*!
+ * Header Component
+ */
diff --git a/components/header/header.functions.php b/components/header/header.functions.php
new file mode 100644
index 0000000..50c5ca2
--- /dev/null
+++ b/components/header/header.functions.php
@@ -0,0 +1,26 @@
+ 1400,
+ 'height' => 600,
+ 'flex-width' => true,
+ 'flex-height' => true,
+ 'header-text' => false,
+ 'default-image' => '',
+ 'uploads' => true,
+ );
+ add_theme_support( 'custom-header', $args );
+}
+add_action( 'after_setup_theme', 'odin_custom_header_setup' );
diff --git a/components/header/header.php b/components/header/header.php
new file mode 100644
index 0000000..2e67277
--- /dev/null
+++ b/components/header/header.php
@@ -0,0 +1,38 @@
+
+
+
+
+
diff --git a/components/main/_main-404.scss b/components/main/_main-404.scss
new file mode 100644
index 0000000..7227a9f
--- /dev/null
+++ b/components/main/_main-404.scss
@@ -0,0 +1,14 @@
+/*!
+ * Content 404 Component
+ */
+
+.odin-main {
+ .error404 & {
+ @extend .text-center;
+
+ .odin-formSearch {
+ @extend .d-flex;
+ @extend .justify-content-center;
+ }
+ }
+}
diff --git a/components/main/_main.scss b/components/main/_main.scss
new file mode 100644
index 0000000..3d1b87a
--- /dev/null
+++ b/components/main/_main.scss
@@ -0,0 +1,11 @@
+/*!
+ * Main Component
+ */
+
+.odin-main {
+ @extend .col-lg-8;
+
+ &-wrapper{
+ @extend .p-5;
+ }
+}
diff --git a/components/main/main-404.php b/components/main/main-404.php
new file mode 100644
index 0000000..90240de
--- /dev/null
+++ b/components/main/main-404.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
diff --git a/components/main/main-page.php b/components/main/main-page.php
new file mode 100644
index 0000000..accf6cd
--- /dev/null
+++ b/components/main/main-page.php
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/main/main.php b/components/main/main.php
new file mode 100644
index 0000000..4e1e408
--- /dev/null
+++ b/components/main/main.php
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/navigation/_navigation-main.scss b/components/navigation/_navigation-main.scss
new file mode 100644
index 0000000..450265c
--- /dev/null
+++ b/components/navigation/_navigation-main.scss
@@ -0,0 +1,77 @@
+/*!
+ * Navigation Main Component
+ */
+.odin-navMain {
+ @extend .navbar;
+ @extend .navbar-expand-md;
+ @extend .navbar-dark;
+ @extend .py-2;
+ background: $odin-navigation-main-bg;
+ color: $odin-navigation-main-color;
+
+ &-wrapper {
+ @extend .container;
+ }
+
+ /*
+ * Toggler button
+ */
+ &__toggler {
+ @extend .navbar-toggler;
+ > span {
+ @extend .navbar-toggler-icon;
+ }
+ }
+
+ /*
+ * Collapse area
+ */
+ &__collapse {
+ @extend .collapse;
+ @extend .navbar-collapse;
+ }
+
+ /*
+ * Main menu
+ */
+ &__mainMenu {
+ @extend .navbar-nav;
+
+ .menu-item {
+ @extend .nav-item;
+
+ > a {
+ @extend .nav-link;
+ color: $odin-navigation-main-link-color;
+ }
+
+ &.current-menu-item {
+ @extend .active;
+ }
+
+ &.menu-item-has-children {
+ @extend .dropdown;
+
+ &:hover > .dropdown-menu {
+ display: block; /* BS4 dropdown hover */
+ }
+
+ > a {
+ @extend .dropdown-toggle;
+
+ &:active {
+ pointer-events: none; /* BS4 dropdown hover: Without this, clicking will make it sticky */
+ }
+ }
+
+ > ul {
+ @extend .dropdown-menu;
+
+ .menu-item a {
+ @extend .dropdown-item;
+ }
+ }
+ }
+ }
+ }
+}
diff --git a/components/navigation/_navigation-skiplink.scss b/components/navigation/_navigation-skiplink.scss
new file mode 100644
index 0000000..9fb0ebb
--- /dev/null
+++ b/components/navigation/_navigation-skiplink.scss
@@ -0,0 +1,12 @@
+/*!
+ * Navigation Skiplink Component
+ */
+.odin-navigationSkiplink {
+ &__item {
+ @include sr-only;
+ @include sr-only-focusable;
+ @extend .d-block;
+ @extend .p-3;
+ outline: 0;
+ }
+}
diff --git a/components/navigation/_navigation-topbar.scss b/components/navigation/_navigation-topbar.scss
new file mode 100644
index 0000000..379594b
--- /dev/null
+++ b/components/navigation/_navigation-topbar.scss
@@ -0,0 +1,24 @@
+/*!
+ * Nagivation Topbar Component
+ */
+.odin-navigation-topbar {
+ @extend .py-1;
+ background: $odin-navigation-topbar-bg;
+ color: $odin-navigation-topbar-color;
+
+ &-wrapper {
+ @extend .container;
+ }
+
+ &-container {
+ @extend .d-flex;
+ @extend .flex-column;
+ @extend .flex-sm-row;
+ @extend .justify-content-between;
+ @extend .align-items-center;
+ }
+
+ a {
+ color: $odin-navigation-topbar-link-color;
+ }
+}
diff --git a/components/navigation/navigation-main.php b/components/navigation/navigation-main.php
new file mode 100644
index 0000000..b797cd1
--- /dev/null
+++ b/components/navigation/navigation-main.php
@@ -0,0 +1,38 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 'menu-main',
+ 'menu_class' => 'odin-navMain__mainMenu',
+ 'container' => 'ul',
+ 'depth' => 2,
+ ) ); ?>
+
+
+
+
+
+
diff --git a/components/navigation/navigation-skiplink.php b/components/navigation/navigation-skiplink.php
new file mode 100644
index 0000000..64429d3
--- /dev/null
+++ b/components/navigation/navigation-skiplink.php
@@ -0,0 +1,15 @@
+
+
+
+
+
diff --git a/components/navigation/navigation-topbar.php b/components/navigation/navigation-topbar.php
new file mode 100644
index 0000000..468afac
--- /dev/null
+++ b/components/navigation/navigation-topbar.php
@@ -0,0 +1,35 @@
+
+
+
+
+
+
+
+
+
diff --git a/components/page/_page.scss b/components/page/_page.scss
new file mode 100644
index 0000000..03d4ea5
--- /dev/null
+++ b/components/page/_page.scss
@@ -0,0 +1,7 @@
+/*!
+ * Page Component
+ */
+
+.odin-page {
+ @extend .odin-post;
+}
diff --git a/components/page/page.php b/components/page/page.php
new file mode 100644
index 0000000..b8f3709
--- /dev/null
+++ b/components/page/page.php
@@ -0,0 +1,75 @@
+
+
+>
+
+
+
+
+
+
+
+ ' . __( 'Continue reading', 'odin' ) . '' );
+
+ /**
+ * Pagination within a post.
+ */
+ get_template_part( 'components/pagination/pagination', 'within-post' );
+ } ?>
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/components/pagination/_pagination-between-single-posts.scss b/components/pagination/_pagination-between-single-posts.scss
new file mode 100644
index 0000000..838c3c6
--- /dev/null
+++ b/components/pagination/_pagination-between-single-posts.scss
@@ -0,0 +1,15 @@
+/*!
+ * Pagination Between Single Posts.
+ */
+.odin-pagination-between-single-posts {
+ @extend .pagination;
+ @extend .justify-content-between;
+
+ &__item {
+ @extend .page-item;
+
+ > span {
+ @extend .page-link;
+ }
+ }
+}
diff --git a/components/pagination/_pagination-posts.scss b/components/pagination/_pagination-posts.scss
new file mode 100644
index 0000000..36e9b75
--- /dev/null
+++ b/components/pagination/_pagination-posts.scss
@@ -0,0 +1,21 @@
+/*!
+ * Pagination Posts Component
+ */
+.odin-pagination-posts {
+ @extend .d-flex;
+ @extend .justify-content-center;
+
+ .nav-links {
+ @extend .pagination;
+
+
+ & > .page-numbers {
+ @extend .page-item;
+ @extend .page-link;
+ }
+ }
+
+ .screen-reader-text {
+ @extend .sr-only;
+ }
+}
diff --git a/components/pagination/_pagination-within-post.scss b/components/pagination/_pagination-within-post.scss
new file mode 100644
index 0000000..2ba2615
--- /dev/null
+++ b/components/pagination/_pagination-within-post.scss
@@ -0,0 +1,15 @@
+/*!
+ * Pagination within a post Component
+ */
+.odin-pagination-with-post {
+ @extend .pagination;
+ @extend .justify-content-between;
+
+ &__item {
+ @extend .page-item;
+ }
+
+ &__link {
+ @extend .page-link;
+ }
+}
diff --git a/components/pagination/pagination-between-single-posts.php b/components/pagination/pagination-between-single-posts.php
new file mode 100644
index 0000000..630f64d
--- /dev/null
+++ b/components/pagination/pagination-between-single-posts.php
@@ -0,0 +1,19 @@
+
+
+
diff --git a/components/pagination/pagination-posts.php b/components/pagination/pagination-posts.php
new file mode 100644
index 0000000..6f49c59
--- /dev/null
+++ b/components/pagination/pagination-posts.php
@@ -0,0 +1,22 @@
+
+
+
diff --git a/components/pagination/pagination-within-post.php b/components/pagination/pagination-within-post.php
new file mode 100644
index 0000000..f7aa076
--- /dev/null
+++ b/components/pagination/pagination-within-post.php
@@ -0,0 +1,18 @@
+ ' ',
+ 'separator' => ' ' );
- }
-
- });
-
- imageGalleryIds.val( attachmentIds );
- });
-
- // Finally, open the modal.
- galleryFrame.open();
- });
-
- /**
- * Image plupload ordering.
- */
- $( '.odin-gallery-container' ).on( 'mouseover', 'ul.odin-gallery-images', function () {
- var galleryWrap = $( this ).parent( '.odin-gallery-container' ),
- imageGalleryIds = $( '.odin-gallery-field', galleryWrap );
-
- // Call the sortable action.
- $( this ).sortable({
- items: 'li.image',
- cursor: 'move',
- scrollSensitivity: 40,
- forcePlaceholderSize: true,
- forceHelperSize: false,
- helper: 'clone',
- opacity: 0.65,
- placeholder: 'wc-metabox-sortable-placeholder',
- start: function ( event, ui ) {
- ui.item.css('background-color', '#f6f6f6');
- }, stop: function ( event, ui ) {
- ui.item.removeAttr( 'style' );
- }, update: function () {
- var attachmentIds = '';
-
- // Gets the current ids.
- $( 'li.image', $( this ) ).css( 'cursor', 'default' ).each( function () {
- var attachmentId = $( this ).attr( 'data-attachment_id' );
- attachmentIds = attachmentIds + attachmentId + ',';
- });
-
- // Return the new value.
- imageGalleryIds.val( attachmentIds );
- }
- });
- });
-
- /**
- * Image plupload remove link.
- */
- $( '.odin-gallery-container' ).on( 'click', 'a.delete', function ( e ) {
- e.preventDefault();
-
- var galleryWrap = $( this ).parents( '.odin-gallery-container' ),
- imageGalleryIds = $( '.odin-gallery-field', galleryWrap ),
- attachmentIds = '';
-
- // Remove the item.
- $( this ).closest( 'li.image' ).remove();
-
- // Gets the current ids.
- $( 'ul li.image', galleryWrap ).css( 'cursor', 'default' ).each( function () {
- var attachmentId = $( this ).attr( 'data-attachment_id' );
- attachmentIds = attachmentIds ? attachmentIds + ',' + attachmentId : attachmentId;
- });
-
- // Return the new value.
- imageGalleryIds.val( attachmentIds );
- });
- /**
- * Save editor field in add term screen
- */
- $( 'body.edit-tags-php .wp-editor-wrap' ).on( 'mouseover mouseout', function( e ) {
- tinyMCE.triggerSave();
- });
-
- });
-}( jQuery ));
diff --git a/core/assets/js/editor-shortcodes.js b/core/assets/js/editor-shortcodes.js
deleted file mode 100644
index 64ad6b5..0000000
--- a/core/assets/js/editor-shortcodes.js
+++ /dev/null
@@ -1,889 +0,0 @@
-/*global tinymce */
-(function() {
-
- /**
- * Add the shortcodes downdown.
- */
- tinymce.PluginManager.add( 'odin_shortcodes', function( editor ) {
- var ed = tinymce.activeEditor;
- var odin_ui = new Odin_Shortcode_UI( editor, ed );
-
- editor.addButton(
- 'odin', {
- text: ed.getLang( 'odin.shortcode_title' ),
- type: 'menubutton',
- menu: [ {
- text : ed.getLang( 'odin.button' ),
- onclick: function() {
- odin_ui.button();
- }
- }, {
- text : ed.getLang( 'odin.group_button' ),
- onclick: function() {
- odin_ui.group_button();
- }
- }, {
- text : ed.getLang( 'odin.alert' ),
- onclick: function() {
- odin_ui.alert();
- }
- }, {
- text : ed.getLang( 'odin.label' ),
- onclick: function() {
- odin_ui.label();
- }
- }, {
- text : ed.getLang( 'odin.badge' ),
- onclick: function() {
- odin_ui.badge();
- }
- }, {
- text : ed.getLang( 'odin.icon' ),
- onclick: function() {
- odin_ui.icon();
- }
- }, {
- text : ed.getLang( 'odin.well' ),
- onclick: function() {
- odin_ui.well();
- }
- }, {
- text : ed.getLang( 'odin.table' ),
- onclick: function() {
- odin_ui.table();
- }
- }, {
- text : ed.getLang( 'odin.grid' ),
- onclick: function() {
- odin_ui.grids();
- }
- }, {
- text : ed.getLang( 'odin.progress_bar' ),
- onclick: function() {
- odin_ui.progress();
- }
- }, {
- text : ed.getLang( 'odin.panel' ),
- onclick: function() {
- odin_ui.panel();
- }
- }, {
- text : ed.getLang( 'odin.tabs' ),
- onclick: function() {
- odin_ui.tabs();
- }
- }, {
- text : ed.getLang( 'odin.accordion' ),
- onclick: function() {
- odin_ui.accordion();
- }
- }, {
- text : ed.getLang( 'odin.tooltip' ),
- onclick: function() {
- odin_ui.tooltip();
- }
- }, {
- text : ed.getLang( 'odin.map' ),
- onclick: function() {
- odin_ui.map();
- }
- }, {
- text : ed.getLang( 'odin.clear' ),
- onclick: function() {
- odin_ui.clear();
- }
- }, {
- text : ed.getLang( 'odin.qrcode' ),
- onclick: function() {
- odin_ui.qrcode();
- }
- } ]
- } );
- } );
-})();
-
-function Odin_Shortcode_UI( _editor, _ed ) {
- var editor = _editor;
- var ed = _ed;
-
- this.button = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.button' ),
- body : [ {
- type : 'textbox',
- name : 'text',
- label: ed.getLang( 'odin.text' )
- }, {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.default' ),
- value: 'default'
- }, {
- text : ed.getLang( 'odin.success' ),
- value: 'success'
- }, {
- text : ed.getLang( 'odin.warning' ),
- value: 'warning'
- }, {
- text : ed.getLang( 'odin.danger' ),
- value: 'danger'
- }, {
- text : ed.getLang( 'odin.link' ),
- value: 'link'
- } ]
- }, {
- type : 'listbox',
- name : 'size',
- label : ed.getLang( 'odin.size' ),
- values: [ {
- text : ed.getLang( 'odin.lg' ),
- value: 'lg'
- }, {
- text : ed.getLang( 'odin.sm' ),
- value: 'sm'
- }, {
- text : ed.getLang( 'odin.xs' ),
- value: 'xs'
- } ]
- }, {
- type : 'textbox',
- name : 'link',
- id : 'link_button_input',
- label: ed.getLang( 'odin.link' )
- }, {
- type : 'textbox',
- name : 'class_css',
- id : 'class_button_input',
- label: ed.getLang( 'odin.class' )
- }, {
- type : 'textbox',
- name : 'tooltip',
- label: ed.getLang( 'odin.tooltip' )
- }, {
- type : 'listbox',
- name : 'direction',
- label : ed.getLang( 'odin.direction' ),
- values: [ {
- text : ed.getLang( 'odin.default' ),
- value: 'default'
- }, {
- text : ed.getLang( 'odin.top' ),
- value: 'top'
- }, {
- text : ed.getLang( 'odin.right' ),
- value: 'right'
- }, {
- text : ed.getLang( 'odin.left' ),
- value: 'left'
- }, {
- text : ed.getLang( 'odin.bottom' ),
- value: 'bottom'
- } ]
- } ],
- onsubmit: function( e ) {
- // From textfield fields
- var text = isEmpty( e.data.text ) ? '' : e.data.text,
- link = isEmpty( e.data.link ) ? '' : 'link="' + e.data.link + '" ',
- class_css = isEmpty( e.data.class_css ) ? '' : 'class="' + e.data.class_css + '" ',
- tooltip = isEmpty( e.data.tooltip ) ? '' : 'tooltip="' + e.data.tooltip + '" ';
- // From dropdown fields
- var type = 'type="' + e.data.type + '" ',
- size = 'size="' + e.data.size + '" ',
- direction = e.data.direction == 'default' ? '' : 'direction="' + e.data.direction + '" ';
-
- editor.insertContent( '[button ' + type + size + link + class_css + tooltip + direction + ']' + text + '[/button]' );
- }
- } );
-
- jQuery( '#class_button_input' ).attr( 'placeholder', 'hover' );
- jQuery( '#link_button_input' ).attr( 'placeholder', 'http://www.site.com' );
-
- };
-
- this.group_button = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.group_button' ),
- minWidth: 300,
- body : [ {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.vertical' ),
- value: 'vertical'
- }, {
- text : ed.getLang( 'odin.group' ),
- value: 'group'
- } ]
- }, {
- type : 'listbox',
- name : 'size',
- label : ed.getLang( 'odin.size' ),
- values: [ {
- text : ed.getLang( 'odin.lg' ),
- value: 'lg'
- }, {
- text : ed.getLang( 'odin.sm' ),
- value: 'sm'
- }, {
- text : ed.getLang( 'odin.xs' ),
- value: 'xs'
- } ]
- }, {
- type : 'checkbox',
- name : 'justified',
- label : ed.getLang( 'odin.justified' ),
- checked: false
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ',
- size = 'size="' + e.data.size + '" ',
- justified = 'justified="' + e.data.justified + '" ';
- editor.insertContent( '[button_group ' + type + size + justified + '] #content [/button_group]' );
- }
- } );
- };
-
- this.alert = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.alert' ),
- body : [ {
- type : 'textbox',
- name : 'content',
- label: ed.getLang( 'odin.content' )
- }, {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.success' ),
- value: 'success'
- }, {
- text : ed.getLang( 'odin.info' ),
- value: 'info'
- }, {
- text : ed.getLang( 'odin.warning' ),
- value: 'warning'
- }, {
- text : ed.getLang( 'odin.danger' ),
- value: 'danger'
- } ]
- }, {
- type : 'checkbox',
- name : 'close',
- label : ed.getLang( 'odin.close' ),
- checked: false
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ',
- close = true === e.data.close ? 'close="' + e.data.close + '" ' : '';
-
- editor.insertContent( '[alert ' + type + close + ']' + e.data.content + '[/alert]' );
- }
- } );
- };
-
- this.label = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.label' ),
- body : [ {
- type : 'textbox',
- name : 'content',
- label: ed.getLang( 'odin.content' )
- }, {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.default' ),
- value: 'default'
- }, {
- text : ed.getLang( 'odin.success' ),
- value: 'success'
- }, {
- text : ed.getLang( 'odin.info' ),
- value: 'info'
- }, {
- text : ed.getLang( 'odin.warning' ),
- value: 'warning'
- }, {
- text : ed.getLang( 'odin.danger' ),
- value: 'danger'
- } ]
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ';
- editor.insertContent( '[label ' + type + ']' + e.data.content + '[/label]' );
- }
- } );
- };
-
- this.badge = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.badge' ),
- body : [ {
- type : 'textbox',
- name : 'content',
- label: ed.getLang( 'odin.content' )
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ';
- editor.insertContent( '[badge ]' + e.data.content + '[/badge]' );
- }
- } );
- };
-
- this.grids = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.grid' ),
- body : [ {
- type : 'textbox',
- name : 'columns',
- label: ed.getLang( 'odin.columns' )
- }, {
- type : 'textbox',
- name : 'rows',
- label: ed.getLang( 'odin.rows' )
- } ],
- onsubmit: function( e ) {
- var rows = e.data.rows,
- columns = e.data.columns > 12 ? 12 : e.data.columns,
- final_content = '';
-
- for( var r = 0; r < rows; r ++ ) {
- final_content += '[row] \n';
- for( var c = 0; c < columns; c ++ ) {
- final_content += '[col class="col-md-' + Math.floor( 12 / columns ) + '"] Column# ' + c + ' Row# ' + r + ' [/col]\n';
- }
- final_content += '[/row] \n';
- }
-
- final_content = final_content.replace( /\n/ig, " " );
- editor.insertContent( final_content );
- }
- } );
- };
-
- this.icon = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.icon' ),
- minWidth: 200,
- body : [ {
- type : 'textbox',
- name : 'icon',
- label: ed.getLang( 'odin.icon' ),
- } ],
-
- onsubmit: function( e ) {
- var icon = 'type="' + e.data.icon + '" ';
- editor.insertContent( '[icon ' + icon + ']' );
- }
- } );
- };
-
- this.well = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.well' ),
- body : [ {
- type : 'textbox',
- name : 'content',
- label: ed.getLang( 'odin.content' )
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ';
- editor.insertContent( '[well]' + e.data.content + '[/well]' );
- }
- } );
- };
-
- this.table = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.table' ),
- minWidth: 500,
- body : [ {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.striped' ),
- value: 'striped'
- }, {
- text : ed.getLang( 'odin.hover' ),
- value: 'hover'
- }, {
- text : ed.getLang( 'odin.condensed' ),
- value: 'condensed'
- }, {
- text : ed.getLang( 'odin.responsive' ),
- value: 'responsive'
- } ]
- }, {
- type : 'checkbox',
- name : 'border',
- label : ed.getLang( 'odin.border' ),
- checked: false
- }, {
- type : 'textbox',
- name : 'cols',
- id : 'cols_table_input',
- label: ed.getLang( 'odin.cols' ),
- }, {
- type : 'textbox',
- name : 'rows',
- id : 'rows_table_input',
- label: ed.getLang( 'odin.rows' ),
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ',
- border = true === e.data.border ? 'border=true" ' : '',
- cols = 'cols="' + e.data.cols + '" ',
- rows = 'rows="' + e.data.rows + '" ';
-
- editor.insertContent( '[table ' + type + border + cols + rows + ' ] ' );
- }
- } );
-
- jQuery( '#cols_table_input' ).attr( 'placeholder', 'Column 1, Column 2, ...' );
- jQuery( '#rows_table_input' ).attr( 'placeholder', 'Column 1 row 1, Column 2 row1 | Column 1 row 2' );
- };
-
- this.progress = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.progress' ),
- body : [ {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.success' ),
- value: 'striped'
- }, {
- text : ed.getLang( 'odin.info' ),
- value: 'info'
- }, {
- text : ed.getLang( 'odin.warning' ),
- value: 'warning '
- }, {
- text : ed.getLang( 'odin.danger' ),
- value: 'danger'
- } ]
- }, {
- type : 'listbox',
- name : 'class_css',
- label : ed.getLang( 'odin.class' ),
- values: [ {
- text : ed.getLang( 'odin.progress_striped' ),
- value: 'progress-striped'
- }, {
- text : ed.getLang( 'odin.active' ),
- value: 'active'
- } ]
- }, {
- type : 'slider',
- name : 'value',
- label: ed.getLang( 'odin.value_progress' ),
- }, {
- type : 'textbox',
- name : 'max',
- label: ed.getLang( 'odin.max' ),
- value: '100'
- }, {
- type : 'textbox',
- name : 'min',
- label: ed.getLang( 'odin.min' ),
- value: '0'
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ',
- class_css = 'class="' + e.data.class + '" ',
- value = 'value="' +((e.data.value * 0.01) * e.data.max - e.data.min) + '" ',
- max = 'max="' + e.data.max + '" ',
- min = 'min="' + e.data.min + '" ';
-
- editor.insertContent( '[progress ' + type + class_css + value + max + min + ' ] ' );
- }
- } );
- };
-
- this.panel = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.panel' ),
- body : [ {
- type : 'textbox',
- name : 'content',
- label: ed.getLang( 'odin.content' )
- }, {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.default' ),
- value: 'default'
- }, {
- text : ed.getLang( 'odin.info' ),
- value: 'info'
- }, {
- text : ed.getLang( 'odin.primary' ),
- value: 'primary'
- }, {
- text : ed.getLang( 'odin.success' ),
- value: 'success'
- }, {
- text : ed.getLang( 'odin.warning' ),
- value: 'warning'
- }, {
- text : ed.getLang( 'odin.danger' ),
- value: 'danger'
- } ]
- } ],
- onsubmit: function( e ) {
- var type = 'type="' + e.data.type + '" ';
-
- editor.insertContent( '[panel '+ type +'][panel_body]' + e.data.content + '[/panel_body][/panel]' );
- }
- } );
- };
-
- this.tabs = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.tabs' ),
- body : [ {
- type : 'textbox',
- name : 'tabs',
- id : 'childs_tabs_input',
- label: ed.getLang( 'odin.childs' ),
- } ],
- onsubmit: function( e ) {
- var tabs = e.data.tabs,
- tabs_title = '',
- tabs_content = '',
- final_content = '';
-
- for( var i = 0; i < tabs; i ++ ) {
- tabs_title += ' [tab id="tab_id_' + i + '" ' +( 0 === i ? 'active = "true"' : "") + ' ]Title #' + i + ' [/tab] \n ';
- tabs_content += ' [tab_content id="tab_id_' + i + '" ' +( 0 === i ? 'active = "true"' : "") + ' ]' + 'content #' + i + '[/tab_content] \n';
- }
-
- //formating the output to break line
- final_content += '[tabs]\n' + tabs_title + '[/tabs]\n';
- final_content += '[tab_contents]\n' + tabs_content + '[/tab_contents]\n';
- final_content = final_content.replace( /\n/ig, ' ' );
-
- editor.insertContent( final_content );
-
- }
- } );
- jQuery( '#childs_tabs_input' ).attr( 'placeholder', '3' );
- };
-
- this.accordion = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.accordion' ),
- body : [ {
- type : 'textbox',
- name : 'accordions_id',
- label: ed.getLang( 'odin.accordions_id' ),
- value: 'odin-accordion'
- }, {
- type : 'textbox',
- name : 'childs',
- id : 'childs_accordion_input',
- label: ed.getLang( 'odin.childs' ),
- }, {
- type : 'listbox',
- name : 'type',
- label : ed.getLang( 'odin.type' ),
- values: [ {
- text : ed.getLang( 'odin.default' ),
- value: 'default'
- }, {
- text : ed.getLang( 'odin.info' ),
- value: 'info'
- }, {
- text : ed.getLang( 'odin.primary' ),
- value: 'primary'
- }, {
- text : ed.getLang( 'odin.success' ),
- value: 'success'
- }, {
- text : ed.getLang( 'odin.warning' ),
- value: 'warning '
- }, {
- text : ed.getLang( 'odin.danger' ),
- value: 'danger '
- } ]
- } ],
- onsubmit: function( e ) {
- var type = ' type="' + e.data.type + '" ',
- accordions_id = ' id="' + e.data.accordions_id + '" ',
- childs = e.data.childs <= 0 ? 1 : e.data.childs,
- accordions = '',
- final_content = '';
-
- for( var i = 0; i < childs; i ++ ) {
- accordions += '[accordion id=accordion#' + i + ' title="title#' + i + '" ' + ( 0 === i ? " active='true' " : " " ) + ' ]' + 'content #' + i + ' [/accordion] \n';
- }
-
- final_content += ' [accordions' + accordions_id + ' ] \n';
- final_content += accordions;
- final_content += '[/accordions] \n';
- final_content = final_content.replace( /\n/ig, ' ' );
- editor.insertContent( final_content );
- }
- } );
- jQuery( '#childs_accordion_input' ).attr( 'placeholder', '3' );
- };
-
- this.tooltip = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.tooltip' ),
- body : [ {
- type : 'textbox',
- name : 'title',
- label: ed.getLang( 'odin.title' )
- }, {
- type : 'textbox',
- name : 'content',
- label: ed.getLang( 'odin.content' )
- }, {
- type : 'textbox',
- name : 'link',
- id : 'link_tooltip_input',
- label: ed.getLang( 'odin.link' )
- }, {
- type : 'listbox',
- name : 'direction',
- label : ed.getLang( 'odin.direction' ),
- values: [ {
- text : ed.getLang( 'odin.top' ),
- value: 'top'
- }, {
- text : ed.getLang( 'odin.right' ),
- value: 'right'
- }, {
- text : ed.getLang( 'odin.left' ),
- value: 'left'
- }, {
- text : ed.getLang( 'odin.bottom' ),
- value: 'success'
- } ]
- } ],
- onsubmit: function( e ) {
- var direction = 'direction="' + e.data.direction + '" ',
- title = 'title="' + e.data.title + '" ',
- link = 'link="' + e.data.link + '" ';
-
- editor.insertContent( ' [tooltip ' + title + direction + link + ']' + e.data.content + '[/tooltip]' );
-
- }
- } );
-
- jQuery( '#link_tooltip_input' ).attr( 'placeholder', 'http://www.site.com' );
- };
-
- this.clear = function() {
- editor.insertContent( '[clear]' );
- };
-
- this.qrcode = function() {
- editor.windowManager.open( {
- title : ed.getLang( 'odin.qrcode' ),
- body : [ {
- type : 'textbox',
- name : 'data',
- id : 'data_qr_input',
- label: ed.getLang( 'odin.data' )
- }, {
- type : 'textbox',
- name : 'size',
- label: ed.getLang( 'odin.size' ),
- value: '150x150'
- }, {
- type : 'textbox',
- name : 'title',
- label: ed.getLang( 'odin.title' )
- } ],
- onsubmit: function( e ) {
- var data = 'data="' + e.data.data + '" ',
- size = 'size="' + e.data.size + '" ',
- title = 'title="' + e.data.title + '" ';
-
- editor.insertContent( ' [qrcode ' + data + size + title + ']' );
- }
- } );
-
- jQuery( '#data_qr_input' ).attr( 'placeholder', 'http://www.site.com' );
- };
-
- this.map = function() {
- editor.windowManager.open( {
- maxHeight: 500,
- minHeight: 300,
- maxWidth : 700,
- minWidth : 450,
- title : ed.getLang( 'odin.map' ),
- id : 'map-shortcode-panel',
- body : [ {
-
- type : 'textbox',
- name : 'id',
- value: 'odin_gmap',
- label: ed.getLang( 'odin.id' )
- }, {
- type : 'textbox',
- name : 'latitude',
- id : 'lat_map_input',
- label: ed.getLang( 'odin.latitude' )
- }, {
- type : 'textbox',
- name : 'longitude',
- id : 'long_map_input',
- label: ed.getLang( 'odin.longitude' )
- }, {
- type : 'textbox',
- name : 'zoom',
- value: '10',
- label: ed.getLang( 'odin.zoom' )
- }, {
- type : 'textbox',
- name : 'width',
- value: '600',
- label: ed.getLang( 'odin.width' )
- }, {
- type : 'textbox',
- name : 'height',
- value: '400',
- label: ed.getLang( 'odin.height' )
- }, {
- type : 'listbox',
- name : 'maptype',
- label : ed.getLang( 'odin.maptype' ),
- values: [ {
- text : ed.getLang( 'odin.ROADMAP' ),
- value: 'ROADMAP'
- }, {
- text : ed.getLang( 'odin.SATELLITE' ),
- value: 'SATELLITE'
- }, {
- text : ed.getLang( 'odin.HYBRID' ),
- value: 'HYBRID'
- }, {
- text : ed.getLang( 'odin.TERRAIN' ),
- value: 'TERRAIN'
- } ]
- }, {
- type : 'textbox',
- name : 'address',
- label: ed.getLang( 'odin.address' )
- }, {
- type : 'textbox',
- name : 'kml',
- id : 'kml_map_input',
- label: ed.getLang( 'odin.kml' )
- }, {
- type : 'checkbox',
- name : 'kmlautofit',
- label : ed.getLang( 'odin.kmlautofit' ),
- checked: false
- }, {
- type : 'checkbox',
- name : 'marker',
- label : ed.getLang( 'odin.marker' ),
- checked: false
- }, {
- type : 'textbox',
- name : 'markerimage',
- id : 'markerimg_map_input',
- label: ed.getLang( 'odin.markerimage' )
- }, {
- type : 'checkbox',
- name : 'traffic',
- label : ed.getLang( 'odin.traffic' ),
- checked: false
- }, {
- type : 'checkbox',
- name : 'bike',
- label : ed.getLang( 'odin.bike' ),
- checked: false
- }, {
- type : 'textbox',
- name : 'fusion',
- label: ed.getLang( 'odin.fusion' ),
-
- }, {
- type : 'textbox',
- name : 'infowindow',
- label: ed.getLang( 'odin.infowindow' ),
-
- }, {
- type : 'checkbox',
- name : 'infowindowdefault',
- label : ed.getLang( 'odin.infowindowdefault' ),
- checked: false
- }, {
- type : 'checkbox',
- name : 'hidecontrols',
- label : ed.getLang( 'odin.hidecontrols' ),
- checked: false
- }, {
- type : 'checkbox',
- name : 'scale',
- label : ed.getLang( 'odin.scale' ),
- checked: false
- }, {
- type : 'checkbox',
- name : 'scrollwheel',
- label : ed.getLang( 'odin.scrollwheel' ),
- checked: true
- } ],
- onsubmit : function( e ) {
- var id = ' id="' + e.data.id + '" ',
- latitude = '' === e.data.latitude ? '' : ' latitude="' + e.data.latitude + '" ',
- longitude = '' === e.data.longitude ? '' : ' longitude="' + e.data.longitude + '" ',
- zoom = ' zoom="' + e.data.zoom + '" ',
- width = ' width="' + e.data.width + '" ',
- height = ' height="' + e.data.height + '" ',
- maptype = ' maptype="' + e.data.maptype + '" ',
- address = ' address="' + e.data.address + '" ',
- kml = ' kml="' + e.data.kml + '" ',
- kmlautofit = ' kmlautofit="' + e.data.kmlautofit + '" ',
- marker = ' marker="' + e.data.marker + '" ',
- markerimage = ' markerimage="' + e.data.markerimage + '" ',
- traffic = ' traffic="' + e.data.traffic + '" ',
- fusion = ' fusion="' + e.data.fusion + '" ',
- bike = ' bike="' + e.data.bike + '" ',
- infowindow = ' infowindow="' + e.data.infowindow + '" ',
- infowindowdefault = ' infowindowdefault="' + e.data.infowindowdefault + '" ',
- hidecontrols = ' hidecontrols="' + e.data.hidecontrols + '" ',
- scale = ' scale="' + e.data.scale + '" ',
- scrollwheel = ' scrollwheel="' + e.data.scrollwheel + '" ';
-
- editor.insertContent( ' [map' + id + latitude + longitude + zoom + width + height + maptype + address +
- kml + kmlautofit + marker + markerimage + traffic + fusion + bike + infowindow + infowindowdefault + scale + scrollwheel + ']' );
- }
- } );
-
- jQuery( '#lat_map_input' ).attr( 'placeholder', '-25.363882' );
- jQuery( '#long_map_input' ).attr( 'placeholder', '131.044922' );
- jQuery( '#markerimg_map_input' ).attr( 'placeholder', 'http://.../beachflag.png' );
- jQuery( '#kml_map_input' ).attr( 'placeholder', 'http://.../ggeoxml/cta.kml' );
- };
-}
-
-/**
- * Check is empty.
- *
- * @param {string} value
- * @return {bool}
- */
-this.isEmpty = function( value ) {
- value = value.toString();
-
- if ( 0 !== value.length ) {
- return false;
- }
-
- return true;
-};
diff --git a/core/classes/abstracts/abstract-front-end-form.php b/core/classes/abstracts/abstract-front-end-form.php
deleted file mode 100755
index 3608fa5..0000000
--- a/core/classes/abstracts/abstract-front-end-form.php
+++ /dev/null
@@ -1,759 +0,0 @@
-id = $id;
- $this->action = $action;
- $this->method = $method;
- $this->attributes = $attributes;
- }
-
- /**
- * Set form fields.
- *
- * @param array $fields Form fields.
- */
- public function set_fields( $fields = array() ) {
- $this->fields = $fields;
- }
-
- /**
- * Set form buttons.
- *
- * @param array $buttons Form buttons.
- */
- public function set_buttons( $buttons = array() ) {
- $this->buttons = $buttons;
- }
-
- /**
- * Set errors.
- *
- * @param array $errors Form errors.
- */
- protected function set_errors( $errors = array() ) {
- $this->errors[] = $errors;
- }
-
- /**
- * Set success message.
- *
- * @param string $success Form success message.
- */
- public function set_success_message( $success = '' ) {
- $this->success = $success;
- }
-
- /**
- * Get submitted data.
- *
- * @return array Submitted data.
- */
- public function get_submitted_data() {
- $data = $this->submitted_form_data();
-
- return $data;
- }
-
- /**
- * Get submitted attachments.
- *
- * @return array Submitted attachments.
- */
- public function get_attachments() {
- $attachments = $this->uploaded_files();
-
- return $attachments;
- }
-
- /**
- * Get current page.
- *
- * @return string Currente Page URL.
- */
- protected function get_current_page() {
- $url = 'http';
- if ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) {
- $url .= 's';
- }
-
- $url .= '://';
-
- if ( '80' != $_SERVER['SERVER_PORT'] ) {
- $url .= $_SERVER['SERVER_NAME'] . ':' . $_SERVER['SERVER_PORT'] . $_SERVER['REQUEST_URI'];
- } else {
- $url .= $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
- }
-
- return $url;
- }
-
- /**
- * Get field label via ID.
- *
- * @param string $id Field ID.
- *
- * @return string Field label.
- */
- protected function get_field_label( $id ) {
- foreach ( $this->fields as $fieldset ) {
- foreach ( $fieldset['fields'] as $field ) {
- if ( $field['id'] == $id ) {
- return $field['label']['text'];
- }
- }
- }
-
- return '';
- }
-
- /**
- * Process form and fields attributes.
- *
- * @param array $attributes Attributes as array.
- *
- * @return string Attributes as string.
- */
- protected function process_attributes( $attributes = array() ) {
- $attrs = '';
-
- if ( ! empty( $attributes ) ) {
- foreach ( $attributes as $key => $attribute ) {
- $attrs .= ' ' . $key . '="' . $attribute . '"';
- }
- }
-
- return $attrs;
- }
-
- /**
- * Process class for label tag.
- *
- * @param string $class Class as string, separated by blankspace.
- *
- * @return string Class as string.
- */
- protected function process_label_class( $class ) {
- return ! empty( $class ) ? ' class="' . esc_attr( $class ) . '"' : '';
- }
-
- /**
- * Sets the field default value.
- *
- * @return string Default value.
- */
- protected function default_field( $id, $default ) {
- if ( 'get' == $this->method ) {
- return isset( $_GET[ $id ] ) ? sanitize_text_field( $_GET[ $id ] ) : $default;
- } else {
- return isset( $_POST[ $id ] ) ? sanitize_text_field( $_POST[ $id ] ) : $default;
- }
- }
-
- /**
- * Process form fields.
- *
- * @return string Form fields HTML.
- */
- protected function process_fields() {
- $html = '';
-
- if ( ! empty( $this->fields ) ) {
- foreach ( $this->fields as $key => $fieldset ) {
- $fieldset_attributes = isset( $fieldset['attributes'] ) ? $fieldset['attributes'] : array();
-
- $html .= sprintf( '', $key, $this->process_attributes( $fieldset_attributes ) );
- $html .= isset( $fieldset['legend'] ) ? '' . $fieldset['legend'] . ' ' : '';
-
- foreach ( $fieldset['fields'] as $field ) {
- $id = $field['id'];
- $type = $field['type'];
- $label = isset( $field['label'] ) ? $field['label'] : array();
- $description = isset( $field['description'] ) ? $field['description'] : '';
- $attributes = isset( $field['attributes'] ) ? $field['attributes'] : array();
- $options = isset( $field['options'] ) ? $field['options'] : '';
- $required = isset( $field['required'] ) && $field['required'] ? true : false;
- $default = isset( $field['default'] ) ? $field['default'] : '';
- $default = $this->default_field( $id, $default );
-
- if ( $required ) {
- $attributes = array_merge( array( 'required' => 'required' ), $attributes );
- }
-
- switch ( $type ) {
- case 'text':
- $html .= $this->field_input( $id, $label, $default, $description, $attributes );
- break;
- case 'hidden':
- $html .= $this->field_hidden( $id, $default, $attributes );
- break;
- case 'email':
- $html .= $this->field_input( $id, $label, $default, $description, array_merge( array( 'type' => 'email' ), $attributes ) );
- break;
- case 'tel':
- $html .= $this->field_input( $id, $label, $default, $description, array_merge( array( 'type' => 'tel' ), $attributes ) );
- break;
- case 'file':
- $html .= $this->field_input( $id, $label, $default, $description, array_merge( array( 'type' => 'file', 'class' => 'form-file' ), $attributes ) );
- $this->attributes = array_merge( array( 'enctype' => 'multipart/form-data' ), $this->attributes );
- break;
- case 'input':
- $html .= $this->field_input( $id, $label, $default, $description, $attributes );
- break;
- case 'textarea':
- $html .= $this->field_textarea( $id, $label, $default, $description, $attributes );
- break;
- case 'checkbox':
- $html .= $this->field_checkbox( $id, $label, $default, $description, $attributes );
- break;
- case 'select':
- $html .= $this->field_select( $id, $label, $default, $description, $attributes, $options );
- break;
- case 'radio':
- $html .= $this->field_radio( $id, $label, $default, $description, $attributes, $options );
- break;
-
- default:
- $html .= do_action( 'odin_front_end_form_field_' . $this->id, $id, $label, $default, $description, $attributes, $options );
- break;
- }
- }
-
- $html .= ' ';
- }
- }
-
- return $html;
- }
-
- /**
- * Process form buttons.
- *
- * @return string Form buttons HTML.
- */
- protected function process_buttons() {
- $html = '';
-
- if ( ! empty( $this->buttons ) ) {
- foreach ( $this->buttons as $button ) {
- $attributes = isset( $button['attributes'] ) ? $button['attributes'] : array( 'class' => 'btn btn-primary' );
-
- $html .= sprintf(
- '%s ',
- $button['id'],
- $button['type'],
- $this->process_attributes( $attributes ),
- $button['label']
- );
- }
- } else {
- $html .= '' . __( 'Submit', 'odin' ) . ' ';
- }
-
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Display error messages.
- *
- * @param string $html Form HTML.
- *
- * @return string Error messages.
- */
- public function display_error_messages( $html ) {
- if ( ! empty( $this->errors ) ) {
-
- $html .= '';
-
- foreach ( $this->errors as $error ) {
- $html .= '
' . $error . '
';
- }
-
- $html .= '
';
- }
-
- return $html;
- }
-
- /**
- * Display success message.
- *
- * @return string Success message.
- */
- protected function display_success_message() {
- $html = '';
-
- if ( isset( $_GET['success'] ) && 1 == $_GET['success'] ) {
- $html .= '';
- if ( ! empty( $this->success ) ) {
- $html .= '
' . $this->success . '
';
- } else {
- $html .= '
' . __( 'Form submitted successfully!', 'odin' ) . '
';
- }
- $html .= '
';
- }
-
- return $html;
- }
-
- /**
- * Required field HTML.
- *
- * @param array $attributes Array with field attributes.
- *
- * @return string Alert for required field.
- */
- protected function required_field_alert( $attributes ) {
- if ( isset( $attributes['required'] ) ) {
- return ' * ';
- }
- }
-
- /**
- * Input field.
- *
- * @param string $id Field id.
- * @param array $label Array with label attributes.
- * @param string $default Default value.
- * @param string $description Field description.
- * @param array $attributes Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_input( $id, $label, $default, $description, $attributes ) {
- // Set the default type.
- if ( ! isset( $attributes['type'] ) ) {
- $attributes['type'] = 'text';
- }
-
- // Set the default class.
- if ( ! isset( $attributes['class'] ) ) {
- $attributes['class'] = 'form-control';
- }
-
- $html = sprintf( '', $id );
- $html .= sprintf( '%s%s ', $id, $this->process_label_class( $label['class'] ), $label['text'], $this->required_field_alert( $attributes ) );
- $html .= sprintf( ' ', $id, $default, $this->process_attributes( $attributes ) );
- $html .= ! empty( $description ) ? '' . $description . ' ' : '';
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Hidden field.
- *
- * @param string $id Field id.
- * @param string $default Default value.
- * @param array $attributes Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_hidden( $id, $default, $attributes ) {
- // Set the default type.
- if ( ! isset( $attributes['type'] ) ) {
- $attributes['type'] = 'hidden';
- }
-
- $html = sprintf( ' ', $id, $default, $this->process_attributes( $attributes ) );
-
- return $html;
- }
-
- /**
- * Textarea field.
- *
- * @param string $id Field id.
- * @param array $label Array with label attributes.
- * @param string $default Default value.
- * @param string $description Field description.
- * @param array $attributes Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_textarea( $id, $label, $default, $description, $attributes ) {
- // Set the default class.
- if ( ! isset( $attributes['class'] ) ) {
- $attributes['class'] = 'form-control';
- }
-
- if ( ! isset( $attributes['cols'] ) ) {
- $attributes['cols'] = '60';
- }
-
- if ( ! isset( $attributes['rows'] ) ) {
- $attributes['rows'] = '4';
- }
-
- $html = sprintf( '', $id );
- $html .= sprintf( '%s%s ', $id, $this->process_label_class( $label['class'] ), $label['text'], $this->required_field_alert( $attributes ) );
- $html .= sprintf( '', $id, $this->process_attributes( $attributes ), $default );
- $html .= ! empty( $description ) ? '' . $description . ' ' : '';
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Checkbox field.
- *
- * @param string $id Field id.
- * @param array $label Array with label attributes.
- * @param string $default Default value.
- * @param string $description Field description.
- * @param array $attributes Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_checkbox( $id, $label, $default, $description, $attributes ) {
- // Set the checked attribute
- if ( ! empty( $default ) ) {
- $attributes['checked'] = 'checked';
- }
-
- $html = sprintf( '', $id );
- $html .= sprintf( '', $id, $this->process_label_class( $label['class'] ) );
- $html .= sprintf( ' ', $id, $this->process_attributes( $attributes ) );
- $html .= ' ' . $label['text'] . $this->required_field_alert( $attributes ) . ' ';
- $html .= ! empty( $description ) ? '' . $description . ' ' : '';
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Select field.
- *
- * @param string $id Field id.
- * @param array $label Array with label attributes.
- * @param string $default Default value.
- * @param string $description Field description.
- * @param array $attributes Array with field attributes.
- * @param array $options Array with field options (value => name).
- *
- * @return string HTML of the field.
- */
- protected function field_select( $id, $label, $default, $description, $attributes, $options ) {
- // Set the default class.
- if ( ! isset( $attributes['class'] ) ) {
- $attributes['class'] = 'form-control';
- }
-
- // If multiple add a array in the option.
- $multiple = ( in_array( 'multiple', $attributes ) ) ? '[]' : '';
-
- $html = sprintf( '', $id );
- $html .= sprintf( '%s%s ', $id, $this->process_label_class( $label['class'] ), $label['text'], $this->required_field_alert( $attributes ) );
- $html .= sprintf( '', $id, $multiple, $this->process_attributes( $attributes ) );
-
- foreach ( $options as $value => $name ) {
- // Set the selected attribute.
- $selected = ( $value == $default ) ? ' selected="selected"' : '';
-
- $html .= sprintf( '%s ', $value, $selected, $name );
- }
-
- $html .= ' ';
- $html .= ! empty( $description ) ? '' . $description . ' ' : '';
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Radio field.
- *
- * @param string $id Field id.
- * @param array $label Array with label attributes.
- * @param string $default Default value.
- * @param string $description Field description.
- * @param array $attributes Array with field attributes.
- * @param array $options Array with field options (value => label).
- *
- * @return string HTML of the field.
- */
- protected function field_radio( $id, $label, $default, $description, $attributes, $options ) {
- $html = sprintf( '';
-
- return $html;
- }
-
- /**
- * Checks if the form data is valid.
- *
- * @return bool
- */
- protected function is_valid() {
- $valid = empty( $this->errors ) ? true : false;
-
- return $valid;
- }
-
- /**
- * Gests the form submitted data.
- *
- * @return array Form submitted data.
- */
- protected function submitted_form_data() {
- // Checks the form method.
- if ( 'get' == $this->method ) {
- $data = $_GET;
- } else {
- $data = $_POST;
- }
-
- return $data;
- }
-
- /**
- * Gests the form submitted files.
- *
- * @return array Form submitted files.
- */
- protected function submitted_form_files() {
- $files = array();
-
- // Checks the form method.
- if ( 0 < count( $_FILES ) ) {
- $files = $_FILES;
- }
-
- return $files;
- }
-
- /**
- * Validates the form data.
- */
- protected function validate_form_data() {
- $errors = array();
-
- // Sets the data.
- $data = $this->submitted_form_data();
- $files = $this->submitted_form_files();
-
- if ( ! empty( $this->fields ) && ! empty( $data ) ) {
- foreach ( $this->fields as $fieldset ) {
- foreach ( $fieldset['fields'] as $field ) {
- $id = $field['id'];
- $type = $field['type'];
- $label = isset( $field['label'] ) ? $field['label'] : '';
- $value = ! empty( $data[ $id ] ) ? $data[ $id ] : '';
- $required = isset( $field['required'] ) && $field['required'] ? true : false;
-
- if ( $type != 'file' && $required && empty( $data[ $id ] ) ) {
- $this->set_errors( sprintf( __( '%s is required.', 'odin' ), '' . $label . ' ' ) );
- }
-
- switch ( $type ) {
- case 'email':
- if ( ! is_email( $value ) ) {
- $this->set_errors( sprintf( __( '%s must be an email address valid.', 'odin' ), '' . $label . ' ' ) );
- }
- break;
- case 'file':
- if ( count($files) >= 1 ) {
- if ( $required && empty( $files[ $id ]['name'] ) ) {
- $this->set_errors( sprintf( __( '%s is required.', 'odin' ), '' . $label . ' ' ) );
- }
- }
- break;
-
- default:
- $custom_message = apply_filters( 'odin_front_end_form_valid_' . $this->id . '_' . $id, '', $label, $value );
- if ( $custom_message ) {
- $this->set_errors( $custom_message );
- }
- break;
- }
- }
- }
- }
-
- // Sets the errors.
- if ( ! empty( $this->errors ) ) {
-
- // Remove valid param.
- if ( isset( $_GET['success'] ) && 1 == $_GET['success'] ) {
- unset( $_GET['success'] );
- }
- }
- }
-
- /**
- * Redirect to current page.
- */
- protected function redirect() {
- @ob_clean();
-
- $url = $this->get_current_page();
- $url = apply_filters( 'odin_front_end_form_redirect_' . $this->id, add_query_arg( 'success', '1', $url ) );
-
- wp_redirect( $url, 303 );
-
- exit;
- }
-
- /**
- * Process the send form files.
- *
- * @return array
- */
- protected function uploaded_files() {
- require_once ABSPATH . 'wp-admin/includes/image.php';
- require_once ABSPATH . 'wp-admin/includes/file.php';
- require_once ABSPATH . 'wp-admin/includes/media.php';
-
- $attachments = array();
-
- foreach ( $this->fields as $fieldset ) {
- foreach ( $fieldset['fields'] as $field ) {
- $id = $field['id'];
- if ( 'file' == $field['type'] && isset( $_FILES[ $id ] ) ) {
- $attachment_id = media_handle_upload( $id, 0 );
-
- if ( is_wp_error( $attachment_id ) && $_FILES[ $id ]['size'] > 0 ) {
- $error = apply_filters( 'odin_front_end_form_upload_error_' . $this->id, sprintf( '%s %s.', '' . $this->get_field_label( $id ) . ' ', $attachment_id->get_error_message() ) );
- $this->set_errors( $error );
- } else {
- $attachments[ $id ] = array(
- 'file' => get_attached_file( $attachment_id ),
- 'url' => wp_get_attachment_url( $attachment_id )
- );
- }
- }
- }
- }
-
- return $attachments;
- }
-
- /**
- * Form init.
- * Hook this in the WordPress init action.
- */
- public function init() {
- $submitted_data = $this->submitted_form_data();
- $uploaded_files = $this->get_attachments();
-
- if ( ! empty( $submitted_data ) && isset( $submitted_data['odin_form_action'] ) && $this->id == $submitted_data['odin_form_action'] ) {
- // Validates the form data.
- $this->validate_form_data();
-
- if ( $this->is_valid() ) {
- // Hook to process submitted form data.
- do_action( 'odin_front_end_form_submitted_data_' . $this->id, $submitted_data, $uploaded_files );
-
- // Redirect after submit.
- $this->redirect();
- } else {
- add_filter( 'odin_front_end_form_messages_' . $this->id, array( $this, 'display_error_messages' ) );
- }
- }
- }
-
- /**
- * Render the form.
- *
- * @return string Form HTML.
- */
- public function render() {
-
- $html = '';
-
- // Display error messages.
- $html .= apply_filters( 'odin_front_end_form_messages_' . $this->id, $html );
-
- // Display success message.
- $html .= $this->display_success_message();
-
- // Process the fields.
- $fields = $this->process_fields();
-
- // Generate the form.
- $html .= sprintf(
- '';
-
- return $html;
- }
-
-}
diff --git a/core/classes/class-bootstrap-nav.php b/core/classes/class-bootstrap-nav.php
deleted file mode 100644
index 848c989..0000000
--- a/core/classes/class-bootstrap-nav.php
+++ /dev/null
@@ -1,213 +0,0 @@
-,
- * created by Edward McIntyre and with the licence GPLv2.
- *
- * @package Odin
- * @category Bootstrap
- * @author WPBrasil
- * @version 2.1.4
- */
-class Odin_Bootstrap_Nav_Walker extends Walker_Nav_Menu {
-
- /**
- * @see Walker::start_lvl()
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param int $depth Depth of page. Used for padding.
- */
- public function start_lvl( &$output, $depth = 0, $args = array() ) {
- $indent = str_repeat( "\t", $depth );
- $output .= "\n$indent\n";
- }
-
- /**
- * @see Walker::start_el()
- *
- * @param string $output Passed by reference. Used to append additional content.
- * @param object $item Menu item data object.
- * @param int $depth Depth of menu item. Used for padding.
- * @param int $current_page Menu item ID.
- * @param object $args
- */
- public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
- $indent = ( $depth ) ? str_repeat( "\t", $depth ) : '';
-
- /**
- * Dividers, Headers or Disabled
- * =============================
- * Determine whether the item is a Divider, Header, Disabled or regular
- * menu item. To prevent errors we use the strcasecmp() function to so a
- * comparison that is not case sensitive. The strcasecmp() function returns
- * a 0 if the strings are equal.
- */
- if ( strcasecmp( $item->attr_title, 'divider' ) == 0 && $depth === 1 ) {
- $output .= $indent . '';
- } else if ( strcasecmp( $item->title, 'divider' ) == 0 && $depth === 1 ) {
- $output .= $indent . ' ';
- } else if ( strcasecmp( $item->attr_title, 'dropdown-header' ) == 0 && $depth === 1 ) {
- $output .= $indent . ' ' . esc_html( $item->title ) . ' ';
- } else {
-
- $class_names = $value = '';
-
- $classes = empty( $item->classes ) ? array() : (array) $item->classes;
- $classes[] = 'menu-item-' . $item->ID;
-
- $class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $classes ), $item, $args ) );
-
- if ( $args->has_children ) {
- $class_names .= ' dropdown';
- }
-
- if ( in_array( 'current-menu-item', $classes ) ) {
- $class_names .= ' active';
- }
-
- $class_names = $class_names ? ' class="' . esc_attr( $class_names ) . '"' : '';
-
- $id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $item->ID, $item, $args );
- $id = $id ? ' id="' . esc_attr( $id ) . '"' : '';
-
- $output .= $indent . '';
-
- $atts = array();
- $atts['title'] = ! empty( $item->title ) ? strip_tags( $item->title ) : '';
- $atts['target'] = ! empty( $item->target ) ? $item->target : '';
- $atts['rel'] = ! empty( $item->xfn ) ? $item->xfn : '';
-
- // If item has_children add atts to a.
- if ( $args->has_children && $depth === 0) {
- $atts['href'] = '#';
- $atts['data-toggle'] = 'dropdown';
- $atts['class'] = 'dropdown-toggle';
- } else {
- $atts['href'] = ! empty( $item->url ) ? $item->url : '';
- }
-
- $atts = apply_filters( 'nav_menu_link_attributes', $atts, $item, $args );
-
- $attributes = '';
- foreach ( $atts as $attr => $value ) {
- if ( ! empty( $value ) ) {
- $value = ( 'href' === $attr ) ? esc_url( $value ) : esc_attr( $value );
- $attributes .= ' ' . $attr . '="' . $value . '"';
- }
- }
-
- $item_output = $args->before;
-
- /*
- * Glyphicons
- * ===========
- * Since the the menu item is NOT a Divider or Header we check the see
- * if there is a value in the attr_title property. If the attr_title
- * property is NOT null we apply it as the class name for the glyphicon.
- */
- if ( ! empty( $item->attr_title ) ) {
- $item_output .= ' ';
- } else {
- $item_output .= '';
- }
-
- $item_output .= $args->link_before . apply_filters( 'the_title', $item->title, $item->ID ) . $args->link_after;
- $item_output .= ( $args->has_children && 0 === $depth ) ? ' ' : '';
- $item_output .= $args->after;
-
- $output .= apply_filters( 'walker_nav_menu_start_el', $item_output, $item, $depth, $args );
- }
- }
-
- /**
- * Traverse elements to create list from elements.
- *
- * Display one element if the element doesn't have any children otherwise,
- * display the element and its children. Will only traverse up to the max
- * depth and no ignore elements under that depth.
- *
- * This method shouldn't be called directly, use the walk() method instead.
- *
- * @see Walker::start_el()
- *
- * @param object $element Data object.
- * @param array $children_elements List of elements to continue traversing.
- * @param int $max_depth Max depth to traverse.
- * @param int $depth Depth of current element.
- * @param array $args
- * @param string $output Passed by reference. Used to append additional content.
- *
- * @return null Null on failure with no changes to parameters.
- */
- public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) {
- if ( ! $element ) {
- return;
- }
-
- $id_field = $this->db_fields['id'];
-
- // Display this element.
- if ( is_object( $args[0] ) ) {
- $args[0]->has_children = ! empty( $children_elements[ $element->$id_field ] );
- }
-
- parent::display_element( $element, $children_elements, $max_depth, $depth, $args, $output );
- }
-
- /**
- * Menu Fallback
- * =============
- * If this function is assigned to the wp_nav_menu's fallback_cb variable
- * and a manu has not been assigned to the theme location in the WordPress
- * menu manager the function with display nothing to a non-logged in user,
- * and will add a link to the WordPress menu manager if logged in as an admin.
- *
- * @param array $args passed from the wp_nav_menu function.
- */
- public static function fallback( $args ) {
- if ( current_user_can( 'manage_options' ) ) {
-
- extract( $args );
-
- $fb_output = null;
-
- if ( $container ) {
- $fb_output = '<' . $container;
-
- if ( $container_id ) {
- $fb_output .= ' id="' . $container_id . '"';
- }
-
- if ( $container_class ) {
- $fb_output .= ' class="' . $container_class . '"';
- }
-
- $fb_output .= '>';
- }
-
- $fb_output .= '' . __( 'Add a menu', 'odin' ) . ' ';
- $fb_output .= ' ';
-
- if ( $container ) {
- $fb_output .= '' . $container . '>';
- }
-
- echo $fb_output;
- }
- }
-}
diff --git a/core/classes/class-contact-form.php b/core/classes/class-contact-form.php
deleted file mode 100755
index eddbefb..0000000
--- a/core/classes/class-contact-form.php
+++ /dev/null
@@ -1,271 +0,0 @@
-id = $id;
- $this->to = $to;
- $this->cc = $cc;
- $this->bcc = $bcc;
- $this->attributes = $attributes;
- $this->attachment_type = $attachment_type;
-
- parent::__construct( $this->id, '', 'post', $this->attributes );
-
- // Hooks send_mail.
- add_action( 'odin_front_end_form_submitted_data_' . $this->id, array( $this, 'send_mail' ), 1, 2 );
- }
-
- /**
- * Set the mail content type.
- *
- * @param string $content_type Mail content type.
- */
- public function set_content_type( $content_type ) {
- if ( 'html' == $content_type ) {
- $this->content_type = 'text/html';
- }
- }
-
- /**
- * Set the mail subject.
- *
- * @param string $subject Mail subject.
- */
- public function set_subject( $subject ) {
- $this->subject = $subject;
- }
-
- /**
- * Mail Reply-To.
- *
- * @param string
- */
- public function set_reply_to( $reply_to ) {
- $this->reply_to = $reply_to;
- }
-
- /**
- * Process the sent form data.
- *
- * @param array $submitted_data Submitted data.
- * @param array $$attachments Submitted attachments.
- *
- * @return array Processed sent data.
- */
- protected function process_submitted_form_data( $submitted_data, $attachments ) {
- $data = array();
-
- // Process the fields.
- if ( ! empty( $this->fields ) && ! empty( $submitted_data ) ) {
- foreach ( $this->fields as $fieldset ) {
- foreach ( $fieldset['fields'] as $field ) {
- if ( 'file' != $field['type'] ) {
- $id = $field['id'];
- $label = isset( $field['label'] ) ? $field['label'] : $id;
-
- $data[ $label['text'] ] = $submitted_data[ $id ];
- } elseif ( 'file' == $field['type'] && 'url' == $this->attachment_type ) {
- $id = $field['id'];
- $label = isset( $field['label'] ) ? $field['label'] : $id;
- $url = $attachments[ $id ]['url'];
-
- $data[ $label['text'] ] = '' . $url . ' ';
- }
- }
- }
- }
-
- return $data;
- }
-
- /**
- * Build the mail message.
- *
- * @param array $submitted_data Form submitted data.
- * @param array $$attachments Form submitted attachments.
- *
- * @return string Mail HTML message.
- */
- protected function build_mail_message( $submitted_data, $attachments ) {
- // Sets the message header.
- $message = apply_filters( 'odin_contact_form_message_header_' . $this->id, '' );
-
- // Gets the submitted data.
- $data = $this->process_submitted_form_data( $submitted_data, $attachments );
-
- // Sets the message content.
- foreach ( $data as $label => $value ) {
- if ( 'text/html' == $this->content_type ) {
- $message .= sprintf( '%s: %s', wp_kses( $label, array() ), wpautop( wp_kses( $value, array() ) ) );
- } else {
- $message .= sanitize_text_field( $label . ': ' . $value ) . PHP_EOL;
- }
- }
-
- // Sets the message footer.
- $message .= apply_filters( 'odin_contact_form_message_footer_' . $this->id, '' );
-
- return $message;
- }
-
- /**
- * Build the mail subject.
- *
- * @param array $submitted_data Form submitted data.
- *
- * @return string Mail subject.
- */
- protected function build_mail_subject( $submitted_data ) {
- if ( ! empty( $this->subject ) ) {
- $subject = $this->subject;
-
- // Create the placeholders.
- $placeholders = array_merge(
- array(
- 'form_id' => $this->id,
- 'sent_date' => date( get_option( 'date_format' ) ),
- 'sent_time' => date( get_option( 'time_format' ) )
- ),
- $submitted_data
- );
-
- // Process the placeholders.
- foreach ( $placeholders as $placeholder => $value ) {
- $subject = str_replace( '[' . $placeholder . ']', sanitize_text_field( $value ), $subject );
- }
-
- return $subject;
- } else {
- // Default subject.
- return sprintf(
- __( 'Message sent by the form %s in %s at %s', 'odin' ),
- $this->id,
- date( get_option( 'date_format' ) ),
- date( get_option( 'time_format' ) )
- );
- }
- }
-
- /**
- * Get attachments paths.
- *
- * @param array $attachments Submitted attachments.
- *
- * @return array Paths.
- */
- protected function get_attachments_paths( $attachments ) {
- $paths = array();
-
- foreach ( $attachments as $attachment ) {
- $paths[] = $attachment['file'];
- }
-
- return $paths;
- }
-
- /**
- * Format the mail headers.
- *
- * @param array $submitted_data Form submitted data.
- *
- * @return array Mail headers.
- */
- protected function format_mail_headers( $submitted_data ) {
- $headers = array();
-
- // Cc.
- if ( ! empty( $this->cc ) ) {
- foreach ( $this->cc as $cc ) {
- $headers[] = 'Cc: ' . $cc;
- }
- }
-
- // Bc.
- if ( ! empty( $this->bcc ) ) {
- foreach ( $this->bcc as $bcc ) {
- $headers[] = 'Bcc: ' . $bcc;
- }
- }
-
- // Reply-To.
- if ( ! empty( $this->reply_to ) ) {
- $headers[] = 'Reply-To: ' . sanitize_email( $submitted_data[ $this->reply_to ] );
- }
-
- // Content type.
- if ( 'text/html' == $this->content_type ) {
- $headers[] = 'Content-type: text/html; charset=' . get_bloginfo( 'charset' );
- }
-
- return apply_filters( 'odin_contact_form_mail_headers_' . $this->id, $headers );
- }
-
- /**
- * Send the mail.
- *
- * @param array $submitted_data Submitted form data.
- */
- public function send_mail( $submitted_data, $attachments ) {
- if ( ! empty( $submitted_data ) ) {
- // Mail subject.
- $subject = $this->build_mail_subject( $submitted_data );
-
- // Mail message.
- $message = $this->build_mail_message( $submitted_data, $attachments );
-
- // Mail headers.
- $headers = $this->format_mail_headers( $submitted_data );
-
- // Send mail.
- if ( 0 < count( $attachments ) && 'file' == $this->attachment_type ) {
- $files = $this->get_attachments_paths( $attachments );
- } else {
- $files = '';
- }
-
- wp_mail( $this->to, $subject, $message, $headers, $files );
- }
- }
-
-}
diff --git a/core/classes/class-metabox.php b/core/classes/class-metabox.php
deleted file mode 100644
index a9b00ea..0000000
--- a/core/classes/class-metabox.php
+++ /dev/null
@@ -1,610 +0,0 @@
-id = $id;
- $this->title = $title;
- $this->post_type = $post_type;
- $this->context = $context;
- $this->priority = $priority;
- $this->nonce = $id . '_nonce';
-
- // Add Metabox.
- add_action( 'add_meta_boxes', array( $this, 'add' ) );
-
- // Save Metaboxs.
- add_action( 'save_post', array( $this, 'save' ) );
-
- // Load scripts.
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
-
- //Check if $post_type is an array. If not, makes it one.
- if( !is_array($post_type) ){
- $post_type = array( $post_type );
- }
-
- //Run trough the array, setting up nedded things
- foreach($post_type as $p_type) {
- // For each post type, add post type columns
- add_filter( 'manage_edit-' . $p_type . '_columns', array($this, 'add_columns' ));
-
- // Set post type columns value
- add_action( 'manage_' . $p_type . '_posts_custom_column', array($this, 'set_columns_value'), 10,2);
- }
-
- }
-
- /**
- * Get the post typea.
- *
- * @return array
- */
- protected function get_post_type() {
- return is_array( $this->post_type ) ? $this->post_type : array( $this->post_type );
- }
-
- /**
- * Load metabox scripts.
- */
- public function scripts() {
- $screen = get_current_screen();
-
- if ( in_array( $screen->id, $this->get_post_type() ) ) {
- // Color Picker.
- wp_enqueue_style( 'wp-color-picker' );
- wp_enqueue_script( 'wp-color-picker' );
-
- // Media Upload.
- wp_enqueue_media();
-
- // jQuery UI.
- wp_enqueue_script( 'jquery-ui-sortable' );
-
- // Metabox.
- wp_enqueue_script( 'odin-admin', get_template_directory_uri() . '/core/assets/js/admin.js', array( 'jquery' ), null, true );
- wp_enqueue_style( 'odin-admin', get_template_directory_uri() . '/core/assets/css/admin.css', array(), null, 'all' );
-
- // Localize strings.
- wp_localize_script(
- 'odin-admin',
- 'odinAdminParams',
- array(
- 'galleryTitle' => __( 'Add images in gallery', 'odin' ),
- 'galleryButton' => __( 'Add in gallery', 'odin' ),
- 'galleryRemove' => __( 'Remove image', 'odin' ),
- 'uploadTitle' => __( 'Choose a file', 'odin' ),
- 'uploadButton' => __( 'Add file', 'odin' ),
- )
- );
- }
- }
-
- /**
- * Add the metabox in edit screens.
- */
- public function add() {
- foreach ( $this->get_post_type() as $post_type ) {
- add_meta_box(
- $this->id,
- $this->title,
- array( $this, 'metabox' ),
- $post_type,
- $this->context,
- $this->priority
- );
- }
- }
-
- /**
- * Set metabox fields.
- *
- * @param array $fields Metabox fields.
- */
- public function set_fields( $fields = array() ) {
- $this->fields = $fields;
- }
-
- /**
- * Get field type by field ID
- *
- * @param string $field_id Field ID
- *
- * @return string Field type
- */
- protected function get_field_type_by_id( $field_id ) {
- foreach ( $this->fields as $field ) {
- if ( $field['id'] == $field_id ) {
- return $field['type'];
- }
- }
-
- return '';
- }
-
- /**
- * Check if index add_column is true
- *
- *
- * @return bool Field type
- */
- protected function check_field_is_column() {
- foreach ( $this->fields as $field ) {
- if ( isset( $field['add_column'] ) && $field['add_column'] ) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- * Metabox view.
- *
- * @param object $post Post object.
- *
- * @return string Metabox HTML fields.
- */
- public function metabox( $post ) {
- // Use nonce for verification.
- wp_nonce_field( basename( __FILE__ ), $this->nonce );
-
- $post_id = $post->ID;
-
- do_action( 'odin_metabox_header_' . $this->id, $post_id );
-
- echo apply_filters( 'odin_metabox_container_before_' . $this->id, '' );
-
- do_action( 'odin_metabox_footer_' . $this->id, $post_id );
-
- }
-
- /**
- * Process the metabox fields.
- *
- * @param array $args Field arguments
- * @param int $post_id ID of the current post type.
- *
- * @return string HTML of the field.
- */
- protected function process_fields( $args, $post_id ) {
- $id = $args['id'];
- $type = $args['type'];
- $options = isset( $args['options'] ) ? $args['options'] : '';
- $attrs = isset( $args['attributes'] ) ? $args['attributes'] : array();
-
- // Gets current value or default.
- $current = get_post_meta( $post_id, $id, true );
- if ( empty( $current ) ) {
- $current = isset( $args['default'] ) ? $args['default'] : '';
- }
-
- switch ( $type ) {
- case 'text':
- $this->field_input( $id, $current, array_merge( array( 'class' => 'regular-text' ), $attrs ) );
- break;
- case 'input':
- $this->field_input( $id, $current, $attrs );
- break;
- case 'textarea':
- $this->field_textarea( $id, $current, $attrs );
- break;
- case 'checkbox':
- $this->field_checkbox( $id, $current, $attrs );
- break;
- case 'select':
- $this->field_select( $id, $current, $options, $attrs );
- break;
- case 'radio':
- $this->field_radio( $id, $current, $options, $attrs );
- break;
- case 'editor':
- $this->field_editor( $id, $current, $options );
- break;
- case 'color':
- $this->field_input( $id, $current, array_merge( array( 'class' => 'odin-color-field' ), $attrs ) );
- break;
- case 'upload':
- $this->field_upload( $id, $current, $attrs );
- break;
- case 'image':
- $this->field_image( $id, $current );
- break;
- case 'image_plupload':
- $this->field_image_plupload( $id, $current );
- break;
-
- default:
- do_action( 'odin_metabox_field_' . $this->id, $type, $id, $current, $options, $attrs );
- break;
- }
- }
-
- /**
- * Build field attributes.
- *
- * @param array $attrs Attributes as array.
- *
- * @return string Attributes as string.
- */
- protected function build_field_attributes( $attrs ) {
- $attributes = '';
-
- if ( ! empty( $attrs ) ) {
- foreach ( $attrs as $key => $attr ) {
- $attributes .= ' ' . $key . '="' . $attr . '"';
- }
- }
-
- return $attributes;
- }
-
- /**
- * Add post columns
- *
- * @param array $columns Default WordPress Columns
- *
- * @return array Columns
- */
- public function add_columns( $columns ) {
- foreach ( $this->fields as $key => $field ) {
- if ( isset( $field['add_column'] ) && $field['add_column'] ) {
- $columns[ $field['id'] ] = $field['label'];
- }
- }
-
- return $columns;
- }
-
- /**
- * Set value for each column
- *
- * @param string $column $column
- * @param int $column $post_id
- *
- * @return string Value
- */
- public function set_columns_value( $column , $post_id ) {
- $type = $this->get_field_type_by_id( $column );
- $is_column = $this->check_field_is_column();
- if ( ! $is_column ) {
- return;
- }
-
- switch ( $type ) {
- case 'image' :
- case 'image_plupload' :
- $value = wp_get_attachment_image( get_post_meta( $post_id, $column, true ) , array( 50, 50 ) );
- break;
- default :
- $value = apply_filters( 'admin_post_column_value_' . $this->post_type . '_' . $column, get_post_meta( $post_id, $column, true ) );
- break;
- }
-
- echo $value;
- }
-
- /**
- * Input field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_input( $id, $current, $attrs ) {
- if ( ! isset( $attrs['type'] ) ) {
- $attrs['type'] = 'text';
- }
-
- echo sprintf( ' ', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Textarea field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_textarea( $id, $current, $attrs ) {
- if ( ! isset( $attrs['cols'] ) ) {
- $attrs['cols'] = '60';
- }
-
- if ( ! isset( $attrs['rows'] ) ) {
- $attrs['rows'] = '5';
- }
-
- echo sprintf( '', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Checkbox field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_checkbox( $id, $current, $attrs ) {
- echo sprintf( ' ', $id, checked( 'yes', $current, false ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Select field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with select options.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_select( $id, $current, $options, $attrs ) {
- // If multiple add a array in the option.
- $multiple = ( in_array( 'multiple', $attrs ) ) ? '[]' : '';
-
- $html = sprintf( '', $id, $multiple, $this->build_field_attributes( $attrs ) );
-
- foreach ( $options as $key => $label ) {
- $selected = $this->is_selected( $current, $key );
- $html .= sprintf( '%s ', $key, $selected, $label );
- }
-
- $html .= ' ';
-
- echo $html;
- }
-
- /**
- * Current value is selected.
- *
- * @param array/string $current Field current value.
- * @param string $key Actual option value.
- *
- * @return boolean $current is selected or not.
- */
- protected function is_selected( $current, $key ) {
- $selected = false;
- if ( is_array( $current ) ) {
- for ( $i = 0; $i < count( $current ); $i++ ) {
- if ( selected( $current[ $i ], $key, false ) ) {
- $selected = selected( $current[ $i ], $key, false );
- break 1;
- }
- }
- } else {
- $selected = selected( $current, $key, false );
- }
-
- return $selected;
- }
-
- /**
- * Radio field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with input options.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_radio( $id, $current, $options, $attrs ) {
- $html = '';
-
- foreach ( $options as $key => $label ) {
- $html .= sprintf( ' %4$s ', $id, $key, checked( $current, $key, false ), $label, $this->build_field_attributes( $attrs ) );
- }
-
- echo $html;
- }
-
- /**
- * Editor field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with wp_editor options.
- *
- * @return string HTML of the field.
- */
- protected function field_editor( $id, $current, $options ) {
- // Set default options.
- if ( empty( $options ) ) {
- $options = array( 'textarea_rows' => 10 );
- }
-
- $options[ 'textarea_name' ] = $id;
-
- echo '';
- wp_editor( wpautop( $current ), $id, $options );
- echo '
';
- }
-
- /**
- * Upload field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_upload( $id, $current, $attrs ) {
- echo sprintf( ' ', $id, esc_url( $current ), __( 'Select file', 'odin' ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Image field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- *
- * @return string HTML of the field.
- */
- protected function field_image( $id, $current ) {
-
- // Gets placeholder image.
- $image = apply_filters( 'odin_placeholder_path', get_template_directory_uri() . '/core/assets/images/placeholder.png' );
- $html = '';
- $html .= '
' . $image . ' ';
-
- if ( $current ) {
- $image = wp_get_attachment_image_src( $current, 'thumbnail' );
- $image = $image[0];
- }
-
- $html .= sprintf( '
', $id, $current, $image, __( 'Select image', 'odin' ), __( 'Remove image', 'odin' ) );
-
- $html .= '
';
- $html .= '
';
-
- echo $html;
- }
-
- /**
- * Image plupload field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- *
- * @return string HTML of the field.
- */
- protected function field_image_plupload( $id, $current ) {
- $html = '';
- $html .= '
';
- if ( ! empty( $current ) ) {
- // Gets the current images.
- $attachments = array_filter( explode( ',', $current ) );
-
- if ( $attachments ) {
- foreach ( $attachments as $attachment_id ) {
- $html .= sprintf( '%2$s ',
- $attachment_id,
- wp_get_attachment_image( $attachment_id, 'thumbnail' ),
- __( 'Remove image', 'odin' )
- );
- }
- }
- }
- $html .= '
';
-
- // Adds the hidden input.
- $html .= sprintf( '
', $id, $current );
-
- // Adds "adds images in gallery" url.
- $html .= sprintf( '
%s
', __( 'Add images in gallery', 'odin' ) );
- $html .= '
';
-
- echo $html;
- }
-
- /**
- * Save metabox data.
- *
- * @param int $post_id Current post type ID.
- */
- public function save( $post_id ) {
- // Verify nonce.
- if ( ! isset( $_POST[ $this->nonce ] ) || ! wp_verify_nonce( $_POST[ $this->nonce ], basename( __FILE__ ) ) ) {
- return $post_id;
- }
-
- // Verify if this is an auto save routine.
- if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
- return $post_id;
- }
-
- // Check permissions.
- if ( isset( $_POST['post_type'] ) && in_array( $_POST['post_type'], $this->get_post_type() ) ) {
- if ( ! current_user_can( 'edit_page', $post_id ) ) {
- return $post_id;
- }
- } elseif ( ! current_user_can( 'edit_post', $post_id ) ) {
- return $post_id;
- }
-
- foreach ( $this->fields as $field ) {
- $name = $field['id'];
-
- if( 'checkbox' === $field['type'] ) {
- $value = isset( $_POST[ $name ] ) ? 'yes' : 'no';
- } else {
- $value = isset( $_POST[ $name ] ) ? $_POST[ $name ] : null;
- }
-
- if ( ! in_array( $field['type'], array( 'separator', 'title' ) ) ) {
- $old = get_post_meta( $post_id, $name, true );
-
- $new = apply_filters( 'odin_save_metabox_' . $this->id, $value, $name );
-
- if ( $new && $new != $old ) {
- update_post_meta( $post_id, $name, $new );
- } elseif ( '' == $new && $old ) {
- delete_post_meta( $post_id, $name, $old );
- }
- }
- }
-
- }
-
-}
diff --git a/core/classes/class-options-helper.php b/core/classes/class-options-helper.php
deleted file mode 100644
index 4a6b85b..0000000
--- a/core/classes/class-options-helper.php
+++ /dev/null
@@ -1,126 +0,0 @@
-set_option_father( $option_father );
-
- /**
- * Set the option child property.
- */
- $this->set_option_child( $option_child );
-
- /**
- * Discover the option child value.
- */
- $this->get_option_value();
- }
-
- /**
- * Getter of Option Father.
- *
- * @return string option_father property.
- */
- public function get_option_father() {
- return $this->option_father;
- }
-
- /**
- * Getter of Option Child.
- *
- * @return string option_child property.
- */
- public function get_option_child() {
- return $this->option_child;
- }
-
- /**
- * Getter of Option Child Value.
- *
- * @return string option_child_value property.
- */
- public function get_option_child_value() {
- return $this->option_child_value;
- }
-
- /**
- * Setter of Option Father.
- *
- * @param string $option_father Option father.
- */
- public function set_option_father( $option_father ) {
- $this->option_father = $option_father;
- }
-
- /**
- * Setter of Option Child.
- *
- * @param string $option_child Option child.
- */
- public function set_option_child( $option_child ) {
- $this->option_child = $option_child;
- }
-
- /**
- * Setter of Option Child Value.
- *
- * @param string $option_child_value Option child value.
- */
- public function set_option_child_value( $option_child_value ) {
- $this->option_child_value = $option_child_value;
- }
-
- /**
- * Discover the option child value.
- */
- private function get_option_value() {
- $option_father_object = get_option( $this->option_father );
-
- $option_value = $option_father_object[ $this->option_child ];
-
- $this->set_option_child_value( $option_value );
- }
-
- /**
- * Automagic __toString() method to returns the Option Child value.
- *
- * @return string $option_child_value Option Child value.
- */
- public function __toString() {
- return $this->option_child_value;
- }
-}
diff --git a/core/classes/class-post-form.php b/core/classes/class-post-form.php
deleted file mode 100644
index e5d9d6a..0000000
--- a/core/classes/class-post-form.php
+++ /dev/null
@@ -1,160 +0,0 @@
-id = $id;
- $this->post_type = $post_type;
- $this->post_status = $post_status;
- $this->attributes = $attributes;
-
- parent::__construct( $this->id, '', 'post', $this->attributes );
-
- // Hooks save_post.
- add_action( 'odin_front_end_form_submitted_data_' . $this->id, array( $this, 'save_post' ) );
- }
-
- /**
- * Set the post content field.
- *
- * @param string $content_field Content field.
- */
- public function set_content_field( $content_field ) {
- $this->content_field = $content_field;
- }
-
- /**
- * Set the post title field.
- *
- * @param string $title_field Title field.
- */
- public function set_title_field( $title_field ) {
- $this->title_field = $title_field;
- }
-
- /**
- * Set the post custom fields.
- *
- * @param string $custom_fields Title field.
- */
- public function set_custom_fields( $custom_fields = array() ) {
- $this->custom_fields = $custom_fields;
- }
-
- /**
- * Set the post terms.
- *
- * @param string $terms Terms.
- */
- public function set_terms( $terms = array() ) {
- $this->terms = $terms;
- }
-
- /**
- * Save custom fields.
- *
- * @param int $post_id Post ID.
- * @param array $submitted_data Submitted form data.
- */
- protected function save_custom_fields( $post_id, $submitted_data ) {
- if ( ! empty( $this->custom_fields ) ) {
- foreach ( $this->custom_fields as $key ) {
- // Apply filter to sanitization.
- $data = apply_filters( 'odin_post_form_custom_field_data_' . $this->id, $submitted_data[ $key ] );
-
- // Save custom field.
- update_post_meta( $post_id, $key, $data );
- }
- }
- }
-
- /**
- * Save terms.
- *
- * @param int $post_id Post ID.
- * @param array $submitted_data Submitted form data.
- */
- protected function save_terms( $post_id, $submitted_data ) {
- if ( ! empty( $this->terms ) ) {
- foreach ( $this->terms as $taxonomy => $term ) {
- // Apply filter to sanitization.
- $term = apply_filters( 'odin_post_form_term_data_' . $this->id, $submitted_data[ $term ] );
-
- // Save term.
- wp_set_post_terms( $post_id, $term, $taxonomy );
- }
- }
- }
-
- /**
- * Save post.
- *
- * @param array $submitted_data Submitted form data.
- */
- public function save_post( $submitted_data ) {
- if ( ! empty( $submitted_data ) ) {
- $post_data = apply_filters( 'odin_post_form_insert_data_' . $this->id, array(
- 'post_content' => $submitted_data[ $this->content_field ],
- 'post_status' => $this->post_status,
- 'post_title' => sanitize_text_field( $submitted_data[ $this->title_field ] ),
- 'post_type' => $this->post_type,
- ), $submitted_data );
-
- // Save post.
- $post_id = wp_insert_post( $post_data );
-
- // Save custom fields.
- $this->save_custom_fields( $post_id, $submitted_data );
-
- // Save terms.
- $this->save_terms( $post_id, $submitted_data );
-
- do_action( 'odin_post_form_after_save_' . $this->id, $post_id, $submitted_data );
- }
- }
-}
diff --git a/core/classes/class-post-status.php b/core/classes/class-post-status.php
deleted file mode 100644
index 7689aea..0000000
--- a/core/classes/class-post-status.php
+++ /dev/null
@@ -1,124 +0,0 @@
-post_status = $post_status;
- $this->post_types = $post_types;
- $this->action_label = isset( $args['label'] ) ? $args['label'] : $post_status;
- $this->applied_label = isset( $args['applied_label'] ) ? $args['applied_label'] : $this->action_label;
- $this->args = $args;
-
- // Removes the arguments that do not belong to register_post_type
- unset( $this->args['applied_label'] );
-
- if( ! isset( $this->args['label_count'] ) ) {
- $this->args['label_count'] = _n_noop( $this->applied_label . ' (%s) ', $this->applied_label . ' (%s) ', 'odin' );
- }
-
- // Register post status
- add_action( 'init', array( $this, 'register_post_status' ) );
-
- // Add meta tags to pass args
- add_action( 'admin_head', array( $this, 'meta_tags' ) );
-
- // Load scripts
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
-
- }
-
- /**
- * Register the Custom Post Status with Wordpress ;)
- *
- * @param string $post_status The name of Custom Post Status.
- * @param array $args Array of arguments to pass register_post_status()
- **/
- public function register_post_status() {
- register_post_status( $this->post_status, $this->args );
- }
-
- /**
- * Add meta tags to JS
- */
- public function meta_tags() {
- $screen = get_current_screen();
- if( ! in_array( $screen->post_type, $this->post_types ) ) {
- return;
- }
-
- $args = array(
- 'postTypes' => $this->post_types,
- 'appliedLabel' => $this->applied_label,
- 'slug' => $this->post_status,
- );
- if( $screen->base === 'post' ) {
- global $post;
- if( is_object( $post ) && $post->post_status === $this->post_status ) {
- $args['select'] = true;
- }
- }
- printf( ' ', esc_attr( json_encode( $args ) ) );
- }
-
- /**
- * Load post status scripts and inject JS vars
- */
- public function scripts() {
- // Load admin JS
- wp_enqueue_script( 'odin-custom-status', get_template_directory_uri() . '/core/assets/js/admin-custom-status.js', array( 'jquery' ), null, true );
-
- }
-}
diff --git a/core/classes/class-post-type.php b/core/classes/class-post-type.php
deleted file mode 100644
index 028c8c8..0000000
--- a/core/classes/class-post-type.php
+++ /dev/null
@@ -1,118 +0,0 @@
-name = $name;
- $this->slug = $slug;
-
- // Register post type.
- add_action( 'init', array( &$this, 'register_post_type' ) );
- }
-
- /**
- * Set custom labels.
- *
- * @param array $labels Custom labels.
- */
- public function set_labels( $labels = array() ) {
- $this->labels = $labels;
- }
-
- /**
- * Set custom arguments.
- *
- * @param array $arguments Custom arguments.
- */
- public function set_arguments( $arguments = array() ) {
- $this->arguments = $arguments;
- }
-
- /**
- * Define Post Type labels.
- *
- * @return array Post Type labels.
- */
- protected function labels() {
- $default = array(
- 'name' => sprintf( __( '%ss', 'odin' ), $this->name ),
- 'singular_name' => sprintf( __( '%s', 'odin' ), $this->name ),
- 'view_item' => sprintf( __( 'View %s', 'odin' ), $this->name ),
- 'edit_item' => sprintf( __( 'Edit %s', 'odin' ), $this->name ),
- 'search_items' => sprintf( __( 'Search %s', 'odin' ), $this->name ),
- 'update_item' => sprintf( __( 'Update %s', 'odin' ), $this->name ),
- 'parent_item_colon' => sprintf( __( 'Parent %s:', 'odin' ), $this->name ),
- 'menu_name' => sprintf( __( '%ss', 'odin' ), $this->name ),
- 'add_new' => __( 'Add New', 'odin' ),
- 'add_new_item' => sprintf( __( 'Add New %s', 'odin' ), $this->name ),
- 'new_item' => sprintf( __( 'New %s', 'odin' ), $this->name ),
- 'all_items' => sprintf( __( 'All %ss', 'odin' ), $this->name ),
- 'not_found' => sprintf( __( 'No %s found', 'odin' ), $this->name ),
- 'not_found_in_trash' => sprintf( __( 'No %s found in Trash', 'odin' ), $this->name )
- );
-
- return array_merge( $default, $this->labels );
- }
-
- /**
- * Define Post Type arguments.
- *
- * @return array Post Type arguments.
- */
- protected function arguments() {
- $default = array(
- 'labels' => $this->labels(),
- 'hierarchical' => false,
- 'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'revisions' ),
- 'public' => true,
- 'show_ui' => true,
- 'show_in_menu' => true,
- 'show_in_nav_menus' => false,
- 'publicly_queryable' => true,
- 'exclude_from_search' => false,
- 'has_archive' => true,
- 'query_var' => true,
- 'can_export' => true,
- 'rewrite' => true,
- 'capability_type' => 'post'
- );
-
- return array_merge( $default, $this->arguments );
- }
-
- /**
- * Register Post Type.
- */
- public function register_post_type() {
- register_post_type( $this->slug, $this->arguments() );
- }
-}
diff --git a/core/classes/class-shortcodes-menu.php b/core/classes/class-shortcodes-menu.php
deleted file mode 100644
index edfe3ee..0000000
--- a/core/classes/class-shortcodes-menu.php
+++ /dev/null
@@ -1,77 +0,0 @@
- 'default',
- 'size' => false,
- 'link' => '#',
- 'class' => false,
- 'tooltip' => false,
- 'direction' => 'top'
- ), $atts ) );
-
- $html = ' 'group',
- 'size' => false,
- 'justified' => false
- ), $atts ) );
-
- $html = '';
- $html .= str_replace( ' ', '', do_shortcode( $content ) );
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Alert shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Alert HTML.
- */
- function alert( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'type' => 'info',
- 'close' => false
- ), $atts ) );
-
- $html = '× ' : '">';
- $html .= do_shortcode( $content );
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Label shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Label HTML.
- */
- function label( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'type' => 'default'
- ), $atts ) );
-
- return '' . do_shortcode( $content ) . ' ';
- }
-
- /**
- * Badge shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Badge HTML.
- */
- function badge( $atts, $content = null ) {
- return '' . do_shortcode( $content ) . ' ';
- }
-
- /**
- * Icon shortcode.
- *
- * @param array $atts Shortcode attributes.
- *
- * @return string Icon HTML.
- */
- function icon( $atts ) {
- extract( shortcode_atts( array(
- 'type' => 'thumbs-up'
- ), $atts ) );
-
- return ' ';
- }
-
- /**
- * Well shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Well HTML.
- */
- function well( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'size' => false
- ), $atts ) );
-
- $html = '' : '">';
- $html .= do_shortcode( $content );
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Table shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Table HTML.
- */
- function table( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'type' => false,
- 'border' => false,
- 'cols' => '',
- 'rows' => ''
- ), $atts ) );
-
- $html = ' ' . PHP_EOL : '">' . PHP_EOL;
- $html .= '' . PHP_EOL;
- $html .= '' . PHP_EOL;
-
- foreach ( explode( ',', $cols ) as $col ) {
- $html .= '' . $col . ' ' . PHP_EOL;
- }
-
- $html .= ' ' . PHP_EOL;
- $html .= ' ' . PHP_EOL;
- $html .= '' . PHP_EOL;
-
- foreach ( explode( '|', $rows ) as $row ) {
- $html .= '' . PHP_EOL;
-
- foreach ( explode( ',', $row ) as $item ) {
- $html .= '' . $item . ' ' . PHP_EOL;
- }
-
- $html .= ' ' . PHP_EOL;
- }
-
- $html .= ' ' . PHP_EOL;
- $html .= '
' . PHP_EOL;
-
- return $html;
- }
-
- /**
- * Row shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Row HTML.
- */
- function row( $atts, $content = null ) {
- return '' . str_replace( 'div> ', 'div>', do_shortcode( $content ) ) . '
';
- }
-
- /**
- * Col shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Col HTML.
- */
- function col( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'class' => false
- ), $atts ) );
-
- $html = ' false,
- 'class' => false,
- 'value' => 50,
- 'max' => 100,
- 'min' => 0
- ), $atts ) );
-
- $html = '
' : '">';
- $html .= '
';
- $html .= ( $content ) ? '' . $content . ' ' : '';
- $html .= '
';
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Panel shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Panel HTML.
- */
- function panel( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'type' => 'default'
- ), $atts ) );
-
- return '
' . str_replace( ' ', '', do_shortcode( $content ) ) . '
';
- }
-
- /**
- * Panel Heading shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Panel Heading HTML.
- */
- function panel_heading( $atts, $content = null ) {
- return '
' . do_shortcode( $content ) . '
';
- }
-
- /**
- * Panel Body shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Panel Body HTML.
- */
- function panel_body( $atts, $content = null ) {
- return '
' . do_shortcode( $content ) . '
';
- }
-
- /**
- * Panel Footer shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Panel Footer HTML.
- */
- function panel_footer( $atts, $content = null ) {
- return '';
- }
-
- /**
- * Tabs shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Tabs HTML.
- */
- function tabs( $atts, $content = null ) {
- return '
' . str_replace( ' ', '', do_shortcode( $content ) ) . ' ';
- }
-
- /**
- * Tab shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Tab HTML.
- */
- function tab( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'id' => '',
- 'active' => false
- ), $atts ) );
-
- $html = '
';
- $html .= do_shortcode( $content );
- $html .= '';
- $html .= ' ';
-
- return $html;
- }
-
- /**
- * Tab Dropdown shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Tab Dropdown HTML.
- */
- function tab_dropdown( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'title' => '',
- ), $atts ) );
-
- $id = sanitize_title( $title );
-
- $html = '
';
- $html .= '';
- $html .= $title;
- $html .= ' ';
- $html .= ' ';
- $html .= '';
- $html .= ' ';
-
- return $html;
- }
-
- /**
- * Tabs Contents shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Tabs Contents HTML.
- */
- function tab_contents( $atts, $content = null ) {
- return '
' . str_replace( ' ', '', do_shortcode( $content ) ) . '
';
- }
-
- /**
- * Tabs Content shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Tabs Content HTML.
- */
- function tab_content( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'id' => '',
- 'active' => false,
- ), $atts ) );
-
- $html = '
';
- $html .= do_shortcode( $content );
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Accordions shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Accordions HTML.
- */
- function accordions( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'id' => 'odin-accordion',
- ), $atts ) );
-
- $html = '
';
- $html .= str_replace( ' ', '', do_shortcode( $content ) );
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Accordion shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Accordion HTML.
- */
- function accordion( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'id' => 'odin-accordion',
- 'title' => '',
- 'type' => 'default',
- 'active' => false
- ), $atts ) );
-
- $accordion = sanitize_title( $title );
-
- $html = '
';
- $html .= '
';
- $html .= '
' : '">';
- $html .= '
';
- $html .= do_shortcode( $content );
- $html .= '
';
- $html .= '
';
- $html .= '
';
-
- return $html;
- }
-
- /**
- * Tooltip shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Tooltip HTML.
- */
- function tooltip( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'title' => '',
- 'link' => '#',
- 'direction' => 'top'
- ), $atts ) );
-
- $html = '
';
- $html .= do_shortcode( $content );
- $html .= ' ';
-
- return $html;
- }
-
- /**
- * Google Maps shortcode.
- *
- * @param array $atts Shortcode attributes.
- * @param string $content Content.
- *
- * @return string Google Maps HTML.
- */
- function map( $atts, $content = null ) {
- extract( shortcode_atts( array(
- 'id' => 'odin_map',
- 'latitude' => '0',
- 'longitude' => '0',
- 'zoom' => '10',
- 'width' => '600',
- 'height' => '400',
- 'maptype' => 'ROADMAP',
- 'address' => false,
- 'kml' => false,
- 'kmlautofit' => true,
- 'marker' => false,
- 'markerimage' => false,
- 'traffic' => false,
- 'bike' => false,
- 'fusion' => false,
- 'infowindow' => false,
- 'infowindowdefault' => true,
- 'hidecontrols' => 'false',
- 'scale' => 'false',
- 'scrollwheel' => 'true'
- ), $atts ) );
-
- // JS var.
- $id = str_replace( '-', '_', $id );
-
- $html = '
';
-
- $js = '';
- $html .= apply_filters( 'odin_map_shortcode_js_' . $id, $js );
- $html .= '';
-
- return $html;
- }
-
- /**
- * QR Code shortcode.
- *
- * @param array $atts Shortcode attributes.
- *
- * @return string QR Code HTML.
- */
- function qrcode( $atts ) {
- extract( shortcode_atts( array(
- 'data' => '',
- 'size' => '150x150',
- 'title' => '',
- 'alt' => '',
- ), $atts ) );
-
- $url = 'http://api.qrserver.com/v1/create-qr-code/?data=' . rawurlencode( $data ) . '&size=' . $size;
-
- return '
';
- }
-
- /**
- * Clear Float shortcode.
- *
- * @param array $atts Shortcode attributes.
- *
- * @return string Clear Float HTML.
- */
- function clear( $atts ) {
- return '
';
- }
-
-}
-
-new Odin_Shortcodes;
diff --git a/core/classes/class-taxonomy.php b/core/classes/class-taxonomy.php
deleted file mode 100644
index 17e2b4e..0000000
--- a/core/classes/class-taxonomy.php
+++ /dev/null
@@ -1,114 +0,0 @@
-name = $name;
- $this->slug = $slug;
- $this->object_type = $object_type;
-
- // Register Taxonomy.
- add_action( 'init', array( &$this, 'register_taxonomy' ) );
- }
-
- /**
- * Set custom labels.
- *
- * @param array $labels Custom labels.
- */
- public function set_labels( $labels = array() ) {
- $this->labels = $labels;
- }
-
- /**
- * Set custom arguments.
- *
- * @param array $arguments Custom arguments.
- */
- public function set_arguments( $arguments = array() ) {
- $this->arguments = $arguments;
- }
-
- /**
- * Define Taxonomy labels.
- *
- * @return array Taxonomy labels.
- */
- protected function labels() {
- $default = array(
- 'name' => sprintf( __( '%ss', 'odin' ), $this->name ),
- 'singular_name' => sprintf( __( '%s', 'odin' ), $this->name ),
- 'add_or_remove_items' => sprintf( __( 'Add or Remove %ss', 'odin' ), $this->name ),
- 'view_item' => sprintf( __( 'View %s', 'odin' ), $this->name ),
- 'edit_item' => sprintf( __( 'Edit %s', 'odin' ), $this->name ),
- 'search_items' => sprintf( __( 'Search %s', 'odin' ), $this->name ),
- 'update_item' => sprintf( __( 'Update %s', 'odin' ), $this->name ),
- 'parent_item' => sprintf( __( 'Parent %s:', 'odin' ), $this->name ),
- 'parent_item_colon' => sprintf( __( 'Parent %s:', 'odin' ), $this->name ),
- 'menu_name' => sprintf( __( '%ss', 'odin' ), $this->name ),
- 'add_new_item' => sprintf( __( 'Add New %s', 'odin' ), $this->name ),
- 'new_item_name' => sprintf( __( 'New %s', 'odin' ), $this->name ),
- 'all_items' => sprintf( __( 'All %ss', 'odin' ), $this->name ),
- 'separate_items_with_commas' => sprintf( __( 'Separate %ss with comma', 'odin' ), $this->name ),
- 'choose_from_most_used' => sprintf( __( 'Choose from %ss most used', 'odin' ), $this->name )
- );
-
- return array_merge( $default, $this->labels );
- }
-
- /**
- * Define Taxonomy arguments.
- *
- * @return array Taxonomy arguments.
- */
- protected function arguments() {
- $default = array(
- 'labels' => $this->labels(),
- 'hierarchical' => true, // Like categories.
- 'public' => true,
- 'show_ui' => true,
- 'show_admin_column' => true,
- 'show_in_nav_menus' => true,
- 'show_tagcloud' => true,
- );
-
- return array_merge( $default, $this->arguments );
- }
-
- /**
- * Register Taxonomy.
- */
- public function register_taxonomy() {
- register_taxonomy( $this->slug, $this->object_type, $this->arguments() );
- }
-}
diff --git a/core/classes/class-term-meta.php b/core/classes/class-term-meta.php
deleted file mode 100644
index 5eec6f6..0000000
--- a/core/classes/class-term-meta.php
+++ /dev/null
@@ -1,520 +0,0 @@
-id = $id;
- $this->taxonomy = $taxonomy;
- $this->nonce = $this->id . '_nonce';
-
- if ( is_array( $this->taxonomy ) ) {
- foreach ( $this->taxonomy as $tax_slug ) {
- // Print Taxonomy fields.
- add_action( $tax_slug . '_add_form_fields', array( $this, 'add_view' ) );
- add_action( $tax_slug . '_edit_form_fields', array( $this, 'edit_view' ) );
- // Delete term fields.
- add_action( 'delete_' . $tax_slug, array( $this, 'delete_fields' ) );
- // Save term fields.
- add_action( 'create_' . $tax_slug, array( $this, 'save' ) );
- add_action( 'edit_' . $tax_slug, array( $this, 'save' ) );
- }
- } else {
- // Print Taxonomy fields.
- add_action( $this->taxonomy . '_add_form_fields', array( $this, 'add_view' ) );
- add_action( $this->taxonomy . '_edit_form_fields', array( $this, 'edit_view' ) );
- // Delete term fields.
- add_action( 'delete_' . $this->taxonomy, array( $this, 'delete_fields' ) );
- // Save term fields.
- add_action( 'create_' . $this->taxonomy, array( $this, 'save' ) );
- add_action( 'edit_' . $this->taxonomy, array( $this, 'save' ) );
- }
- // Load scripts.
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
- }
-
- /**
- * Load user meta scripts.
- */
- public function scripts() {
- // jQuery.
- wp_enqueue_script( 'jquery' );
-
- // Color Picker.
- wp_enqueue_style( 'wp-color-picker' );
- wp_enqueue_script( 'wp-color-picker' );
-
- // Media Upload.
- wp_enqueue_media();
-
- // jQuery UI.
- wp_enqueue_script( 'jquery-ui-sortable' );
-
- // user_meta.
- wp_enqueue_script( 'odin-admin', get_template_directory_uri() . '/core/assets/js/admin.js', array( 'jquery' ), null, true );
- wp_enqueue_style( 'odin-admin', get_template_directory_uri() . '/core/assets/css/admin.css', array(), null, 'all' );
-
- // Localize strings.
- wp_localize_script(
- 'odin-admin',
- 'odinAdminParams',
- array(
- 'galleryTitle' => __( 'Add images in gallery', 'odin' ),
- 'galleryButton' => __( 'Add in gallery', 'odin' ),
- 'galleryRemove' => __( 'Remove image', 'odin' ),
- 'uploadTitle' => __( 'Choose a file', 'odin' ),
- 'uploadButton' => __( 'Add file', 'odin' ),
- )
- );
- }
-
- /**
- * Set user meta fields.
- *
- * @param array $fields User meta fields.
- *
- * @return void
- */
- public function set_fields( $fields = array() ) {
- $this->fields = $fields;
- }
-
- /**
- * User meta view for add term page (without a table).
- *
- * @return string User meta HTML fields.
- */
- public function add_view() {
- // Use nonce for verification.
- wp_nonce_field( basename( __FILE__ ), $this->nonce );
-
- foreach ( $this->fields as $field ) {
-
- echo '
';
- }
- }
-
- /**
- * User meta view for edit page (inside a table).
- *
- * @return string User meta HTML fields.
- */
- public function edit_view() {
- // Use nonce for verification.
- wp_nonce_field( basename( __FILE__ ), $this->nonce );
-
- foreach ( $this->fields as $field ) {
-
- echo '
';
-
- echo sprintf( '%s ', $field['id'], $field['label'] );
-
- echo apply_filters( 'odin_term_meta_field_edit_screen_before_' . $this->id, '', $field );
- $this->process_fields( $field );
-
- if ( isset( $field['description'] ) ) {
- echo sprintf( '%s
', $field['description'] );
- }
-
- echo apply_filters( 'odin_term_meta_field_edit_screen__after_' . $this->id, ' ', $field );
-
- echo ' ';
- }
-
- echo '';
- }
-
- /**
- * Delete fields
- *
- * @param int $term Term id.
- */
- public function delete_fields( $term ) {
- global $wpdb;
-
- $option = sprintf( 'odin_term_meta_%s', $term );
- $option = '%' . $wpdb->esc_like( $option ) . '%';
-
- $wpdb->query( $wpdb->prepare( "DELETE FROM $wpdb->options WHERE option_name LIKE %s", $option ) );
- }
-
- /**
- * Get field value
- *
- * @param string $field Field name.
- *
- * @return string Field value.
- */
- protected function get_value( $id, $field ) {
- // First try to get value in the new Term Meta WP API.
- if ( $value = get_term_meta( $id, $field, true ) ) {
- return $value;
- }
-
- // After, try to get in the old way (option API).
- $option_name = sprintf( 'odin_term_meta_%s_%s', $id, $field );
- $value = get_option( $option_name );
-
- // Upgrade to new update_term_meta().
- if ( false !== $value ) {
- update_term_meta( $id, $field, $value );
- delete_option( $option_name );
- }
-
- return $value;
- }
-
- /**
- * Delete field meta.
- *
- * @param string $field Field name.
- *
- * @return string Field value.
- */
- protected function delete_term_meta( $id, $field ) {
- // First delete value from the Term Meta API (WP 4.4).
- if ( $option = get_term_meta( $id, $field ) ) {
- delete_term_meta( $id, $field );
- }
-
- // After, delete from the options API (old way)
- $option_name = sprintf( 'odin_term_meta_%s_%s', $id, $field );
- delete_option( $option_name );
- }
-
- /**
- * Process the user meta fields.
- *
- * @param array $args Field arguments.
- * @param int $user_id ID of the current post type.
- *
- * @return string HTML of the field.
- */
- protected function process_fields( $args ) {
- $id = $args['id'];
- $type = $args['type'];
- $options = isset( $args['options'] ) ? $args['options'] : '';
- $attrs = isset( $args['attributes'] ) ? $args['attributes'] : array();
- $current = '';
-
- // Gets current value or default.
- if ( isset( $_GET['tag_ID'] ) ) {
- $current = $this->get_value( $_GET['tag_ID'], $id );
- }
-
- if ( ! $current ) {
- $current = isset( $args['default'] ) ? $args['default'] : '';
- }
-
- switch ( $type ) {
- case 'text' :
- $this->field_input( $id, $current, array_merge( array( 'class' => 'regular-text' ), $attrs ) );
- break;
- case 'input' :
- $this->field_input( $id, $current, $attrs );
- break;
- case 'textarea' :
- $this->field_textarea( $id, $current, $attrs );
- break;
- case 'checkbox' :
- $this->field_checkbox( $id, $current, $attrs );
- break;
- case 'select' :
- $this->field_select( $id, $current, $options, $attrs );
- break;
- case 'radio' :
- $this->field_radio( $id, $current, $options, $attrs );
- break;
- case 'editor' :
- $this->field_editor( $id, $current, $options );
- break;
- case 'color' :
- $this->field_input( $id, $current, array_merge( array( 'class' => 'odin-color-field' ), $attrs ) );
- break;
- case 'upload' :
- $this->field_upload( $id, $current, $attrs );
- break;
- case 'image' :
- $this->field_image( $id, $current );
- break;
- case 'image_plupload' :
- $this->field_image_plupload( $id, $current );
- break;
-
- default :
- do_action( 'odin_user_meta_field_' . $this->id, $type, $id, $current, $options, $attrs );
- break;
- }
- }
-
- /**
- * Build field attributes.
- *
- * @param array $attrs Attributes as array.
- *
- * @return string Attributes as string.
- */
- protected function build_field_attributes( $attrs ) {
- $attributes = '';
-
- if ( ! empty( $attrs ) ) {
- foreach ( $attrs as $key => $attr ) {
- $attributes .= ' ' . $key . '="' . $attr . '"';
- }
- }
-
- return $attributes;
- }
-
- /**
- * Input field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_input( $id, $current, $attrs ) {
- if ( ! isset( $attrs['type'] ) ) {
- $attrs['type'] = 'text';
- }
-
- echo sprintf( '
', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Textarea field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_textarea( $id, $current, $attrs ) {
- if ( ! isset( $attrs['cols'] ) ) {
- $attrs['cols'] = '60';
- }
-
- if ( ! isset( $attrs['rows'] ) ) {
- $attrs['rows'] = '5';
- }
-
- echo sprintf( '
', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Checkbox field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_checkbox( $id, $current, $attrs ) {
- echo sprintf( '
', $id, checked( 1, $current, false ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Select field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with select options.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_select( $id, $current, $options, $attrs ) {
- // If multiple add a array in the option.
- $multiple = ( in_array( 'multiple', $attrs ) ) ? '[]' : '';
-
- $html = sprintf( '
', $id, $multiple, $this->build_field_attributes( $attrs ) );
-
- foreach ( $options as $key => $label ) {
- $html .= sprintf( '%s ', $key, selected( $current, $key, false ), $label );
- }
-
- $html .= ' ';
-
- echo $html;
- }
-
- /**
- * Radio field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with input options.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_radio( $id, $current, $options, $attrs ) {
- $html = '';
-
- foreach ( $options as $key => $label ) {
- $html .= sprintf( '
%4$s ', $id, $key, checked( $current, $key, false ), $label, $this->build_field_attributes( $attrs ) );
- }
-
- echo $html;
- }
-
- /**
- * Editor field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with wp_editor options.
- *
- * @return string HTML of the field.
- */
- protected function field_editor( $id, $current, $options ) {
- // Set default options.
- if ( empty( $options ) ) {
- $options = array( 'textarea_rows' => 10 );
- }
-
- $options[ 'textarea_name' ] = $id;
-
- echo '
';
- wp_editor( wpautop( $current ), $id, $options );
- echo '
';
- }
-
- /**
- * Upload field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_upload( $id, $current, $attrs ) {
- echo sprintf( '
', $id, esc_url( $current ), __( 'Select file', 'odin' ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Image field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- *
- * @return string HTML of the field.
- */
- protected function field_image( $id, $current ) {
-
- // Gets placeholder image.
- $image = get_template_directory_uri() . '/core/assets/images/placeholder.png';
- $html = '
';
- $html .= '
' . $image . ' ';
-
- if ( $current ) {
- $image = wp_get_attachment_image_src( $current, 'thumbnail' );
- $image = $image[0];
- }
-
- $html .= sprintf( '
', $id, $current, $image, __( 'Select image', 'odin' ), __( 'Remove image', 'odin' ) );
-
- $html .= '
';
- $html .= '
';
-
- echo $html;
- }
-
- /**
- * Image plupload field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- *
- * @return string HTML of the field.
- */
- protected function field_image_plupload( $id, $current ) {
- $html = '
';
- $html .= '
';
- if ( ! empty( $current ) ) {
- // Gets the current images.
- $attachments = array_filter( explode( ',', $current ) );
-
- if ( $attachments ) {
- foreach ( $attachments as $attachment_id ) {
- $html .= sprintf( '%2$s ',
- $attachment_id,
- wp_get_attachment_image( $attachment_id, 'thumbnail' ),
- __( 'Remove image', 'odin' )
- );
- }
- }
- }
- $html .= '
';
-
- // Adds the hidden input.
- $html .= sprintf( '
', $id, $current );
-
- // Adds "adds images in gallery" url.
- $html .= sprintf( '
%s
', __( 'Add images in gallery', 'odin' ) );
- $html .= '
';
-
- echo $html;
- }
-
- /**
- * Save term meta data.
- *
- * @param int $term_id Field id.
- * @param int $tt_id Term taxonomy ID.
- */
- public function save( $term_id, $tt_id = null ) {
- // Verify nonce.
- if ( ! isset( $_POST[ $this->nonce ] ) || ! wp_verify_nonce( $_POST[ $this->nonce ], basename( __FILE__ ) ) ) {
- return '';
- }
-
- foreach ( $this->fields as $field ) {
- $name = $field['id'];
- $old = $this->get_value( $term_id, $name );
- $new = apply_filters( 'odin_save_term_meta_' . $this->id, $_POST[ $name ], $name );
-
- if ( $new && $new != $old ) {
- update_term_meta( $term_id, $name, $new );
- } else if ( '' == $new && $old ) {
- $this->delete_term_meta( $term_id, $name );
- }
- }
- }
-}
diff --git a/core/classes/class-theme-options.php b/core/classes/class-theme-options.php
deleted file mode 100644
index bf54477..0000000
--- a/core/classes/class-theme-options.php
+++ /dev/null
@@ -1,660 +0,0 @@
-id = $id;
- $this->title = $title;
- $this->capability = $capability;
-
- // Actions.
- add_action( 'admin_menu', array( &$this, 'add_page' ) );
- add_action( 'admin_init', array( &$this, 'create_settings' ) );
- add_action( 'admin_enqueue_scripts', array( &$this, 'scripts' ) );
- }
-
- /**
- * Add Settings Theme page.
- */
- public function add_page() {
- add_theme_page(
- $this->title,
- $this->title,
- $this->capability,
- $this->id,
- array( &$this, 'settings_page' )
- );
- }
-
- /**
- * Load options scripts.
- */
- function scripts() {
- // Checks if is the settings page.
- if ( isset( $_GET['page'] ) && $this->id == $_GET['page'] ) {
-
- // Color Picker.
- wp_enqueue_style( 'wp-color-picker' );
- wp_enqueue_script( 'wp-color-picker' );
-
- // Media Upload.
- wp_enqueue_media();
-
- // jQuery UI.
- wp_enqueue_script( 'jquery-ui-sortable' );
-
- // Theme Options.
- wp_enqueue_style( 'odin-admin', get_template_directory_uri() . '/core/assets/css/admin.css', array(), null, 'all' );
- wp_enqueue_script( 'odin-admin', get_template_directory_uri() . '/core/assets/js/admin.js', array( 'jquery' ), null, true );
-
- // Localize strings.
- wp_localize_script(
- 'odin-admin',
- 'odinAdminParams',
- array(
- 'galleryTitle' => __( 'Add images in gallery', 'odin' ),
- 'galleryButton' => __( 'Add in gallery', 'odin' ),
- 'galleryRemove' => __( 'Remove image', 'odin' ),
- 'uploadTitle' => __( 'Choose a file', 'odin' ),
- 'uploadButton' => __( 'Add file', 'odin' ),
- )
- );
- }
- }
-
- /**
- * Set settings tabs.
- *
- * @param array $tabs Settings tabs.
- */
- public function set_tabs( $tabs ) {
- $this->tabs = $tabs;
- }
-
- /**
- * Set settings fields
- *
- * @param array $fields Settings fields.
- */
- public function set_fields( $fields ) {
- $this->fields = $fields;
- }
-
- /**
- * Get current tab.
- *
- * @return string Current tab ID.
- */
- protected function get_current_tab() {
- if ( isset( $_GET['tab'] ) ) {
- $current_tab = $_GET['tab'];
- } else {
- $current_tab = $this->tabs[0]['id'];
- }
-
- return $current_tab;
- }
-
- /**
- * Get the menu current URL.
- *
- * @return string Current URL.
- */
- private function get_current_url() {
- $url = 'http';
- if ( isset( $_SERVER['HTTPS'] ) && 'on' == $_SERVER['HTTPS'] ) {
- $url .= 's';
- }
-
- $url .= '://';
-
- if ( '80' != $_SERVER['SERVER_PORT'] ) {
- $url .= $_SERVER['SERVER_NAME'] . ' : ' . $_SERVER['SERVER_PORT'] . $_SERVER['PHP_SELF'];
- } else {
- $url .= $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'];
- }
-
- return esc_url( $url );
- }
-
- /**
- * Get tab navigation.
- *
- * @param string $current_tab Current tab ID.
- *
- * @return string Tab Navigation.
- */
- protected function get_navigation( $current_tab ) {
-
- $html = '
';
-
- foreach ( $this->tabs as $tab ) {
-
- $current = ( $current_tab == $tab['id'] ) ? ' nav-tab-active' : '';
-
- $html .= sprintf( '%s ', $this->id, $tab['id'], $current, $tab['title'] );
- }
-
- $html .= ' ';
-
- echo $html;
- }
-
- /**
- * Built settings page.
- */
- public function settings_page() {
- // Get current tag.
- $current_tab = $this->get_current_tab();
-
- // Opens the wrap.
- echo '
';
-
- // Display the navigation menu.
- $this->get_navigation( $current_tab );
-
- // Display erros.
- settings_errors();
-
- // Creates the option form.
- echo '';
-
- // Closes the wrap.
- echo '
';
- }
-
- /**
- * Create settings.
- */
- public function create_settings() {
-
- // Register settings fields.
- foreach ( $this->fields as $section => $items ) {
-
- // Register settings sections.
- add_settings_section(
- $section,
- $items['title'],
- '__return_false',
- $items['tab']
- );
-
- foreach ( $items['fields'] as $option ) {
-
- $type = isset( $option['type'] ) ? $option['type'] : 'text';
-
- $args = array(
- 'id' => $option['id'],
- 'tab' => $items['tab'],
- 'section' => $section,
- 'options' => isset( $option['options'] ) ? $option['options'] : '',
- 'default' => isset( $option['default'] ) ? $option['default'] : '',
- 'attributes' => isset( $option['attributes'] ) ? $option['attributes'] : array(),
- 'description' => isset( $option['description'] ) ? $option['description'] : ''
- );
-
- add_settings_field(
- $option['id'],
- $option['label'],
- array( &$this, 'callback_' . $type ),
- $items['tab'],
- $section,
- $args
- );
- }
- }
-
- // Register settings.
- foreach ( $this->tabs as $tabs ) {
- register_setting( $tabs['id'], $tabs['id'], array( &$this, 'validate_input' ) );
- }
- }
-
- /**
- * Get Option.
- *
- * @param string $tab Tab that the option belongs
- * @param string $id Option ID.
- * @param string $default Default option.
- *
- * @return array Item options.
- */
- protected function get_option( $tab, $id, $default = '' ) {
- $options = get_option( $tab );
-
- if ( isset( $options[ $id ] ) ) {
- $default = $options[ $id ];
- }
-
- return $default;
-
- }
-
- /**
- * Build field attributes.
- *
- * @param array $attrs Attributes as array.
- *
- * @return string Attributes as string.
- */
- protected function build_field_attributes( $attrs ) {
- $attributes = '';
-
- if ( ! empty( $attrs ) ) {
- foreach ( $attrs as $key => $attr ) {
- $attributes .= ' ' . $key . '="' . $attr . '"';
- }
- }
-
- return $attributes;
- }
-
- /**
- * Input field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Input field HTML.
- */
- public function callback_input( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
- $attrs = $args['attributes'];
-
- // Sets default type.
- if ( ! isset( $attrs['type'] ) ) {
- $attrs['type'] = 'text';
- }
-
- // Sets current option.
- $current = esc_html( $this->get_option( $tab, $id, $args['default'] ) );
-
- $html = sprintf( '
', $id, $tab, $current, $this->build_field_attributes( $attrs ) );
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s
', $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * Text field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Text field HTML.
- */
- public function callback_text( $args ) {
- // Sets regular text class.
- $args['attributes']['class'] = 'regular-text';
-
- $this->callback_input( $args );
- }
-
- /**
- * Textarea field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Textarea field HTML.
- */
- public function callback_textarea( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
- $attrs = $args['attributes'];
-
- if ( ! isset( $attrs['cols'] ) ) {
- $attrs['cols'] = '60';
- }
-
- if ( ! isset( $attrs['rows'] ) ) {
- $attrs['rows'] = '5';
- }
-
- // Sets current option.
- $current = esc_textarea( $this->get_option( $tab, $id, $args['default'] ) );
-
- $html = sprintf( '
', $id, $tab, $current, $this->build_field_attributes( $attrs ) );
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s
', $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * Editor field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Editor field HTML.
- */
- public function callback_editor( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
- $options = $args['options'];
-
- // Sets current option.
- $current = wpautop( $this->get_option( $tab, $id, $args['default'] ) );
-
- // Set default options.
- if ( empty( $options ) ) {
- $options = array( 'textarea_rows' => 10 );
- }
-
- $options[ 'textarea_name' ] = $tab . '[' . $id . ']';
-
- echo '
';
-
- wp_editor( $current, $id, $options );
-
- echo '
';
-
- // Displays the description.
- if ( $args['description'] ) {
- echo sprintf( '
%s
', $args['description'] );
- }
- }
-
- /**
- * Checkbox field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Checkbox field HTML.
- */
- public function callback_checkbox( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
- $attrs = $args['attributes'];
-
- // Sets current option.
- $current = $this->get_option( $tab, $id, $args['default'] );
-
- $html = sprintf( '
', $id, $tab, checked( 1, $current, false ), $this->build_field_attributes( $attrs ) );
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s ', $id, $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * Radio field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Radio field HTML.
- */
- public function callback_radio( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
- $attrs = $args['attributes'];
-
- // Sets current option.
- $current = $this->get_option( $tab, $id, $args['default'] );
-
- $html = '';
- foreach( $args['options'] as $key => $label ) {
- $item_id = $id . '_' . $key;
- $key = sanitize_title( $key );
-
- $html .= sprintf( '
', $id, $tab, $key, checked( $current, $key, false ), $this->build_field_attributes( $attrs ) );
- $html .= sprintf( '
%s ', $item_id, $label );
- }
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s
', $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * Select field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Select field HTML.
- */
- public function callback_select( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
- $attrs = $args['attributes'];
-
- // Sets current option.
- $current = $this->get_option( $tab, $id, $args['default'] );
-
- // If multiple add a array in the option.
- $multiple = ( in_array( 'multiple', $attrs ) ) ? '[]' : '';
-
- $html = sprintf( '
', $id, $tab, $multiple, $this->build_field_attributes( $attrs ) );
- foreach( $args['options'] as $key => $label ) {
- $key = sanitize_title( $key );
-
- $html .= sprintf( '%s ', $key, selected( $current, $key, false ), $label );
- }
- $html .= ' ';
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s
', $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * Color field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Color field HTML.
- */
- public function callback_color( $args ) {
- // Sets color class.
- $args['attributes']['class'] = 'odin-color-field';
-
- $this->callback_input( $args );
- }
-
- /**
- * Upload field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Upload field HTML.
- */
- public function callback_upload( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
- $attrs = $args['attributes'];
-
- // Sets current option.
- $current = esc_url( $this->get_option( $tab, $id, $args['default'] ) );
-
- $html = sprintf( '
', $id, $tab, $current, __( 'Select file', 'odin' ), $this->build_field_attributes( $attrs ) );
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s
', $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * Image field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Image field HTML.
- */
- public function callback_image( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
-
- // Sets current option.
- $current = $this->get_option( $tab, $id, $args['default'] );
-
- // Gets placeholder image.
- $image = get_template_directory_uri() . '/core/assets/images/placeholder.png';
- $html = '
';
- $html .= '
' . $image . ' ';
-
- if ( ! empty( $current ) ) {
- $image = wp_get_attachment_image_src( $current, 'thumbnail' );
- $image = $image[0];
- }
-
- $html .= sprintf( '
', $id, $tab, $current, $image, __( 'Select image', 'odin' ), __( 'Remove image', 'odin' ) );
-
- $html .= '
';
- $html .= '
';
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s
', $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * Image Plupload field callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string Image Plupload field HTML.
- */
- public function callback_image_plupload( $args ) {
- $tab = $args['tab'];
- $id = $args['id'];
-
- // Sets current option.
- $current = $this->get_option( $tab, $id, $args['default'] );
-
- $html = '
';
- $html .= '
';
- if ( ! empty( $current ) ) {
- // Gets the current images.
- $attachments = array_filter( explode( ',', $current ) );
-
- if ( $attachments ) {
- foreach ( $attachments as $attachment_id ) {
- $html .= sprintf( '%2$s ',
- $attachment_id,
- wp_get_attachment_image( $attachment_id, 'thumbnail' ),
- __( 'Remove image', 'odin' )
- );
- }
- }
- }
- $html .= '
';
-
- // Adds the hidden input.
- $html .= sprintf( '
', $id, $tab, $current );
-
- // Adds "adds images in gallery" url.
- $html .= sprintf( '
%s
', __( 'Add images in gallery', 'odin' ) );
- $html .= '
';
-
- // Displays the description.
- if ( $args['description'] ) {
- $html .= sprintf( '
%s
', $args['description'] );
- }
-
- echo $html;
- }
-
- /**
- * HTML callback.
- *
- * @param array $args Arguments from the option.
- *
- * @return string HTML.
- */
- public function callback_html( $args ) {
- echo $args['description'];
- }
-
- /**
- * Sanitization fields callback.
- *
- * @param string $input The unsanitized collection of options.
- *
- * @return string The collection of sanitized values.
- */
- public function validate_input( $input ) {
-
- // Create our array for storing the validated options.
- $output = array();
-
- // Loop through each of the incoming options.
- foreach ( $input as $key => $value ) {
-
- // Check to see if the current option has a value. If so, process it.
- if ( isset( $input[ $key ] ) ) {
- $output[ $key ] = apply_filters( 'odin_theme_options_validate_' . $this->id, $value, $key );
- }
-
- }
-
- return $output;
- }
-}
diff --git a/core/classes/class-thumbnail-resizer.php b/core/classes/class-thumbnail-resizer.php
deleted file mode 100644
index f961352..0000000
--- a/core/classes/class-thumbnail-resizer.php
+++ /dev/null
@@ -1,220 +0,0 @@
-,
- * created by Syamil MJ and with the licence WTFPL.
- *
- * @package Odin
- * @category Thumbnail_Resizer
- * @author WPBrasil
- * @version 2.1.5
- */
-class Odin_Thumbnail_Resizer {
-
- /**
- * The singleton instance.
- *
- * @var object
- */
- protected static $instance = null;
-
- /**
- * Image properties
- */
- protected static $image_url = null;
- protected static $width = null;
- protected static $height = null;
-
- /**
- * No initialization allowed.
- */
- private function __construct() {}
-
- /**
- * No cloning allowed.
- */
- private function __clone() {}
-
- /**
- * Return an instance of this class.
- *
- * @return object A single instance of this class.
- */
- public static function get_instance() {
- // If the single instance hasn't been set, set it now.
- if ( null == self::$instance ) {
- self::$instance = new self;
- }
-
- return self::$instance;
- }
-
- /**
- * Gets the upload path (directory and url).
- *
- * @param string $url Image URL.
- *
- * @return array Upload directory and URL.
- */
- protected static function get_upload_path( $url ) {
- $upload_info = wp_upload_dir();
- $upload_dir = $upload_info['basedir'];
- $upload_url = $upload_info['baseurl'];
- $http_prefix = 'http://';
- $https_prefix = 'https://';
-
- // If the $url scheme differs from $upload_url scheme, make them match,
- // If the schemes differe, images don't show up.
- if ( ! strncmp( $url, $https_prefix, strlen( $https_prefix ) ) ) {
- // If url begins with https:// make $upload_url begin with https:// as well.
- $upload_url = str_replace( $http_prefix, $https_prefix, $upload_url );
- } elseif ( ! strncmp( $url, $http_prefix, strlen( $http_prefix ) ) ) {
- // If url begins with http:// make $upload_url begin with http:// as well.
- $upload_url = str_replace( $https_prefix, $http_prefix, $upload_url );
- }
-
- return array(
- 'upload_dir' => $upload_dir,
- 'upload_url' => $upload_url
- );
- }
-
- /**
- * Process the thumbnail.
- *
- * @param string $url Image URL (must be uploaded using wp media uploader).
- * @param int $width Thumbnail width.
- * @param int $height Thumbnail height.
- * @param boolean $crop Soft (false) or hard (true) crop.
- * @param boolean $upscale Force the resize.
- *
- * @return string New thumbnail.
- */
- public function process( $url, $width = null, $height = null, $crop = false, $upscale = false ) {
- // Validate inputs.
- if ( ! $url || ( ! $width && ! $height ) ) {
- return false;
- }
-
- // Caipt'n, ready to hook.
- if ( true === $upscale ) {
- add_filter( 'image_resize_dimensions', array( $this, 'aq_upscale' ), 10, 6 );
- }
-
- // Define upload path, directory and http prefix.
- $generate_paths = self::get_upload_path( $url );
- $upload_dir = $generate_paths['upload_dir'];
- $upload_url = $generate_paths['upload_url'];
-
- // Check if $image_url is local.
- if ( false === strpos( $url, $upload_url ) ) {
- return false;
- }
-
- // Define path of image.
- $rel_path = str_replace( $upload_url, '', $url );
- $image_path = $upload_dir . $rel_path;
-
- // Check if img path exists, and is an image indeed.
- if ( ! file_exists( $image_path ) || ! getimagesize( $image_path ) ) {
- return false;
- }
-
- // Get image info.
- $info = pathinfo( $image_path );
- $ext = $info['extension'];
- list( $original_width, $original_height ) = getimagesize( $image_path );
-
- // Get image size after cropping.
- $dimensions = image_resize_dimensions( $original_width, $original_height, $width, $height, $crop );
- $original_width = $dimensions[4];
- $original_height = $dimensions[5];
-
- // Return the original image only if it exactly fits the needed measures.
- if ( ! $dimensions && ( ( ( null === $height && $original_width == $width ) xor ( null === $width && $original_height == $height ) ) xor ( $height == $original_height && $width == $original_width ) ) ) {
- $image_url = $url;
- } else {
- // Use this to check if cropped image already exists, so we can return that instead.
- $suffix = $original_width . 'x' . $original_height;
- $original_rel_path = str_replace( '.' . $ext, '', $rel_path );
- $destfilename = $upload_dir . $original_rel_path . '-' . $suffix . '.' . $ext;
-
- // Can't resize, so return false saying that the action to do could not be processed as planned.
- if ( ! $dimensions || ( true == $crop && false == $upscale && ( $original_width < $width || $original_height < $height ) ) ) {
- return false;
-
- // Else check if cache exists.
- } elseif ( file_exists( $destfilename ) && @getimagesize( $destfilename ) ) {
- $image_url = $upload_url . $original_rel_path . '-' . $suffix . '.' . $ext;
-
- // Else, we resize the image and return the new resized image url.
- } else {
- $editor = wp_get_image_editor( $image_path );
- if ( is_wp_error( $editor ) || is_wp_error( $editor->resize( $width, $height, $crop ) ) ) {
- return false;
- }
-
- $resized_file = $editor->save();
-
- if ( ! is_wp_error( $resized_file ) ) {
- $resized_rel_path = str_replace( $upload_dir, '', $resized_file['path'] );
- $image_url = $upload_url . $resized_rel_path;
- } else {
- return false;
- }
-
- }
- }
-
- self::$image_url = $image_url;
- self::$width = $original_width;
- self::$height = $original_height;
-
- // Okay, leave the ship.
- if ( true === $upscale ) {
- remove_filter( 'image_resize_dimensions', array( $this, 'aq_upscale' ) );
- }
-
- return $image_url;
- }
-
- /**
- * Callback to overwrite WP computing of thumbnail measures
- */
- public function aq_upscale( $default, $original_width, $original_height, $new_width, $new_height, $crop ) {
- // Let the wordpress default function handle this.
- if ( ! $crop ) {
- return null;
- }
-
- // Here is the point we allow to use larger image size than the original one.
- $aspect_ratio = $original_width / $original_height;
-
- if ( ! $new_width ) {
- $new_width = intval( $new_height * $aspect_ratio );
- }
-
- if ( ! $new_height ) {
- $new_height = intval( $new_width / $aspect_ratio );
- }
-
- $size_ratio = max( $new_width / $original_width, $new_height / $original_height );
-
- $crop_width = round( $new_width / $size_ratio );
- $crop_height = round( $new_height / $size_ratio );
-
- $s_x = floor( ( $original_width - $crop_width ) / 2 );
- $s_y = floor( ( $original_height - $crop_height ) / 2 );
-
- return array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_width, (int) $new_height, (int) $crop_width, (int) $crop_height );
- }
-
- /**
- * Return array with image url, width and height
- */
- public function get_image_url_with_dimensions() {
- return array( self::$image_url, self::$width, self::$height );
- }
-}
diff --git a/core/classes/class-user-meta.php b/core/classes/class-user-meta.php
deleted file mode 100644
index 3532733..0000000
--- a/core/classes/class-user-meta.php
+++ /dev/null
@@ -1,440 +0,0 @@
-id = $id;
- $this->title = $title;
- $this->nonce = $this->id . '_nonce';
-
- // View Additional User Fields.
- add_action( 'show_user_profile', array( $this, 'view' ) );
- add_action( 'edit_user_profile', array( $this, 'view' ) );
-
- // Update Additional User Fields.
- add_action( 'personal_options_update', array( $this, 'save' ) );
- add_action( 'edit_user_profile_update', array( $this, 'save' ) );
-
- // Load scripts.
- add_action( 'admin_enqueue_scripts', array( $this, 'scripts' ) );
- }
-
- /**
- * Load user meta scripts.
- */
- public function scripts() {
-
- // Color Picker.
- wp_enqueue_style( 'wp-color-picker' );
- wp_enqueue_script( 'wp-color-picker' );
-
- // Media Upload.
- wp_enqueue_media();
-
- // jQuery UI.
- wp_enqueue_script( 'jquery-ui-sortable' );
-
- // user_meta.
- wp_enqueue_script( 'odin-admin', get_template_directory_uri() . '/core/assets/js/admin.js', array( 'jquery' ), null, true );
- wp_enqueue_style( 'odin-admin', get_template_directory_uri() . '/core/assets/css/admin.css', array(), null, 'all' );
-
- // Localize strings.
- wp_localize_script(
- 'odin-admin',
- 'odinAdminParams',
- array(
- 'galleryTitle' => __( 'Add images in gallery', 'odin' ),
- 'galleryButton' => __( 'Add in gallery', 'odin' ),
- 'galleryRemove' => __( 'Remove image', 'odin' ),
- 'uploadTitle' => __( 'Choose a file', 'odin' ),
- 'uploadButton' => __( 'Add file', 'odin' ),
- )
- );
- }
-
- /**
- * Set user meta fields.
- *
- * @param array $fields User meta fields.
- */
- public function set_fields( $fields = array() ) {
- $this->fields = $fields;
- }
-
- /**
- * User meta view.
- *
- * @param object $post Post object.
- *
- * @return string User meta HTML fields.
- */
- public function view() {
- // Use nonce for verification.
- wp_nonce_field( basename( __FILE__ ), $this->nonce );
-
- echo '
' . $this->title . ' ';
-
- echo '
';
-
- }
-
- /**
- * Process the user meta fields.
- *
- * @param array $args Field arguments
- * @param int $user_id ID of the current post type.
- *
- * @return string HTML of the field.
- */
- protected function process_fields( $args ) {
- $id = $args['id'];
- $type = $args['type'];
- $options = isset( $args['options'] ) ? $args['options'] : '';
- $attrs = isset( $args['attributes'] ) ? $args['attributes'] : array();
-
- // Gets current value or default.
- if ( defined( 'IS_PROFILE_PAGE' ) && IS_PROFILE_PAGE ) {
- $current_user = wp_get_current_user();
- $user_id = $current_user->ID;
- // If is another user's profile page
- } elseif ( ! empty( $_GET['user_id'] ) && is_numeric( $_GET['user_id'] ) ) {
- $user_id = $_GET['user_id'];
- }
-
- $current = get_user_meta( $user_id, $id, true );
-
- if ( ! $current ) {
- $current = isset( $args['default'] ) ? $args['default'] : '';
- }
-
- switch ( $type ) {
- case 'text':
- $this->field_input( $id, $current, array_merge( array( 'class' => 'regular-text' ), $attrs ) );
- break;
- case 'input':
- $this->field_input( $id, $current, $attrs );
- break;
- case 'textarea':
- $this->field_textarea( $id, $current, $attrs );
- break;
- case 'checkbox':
- $this->field_checkbox( $id, $current, $attrs );
- break;
- case 'select':
- $this->field_select( $id, $current, $options, $attrs );
- break;
- case 'radio':
- $this->field_radio( $id, $current, $options, $attrs );
- break;
- case 'editor':
- $this->field_editor( $id, $current, $options );
- break;
- case 'color':
- $this->field_input( $id, $current, array_merge( array( 'class' => 'odin-color-field' ), $attrs ) );
- break;
- case 'upload':
- $this->field_upload( $id, $current, $attrs );
- break;
- case 'image':
- $this->field_image( $id, $current );
- break;
- case 'image_plupload':
- $this->field_image_plupload( $id, $current );
- break;
-
- default:
- do_action( 'odin_user_meta_field_' . $this->id, $type, $id, $current, $options, $attrs );
- break;
- }
- }
-
- /**
- * Build field attributes.
- *
- * @param array $attrs Attributes as array.
- *
- * @return string Attributes as string.
- */
- protected function build_field_attributes( $attrs ) {
- $attributes = '';
-
- if ( ! empty( $attrs ) ) {
- foreach ( $attrs as $key => $attr ) {
- $attributes .= ' ' . $key . '="' . $attr . '"';
- }
- }
-
- return $attributes;
- }
-
- /**
- * Input field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_input( $id, $current, $attrs ) {
- if ( ! isset( $attrs['type'] ) ) {
- $attrs['type'] = 'text';
- }
-
- echo sprintf( '
', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Textarea field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_textarea( $id, $current, $attrs ) {
- if ( ! isset( $attrs['cols'] ) ) {
- $attrs['cols'] = '60';
- }
-
- if ( ! isset( $attrs['rows'] ) ) {
- $attrs['rows'] = '5';
- }
-
- echo sprintf( '
', $id, esc_attr( $current ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Checkbox field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_checkbox( $id, $current, $attrs ) {
- echo sprintf( '
', $id, checked( 1, $current, false ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Select field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with select options.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_select( $id, $current, $options, $attrs ) {
- // If multiple add a array in the option.
- $multiple = ( in_array( 'multiple', $attrs ) ) ? '[]' : '';
-
- $html = sprintf( '
', $id, $multiple, $this->build_field_attributes( $attrs ) );
-
- foreach ( $options as $key => $label ) {
- $html .= sprintf( '%s ', $key, selected( $current, $key, false ), $label );
- }
-
- $html .= ' ';
-
- echo $html;
- }
-
- /**
- * Radio field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with input options.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_radio( $id, $current, $options, $attrs ) {
- $html = '';
-
- foreach ( $options as $key => $label ) {
- $html .= sprintf( '
%4$s ', $id, $key, checked( $current, $key, false ), $label, $this->build_field_attributes( $attrs ) );
- }
-
- echo $html;
- }
-
- /**
- * Editor field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $options Array with wp_editor options.
- *
- * @return string HTML of the field.
- */
- protected function field_editor( $id, $current, $options ) {
- // Set default options.
- if ( empty( $options ) ) {
- $options = array( 'textarea_rows' => 10 );
- }
-
- $options[ 'textarea_name' ] = $id;
-
- echo '
';
- wp_editor( wpautop( $current ), $id, $options );
- echo '
';
- }
-
- /**
- * Upload field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- * @param array $attrs Array with field attributes.
- *
- * @return string HTML of the field.
- */
- protected function field_upload( $id, $current, $attrs ) {
- echo sprintf( '
', $id, esc_url( $current ), __( 'Select file', 'odin' ), $this->build_field_attributes( $attrs ) );
- }
-
- /**
- * Image field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- *
- * @return string HTML of the field.
- */
- protected function field_image( $id, $current ) {
-
- // Gets placeholder image.
- $image = get_template_directory_uri() . '/core/assets/images/placeholder.png';
- $html = '
';
- $html .= '
' . $image . ' ';
-
- if ( $current ) {
- $image = wp_get_attachment_image_src( $current, 'thumbnail' );
- $image = $image[0];
- }
-
- $html .= sprintf( '
', $id, $current, $image, __( 'Select image', 'odin' ), __( 'Remove image', 'odin' ) );
-
- $html .= '
';
- $html .= '
';
-
- echo $html;
- }
-
- /**
- * Image plupload field.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- *
- * @return string HTML of the field.
- */
- protected function field_image_plupload( $id, $current ) {
- $html = '
';
- $html .= '
';
- if ( ! empty( $current ) ) {
- // Gets the current images.
- $attachments = array_filter( explode( ',', $current ) );
-
- if ( $attachments ) {
- foreach ( $attachments as $attachment_id ) {
- $html .= sprintf( '%2$s ',
- $attachment_id,
- wp_get_attachment_image( $attachment_id, 'thumbnail' ),
- __( 'Remove image', 'odin' )
- );
- }
- }
- }
- $html .= '
';
-
- // Adds the hidden input.
- $html .= sprintf( '
', $id, $current );
-
- // Adds "adds images in gallery" url.
- $html .= sprintf( '
%s
', __( 'Add images in gallery', 'odin' ) );
- $html .= '
';
-
- echo $html;
- }
-
- /**
- * Save user meta data.
- *
- * @param string $id Field id.
- * @param string $current Field current value.
- */
- public function save( $user_id ) {
- // Verify nonce.
- if ( ! isset( $_POST[ $this->nonce ] ) || ! wp_verify_nonce( $_POST[ $this->nonce ], basename( __FILE__ ) ) ) {
- return '';
- }
-
- // Only saves if the current user can edit user profiles.
- if ( ! current_user_can( 'edit_user', $user_id ) ) {
- return '';
- }
-
- foreach ( $this->fields as $field ) {
- $name = $field['id'];
- $old = get_user_meta( $user_id, $name, true );
- $new = apply_filters( 'odin_save_user_meta_' . $this->id, $_POST[ $name ], $name );
-
- if ( $new && $new != $old ) {
- update_user_meta( $user_id, $name, $new );
- } elseif ( '' == $new && $old ) {
- delete_user_meta( $user_id, $name, $old );
- }
- }
- }
-}
diff --git a/core/classes/widgets/class-widget-like-box.php b/core/classes/widgets/class-widget-like-box.php
deleted file mode 100644
index c80f58e..0000000
--- a/core/classes/widgets/class-widget-like-box.php
+++ /dev/null
@@ -1,166 +0,0 @@
- __( 'This widget includes a facebook like box on your blog', 'odin' ), )
- );
- }
-
- /**
- * Back-end widget form.
- *
- * @see WP_Widget::form()
- *
- * @param array $instance Previously saved values from database.
- *
- * @return string Widget options form.
- */
- public function form( $instance ) {
- $title = isset( $instance['title'] ) ? $instance['title'] : '';
- $url = isset( $instance['url'] ) ? $instance['url'] : '';
- $width = isset( $instance['width'] ) ? $instance['width'] : 300;
- $height = isset( $instance['height'] ) ? $instance['height'] : 500;
- $color_scheme = isset( $instance['color_scheme'] ) ? $instance['color_scheme'] : 'light';
- $friends_faces = isset( $instance['friends_faces'] ) ? $instance['friends_faces'] : 1;
- $show_posts = isset( $instance['show_posts'] ) ? $instance['show_posts'] : 0;
- $show_header = isset( $instance['show_header'] ) ? $instance['show_header'] : 0;
- $show_border = isset( $instance['show_border'] ) ? $instance['show_border'] : 0;
-
- ?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- >
- >
-
-
-
-
-
- />
-
-
-
-
- />
-
-
-
-
- />
-
-
-
-
- />
-
-
- ',
- $instance['url'],
- $instance['width'],
- $instance['height'],
- $instance['color_scheme'],
- $instance['friends_faces'],
- $instance['show_posts'],
- $instance['show_header'],
- $instance['show_border']
- );
-
- echo $args['after_widget'];
- }
-}
-
-/**
- * Register the Like Box Widget.
- */
-function odin_like_box_widget() {
- register_widget( 'Odin_Widget_Like_Box' );
-}
-
-add_action( 'widgets_init', 'odin_like_box_widget' );
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
deleted file mode 100644
index b91dace..0000000
--- a/docs/CHANGELOG.md
+++ /dev/null
@@ -1,265 +0,0 @@
-## Changelog ##
-
-#### v2.2.8 - 01/09/2015 ####
-- Added metabox in terms page #318 #319
-- Added Post Status class #310
-- Improved indentation text-domain #343
-- Added file .ftppass in FTP-deploy and rsync #339
-- Removed default favicon if has custom #338
-- Fixed variable name #338
-- Fixed images list when deleted plupload gallery #334
-- Improved `odin_get_url` return #332
-- Added WC condition #331
-- Added Bootstrap styled in comments form #327
-- Improved comments form #324
-- Fixed parameter name in `odin_get_term_meta` #323
-- Fixed indentation in `header.php` #322
-- Fixed bug file upload #321
-- Fixed .gitignore #315
-- Added placeholder post without thumb #313
-- Fixed tags WC #309
-- Fixed indentation in `class-metabox.php` #308
-- Improved function `odin_breadcrumbs()` #307
-
-#### v2.2.7 - 26/06/2015 ####
-* Updated dependencies package.json.
-* Added option disable emoji's since version 4.2.2 WordPress.
-* Updated Boostrap to version 3.3.5.
-* Added sidebar() in image.php.
-* Attached a footer to the bottom of the viewport when the content is shorter than it.
-* Improved semantic theme.
-* Added skip navigation for better accessibility.
-* Improved SASS and fixed style WordPress.
-* Moved files markdown to diretory docs/
-* Moved file .jshintrc to diretory assets/js/
-* Tested with WordPress 4.4.2.
-
-#### v2.2.6 - 26/06/2014 ####
-
-* Improved the odin_breadcrumbs() to works better with custom post type and taxonomies.
-* Added support to "multiple" attribute in select in all core classes.
-* Improved the Odin_Metabox to work with one or more post types.
-* Fixed the `title` and `separator` elements in core classes.
-* Updated the Bootstrap to 2.2
-
-#### v2.2.5 - 13/05/2014 ####
-
-* Tested with WordPress 3.9.
-* Added Odin_User_Meta class.
-* Added ability to attach files using Odin_Contact_Form.
-* Improved the image upload field.
-* Improved the image plupload field.
-* Improved the breadcrumbs.
-* Improved the odin_pagination().
-
-#### v2.2.3 - 31/01/2014 ####
-
-* Updated the Bootstrap to version 3.1.0.
-
-#### v2.2.2 - 28/12/2013 ####
-
-* Modified the bootstrap sass mirror to the official version.
-* Updated the Grunt dependencies.
-
-#### v2.2.1 - 12/12/2013 ####
-
-* Updated the Bootstrap to version 3.0.3.
-* Fixed WordPress logo to version 3.8.
-* Added new Odin logo.
-
-#### v2.2.0 - 12/12/2013 ####
-
-* Improved the templates in favor the Twenty Fourteen standards.
-* Tested with WordPress 3.8.
-* Improved the functions to be able to be a parent theme.
-* Updated the FitVidsJS.
-* Removed bxSlider lib.
-* Remove jQuery Validation in favor to [PowerComment plugin](http://wordpress.org/plugins/powercomment/).
-
-#### v2.1.5 - 17/11/2013 ####
-
-* Fixed the `process` method in `Odin_Thumbnail_Resizer`
-* Fixed the thumbnail creation in `odin_related_posts_custom_thumbnails()` function.
-* Improved the `odin_related_posts()` function.
-
-#### v2.1.4 - 15/11/2013 ####
-
-* Fixed new PHP code standards.
-* Fixed new JavaScript code standards.
-* Added `Odin_Thumbnail_Resizer` class.
-* Removed old `thumbnail.php` file.
-* Created a new `odin_thumbnail()` function with `Odin_Thumbnail_Resizer` class.
-
-#### v2.1.3 - 10/11/2013 ####
-
-* Updated the Boostrap to version 3.0.2.
-
-#### v2.1.2 - 31/10/2013 ####
-
-* Updated the Bootstrap to version 3.0.1.
-* Updated the Bootstrap Menu Walker.
-* Fixed the admin logo for MP6.
-* Added attributes to edit the rows and cols for textarea in all core classes.
-
-#### v2.1.1 - 18/10/2013 ####
-
-* Improved the gmap shortcode.
-* Added `$class` param to `odin_thumbnail` function.
-* Fixed the bxSlider enqueue script.
-* Added dinamic attributes cols and rows for textarea in `Odin_Metabox` class.
-* Improved the variables in `Odin_Post_Form` class.
-* Added support to mp6 admin theme.
-* Updated the Bootstrap menu walker.
-* Removed the `force` param in grunt compass task.
-* Updated the grunt packages.
-* Fixed the Odin URL in `footer.php`.
-* Fixed the Custom login styles logo in `inc/assets/css/custom-admin.css`.
-
-#### v2.1.0 - 29/09/2013 ####
-
-* Added `Odin_Shortcodes` class.
-* Added $name in `odin_save_metabox_*` filter in `Odin_Metabox` class.
-* Addded `odin_front_end_form_redirect_*` in `Odin_Front_End_Form` class.
-* Added `separator` field type in `Odin_Metabox` class.
-* Added `odin_metabox_container_before_*` filter in `Odin_Metabox` class.
-* Added `odin_metabox_wrap_before_*` filter in `Odin_Metabox` class.
-* Added `odin_metabox_field_title_*` filter in `Odin_Metabox` class.
-* Added `odin_metabox_field_before_*` filter in `Odin_Metabox` class.
-* Added `odin_metabox_field_after_*` filter in `Odin_Metabox` class.
-* Added `odin_metabox_wrap_after_*` filter in `Odin_Metabox` class.
-* Added `odin_metabox_container_after_*` filter in `Odin_Metabox` class.
-* Fixed select field in `Odin_Metabox` class and `Odin_Theme_Options` class.
-* Added id in fieldset in `Odin_Front_End_Form` class.
-
-#### v2.0.0 - 16/09/2013 ####
-
-* Changed attrs to attributes in `Odin_Metabox` fields options.
-* Changed name to label in `Odin_Metabox` fields options.
-* Refactored the `Odin_Theme_Options` class.
-* Added `Odin_Front_End_Form` abstract class.
-* Added `Odin_Contact_Form` class.
-* Added `Odin_Post_Form` class.
-* Removed `hgroup`s.
-* Fixed select mutiple fields in `Odin_Metabox` and `Odin_Theme_Options`.
-
-#### v1.9.0 - 30/08/2013 ####
-
-* Updated sass-bootstrap.
-* Created grunt compress task.
-* Fixed Bootstrap support to WooCommerce and Jigoshop.
-* Improved the templates inline documentation.
-* Created a editor-style.css file.
-* Improved the scss files.
-* Added param attr to insert attributes in metabox fields.
-* Removed attachment.php.
-* Added audio.php.
-* Added image.php.
-* Added video.php.
-* Added styles to force video shortcode to be responsive.
-* Fixed the $icon-font-path.
-
-#### v1.8.1 - 23/08/2013 ####
-
-* Fixed image max size.
-* Fixed word-wrap for .hentry.
-* Fixed galleries styles.
-* Fixed wp-caption styles.
-
-#### v1.8.0 - 21/08/2013 ####
-
-* Added .editorconfig file.
-* Improved the Gruntfile.js.
-* Improved the .gitignore.
-* Added .jshintrc.
-* Added Bootstrap 3.0.
-* Removed Colorbox, Socialite.js, LazyLoad and PhotoSwipe from Odin's core.
-
-#### v1.7.2 - 02/08/2013 ####
-
-* Improved the Core JavaScript.
-
-#### v1.7.1 - 01/08/2013 ####
-
-* Fixed `Odin_Bootstrap_Nav_Walker` class to improved compatibility with WordPress 3.6.
-
-#### v1.7.0 - 27/07/2013 ####
-
-* Fixed the main navigation.
-* Updated the `Odin_Bootstrap_Nav_Walker` class.
-* Updated the Bootstrap files.
-* Fixed the Gruntfile.js.
-* Improved the code.
-
-#### v1.6.0 - 22/06/2013 ####
-
-* Fixed the translation.
-* Removed $sex in `Odin_Metabox` class and `Odin_Post_Type` class.
-
-#### v1.5.1 - 20/06/2013 ####
-
-* Fixed the translation.
-* Fixed Image Uplupload in `Odin_Theme_Options` class.
-* Updated the Bootstrap to version v2.3.2.
-
-#### v1.5.0 - 13/06/2013 ####
-
-* Added Image Uplupload field in `Odin_Theme_Options` class.
-* Added Input field type in `Odin_Theme_Options` class and `Odin_Metabox` class.
-* Optimized the `Odin_Theme_Options` class and `Odin_Metabox` class.
-* Modified the default language to en_US.
-* Added pt_BR translation.
-
-#### v1.4.0 - 26/05/2013 ####
-
-* Added Image Uplupload field in `Odin_Metabox` class.
-* Optimized the loading of scripts in `class-metabox.php`.
-* Fixed the plurals in `class-post-type.php` and `class-taxonomy.php`.
-* Moved the `odin_autoset_featured()` function to `functions.php`.
-* Fixed code standards.
-
-#### v1.3.0 - 17/05/2013 ####
-
-* Added Bootstrap.
-* Removed old SASS files.
-* Added Grunt task to updated and install the Bootstrap.
-* Refixed the Photoswipe.
-
-#### v1.2.6 - 17/05/2013 ####
-
-* Reordered the functions.php to load scripts always last.
-* Fixed the Photoswipe.
-
-#### v1.2.5 - 16/05/2013 ####
-
-* Fixed the Photoswipe feature.
-
-#### v1.2.4 - 15/05/2013 ####
-
-* Updated aq_resize to version 1.1.7.
-
-#### v1.2.3 - 14/05/2013 ####
-
-* Fixed core admin.js.
-
-#### v1.2.2 - 14/04/2013 ####
-
-* Improved file structure in SASS folder.
-* Added wp_trim_words() in odin_excerpt() function.
-
-#### v1.2.1 - 14/04/2013 ####
-
-* Added `options` argument in editor of Metabox class and Theme Options class.
-
-#### v1.2.0 - 02/04/2013 ####
-
-* Added FitVids.
-
-#### v1.1.0 - 27/03/2013 ####
-
-* Added Odin_Options_Helper class.
-* Added Grunt FTP.
-* Added Grunt rsync.
-
-#### v1.0.0 - 24/03/2013 ####
-
-* First Release.
diff --git a/docs/README-pt_BR.md b/docs/README-pt_BR.md
deleted file mode 100644
index da8b074..0000000
--- a/docs/README-pt_BR.md
+++ /dev/null
@@ -1,69 +0,0 @@
-# Odin Framework #
-
-[View this documentation in English](https://github.com/wpbrasil/odin/blob/master/README.md)
-
-
-
-* [Website](http://wpod.in/)
-* [Odin Expo](http://expo.wpod.in/)
-* [GitHub](https://github.com/wpbrasil/odin)
-* [Grupo WordPress Brasil no Facebook](https://www.facebook.com/groups/wordpress.brasil)
-
-## Descrição do Projeto ##
-
-Bem vindos ao Odin, um tema base desenvolvido pelo [Grupo WordPress Brasil](https://www.facebook.com/groups/wordpress.brasil), para auxiliar no desenvolvimento ágil de temas para WordPress.
-
-## Instalação ##
-
-Envie a pasta "odin" para a pasta de temas padrão do WordPress `wp-content/themes` ou simplesmente envie o arquivo zipado utilizando o instalador de temas do WordPress.
-
-## Documentação ##
-
-Informações de como usar as classes e funções do Odin na [Wiki Oficial](https://github.com/wpbrasil/odin/wiki/)
-
-## Suporte a plugins ##
-
-Odin suporta nativamente os plugins:
-
-* [WooCommerce](http://wordpress.org/extend/plugins/woocommerce/)
-* [JetPack](http://wordpress.org/extend/plugins/jetpack/) Infinite Scroll
-
-## Referências ##
-
-* [Bootstrap](http://getbootstrap.com/)
-* [Bootstrap Sass](https://github.com/twbs/bootstrap-sass)
-* [HTML5shiv](https://github.com/aFarkas/html5shiv)
-* [matchMedia() polyfill](https://github.com/paulirish/matchMedia.js/)
-* [Respond.js](https://github.com/scottjehl/Respond)
-* [Sass](http://sass-lang.com/)
-* [Compass](http://compass-style.org/)
-* [Grunt.js](http://gruntjs.com/)
-* [aq_resize](https://github.com/sy4mil/Aqua-Resizer)
-* [FitVids](https://github.com/davatron5000/FitVids.js)
-* [EditorConfig](http://editorconfig.org/)
-* [goqr.me](http://goqr.me/)
-* [Google Maps](https://developers.google.com/maps/)
-
-## Bugs e Sugestões ##
-
-O Odin é um projeto **Open Source**. Qualquer um pode (e deveria) ajudar a melhorá-lo.
-
-Reporte bugs ou faça sugestões utilizando o [Issues/Fórum do Projeto](https://github.com/wpbrasil/odin/issues)
-
-## Contribua com o Projeto ##
-
-Para contribuir basta clicar no botão **Fork**, criar um *Branch*, arrumar o código e enviá-lo com um **Pull Request**.
-
-Mais detalhes de como contribuir e enviar Pull Requests em [GitHub Collaborating](https://help.github.com/categories/63/articles).
-
-[Como colaborar com projetos opensource com GitHub](http://www.youtube.com/watch?v=H3olaBo83As)
-
-## Changelog ##
-
-[Changelog aqui!](https://github.com/wpbrasil/odin/blob/master/docs/CHANGELOG.md)
-
-## Copyright e Licença ##
-
-Copyright 2013 - 2018 - Grupo WordPress Brasil.
-
-O código PHP esta licenciado sob a Licença [GPLv2](http://www.gnu.org/licenses/gpl-2.0.txt). Todos os arquivos CSS, SCSS, JS, imagens e outros não incluindo arquivos PHP estão licenciados como [MIT](http://opensource.org/licenses/MIT) ou pela licença especificada dentro de seus arquivos.
diff --git a/docs/pt-BR/README.md b/docs/pt-BR/README.md
new file mode 100644
index 0000000..354e37a
--- /dev/null
+++ b/docs/pt-BR/README.md
@@ -0,0 +1,32 @@
+
+
+# Odin
+
+Odin é um tema base desenvolvido pela comunidade [@wpbrasil](https://github.com/wpbrasil) para ~chutar bundas~ auxiliar o desenvolvimento de temas para WordPress.
+
+* [Odin](http://wpod.in/)
+* [Docs](https://github.com/wpbrasil/odin/tree/master/docs)
+* [Expo](http://expo.wpod.in/)
+* [Toolkit](https://github.com/wpbrasil/odin-toolkit)
+* [WordPress Brasil](https://github.com/wpbrasil/)
+
+## Começo rápido
+
+```bash
+# Instale as dependencias
+npm install
+
+# Inicia serve com livereload em localhost:3000
+npm run dev
+
+# Compila/minifica arquivos fonte (scss, js e etc) para produção
+npm run build
+```
+
+Para mais informações de como o Odin funciona, consulte nossa [documentação](https://github.com/wpbrasil/odin/tree/master/docs).
+
+## Licença
+
+[MIT](http://opensource.org/licenses/MIT). Exceto arquivos PHP, que estão sob a Licença [GPLv2](http://www.gnu.org/licenses/gpl-2.0.txt).
+
+Copyright (c) 2013-Atualmente, [@wpbrasil](https://github.com/wpbrasil).
diff --git a/footer.php b/footer.php
index 0f4127f..85a0479 100644
--- a/footer.php
+++ b/footer.php
@@ -2,23 +2,29 @@
/**
* The template for displaying the footer.
*
- * Contains footer content and the closing of the
- * #main div element.
+ * Contains the closing of the all elements after.
+ *
+ * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Odin
- * @since 2.2.0
+ * @subpackage Custom_Theme
*/
+
?>
-
-
+
+
+
+
+
-
+
+
+
+
+
+
diff --git a/functions.php b/functions.php
index a14b1ca..2717213 100644
--- a/functions.php
+++ b/functions.php
@@ -1,317 +1,34 @@
__( 'Main Menu', 'odin' )
- )
- );
-
- /*
- * Add post_thumbnails suport.
- */
- add_theme_support( 'post-thumbnails' );
-
- /**
- * Add feed link.
- */
- add_theme_support( 'automatic-feed-links' );
-
- /**
- * Support Custom Header.
- */
- $default = array(
- 'width' => 0,
- 'height' => 0,
- 'flex-height' => false,
- 'flex-width' => false,
- 'header-text' => false,
- 'default-image' => '',
- 'uploads' => true,
- );
-
- add_theme_support( 'custom-header', $default );
-
- /**
- * Support Custom Background.
- */
- $defaults = array(
- 'default-color' => '',
- 'default-image' => '',
- );
-
- add_theme_support( 'custom-background', $defaults );
-
- /**
- * Support Custom Editor Style.
- */
- add_editor_style( 'assets/css/editor-style.css' );
-
- /**
- * Add support for infinite scroll.
- */
- add_theme_support(
- 'infinite-scroll',
- array(
- 'type' => 'scroll',
- 'footer_widgets' => false,
- 'container' => 'content',
- 'wrapper' => false,
- 'render' => false,
- 'posts_per_page' => get_option( 'posts_per_page' )
- )
- );
-
- /**
- * Add support for Post Formats.
- */
- // add_theme_support( 'post-formats', array(
- // 'aside',
- // 'gallery',
- // 'link',
- // 'image',
- // 'quote',
- // 'status',
- // 'video',
- // 'audio',
- // 'chat'
- // ) );
-
- /**
- * Support The Excerpt on pages.
- */
- // add_post_type_support( 'page', 'excerpt' );
-
- /**
- * Switch default core markup for search form, comment form, and comments to output valid HTML5.
- */
- add_theme_support(
- 'html5',
- array(
- 'search-form',
- 'comment-form',
- 'comment-list',
- 'gallery',
- 'caption'
- )
- );
-
- /*
- * Let WordPress manage the document title.
- * By adding theme support, we declare that this theme does not use a
- * hard-coded tag in the document head, and expect WordPress to
- * provide it for us.
- */
- add_theme_support( 'title-tag' );
-
- /*
- * Enable support for custom logo.
- *
- * @since Odin 2.2.10
- */
- add_theme_support( 'custom-logo', array(
- 'height' => 240,
- 'width' => 240,
- 'flex-height' => true,
- ) );
- }
-}
-
-add_action( 'after_setup_theme', 'odin_setup_features' );
-
-/**
- * Register widget areas.
- *
- * @since 2.2.0
- */
-function odin_widgets_init() {
- register_sidebar(
- array(
- 'name' => __( 'Main Sidebar', 'odin' ),
- 'id' => 'main-sidebar',
- 'description' => __( 'Site Main Sidebar', 'odin' ),
- 'before_widget' => '',
- 'before_title' => '',
- )
- );
-}
-
-add_action( 'widgets_init', 'odin_widgets_init' );
-
-/**
- * Flush Rewrite Rules for new CPTs and Taxonomies.
- *
- * @since 2.2.0
- */
-function odin_flush_rewrite() {
- flush_rewrite_rules();
-}
-
-add_action( 'after_switch_theme', 'odin_flush_rewrite' );
-
-/**
- * Load site scripts.
- *
- * @since 2.2.0
- */
-function odin_enqueue_scripts() {
- $template_url = get_template_directory_uri();
-
- // Loads Odin main stylesheet.
- wp_enqueue_style( 'odin-style', get_stylesheet_uri(), array(), null, 'all' );
-
- // Html5Shiv
- wp_enqueue_script( 'html5shiv', $template_url . '/assets/js/html5.js' );
- wp_script_add_data( 'html5shiv', 'conditional', 'lt IE 9' );
-
- // General scripts.
- if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ) {
- // Bootstrap.
- wp_enqueue_script( 'bootstrap', $template_url . '/assets/js/libs/bootstrap.min.js', array( 'jquery' ), null, true );
-
- // FitVids.
- wp_enqueue_script( 'fitvids', $template_url . '/assets/js/libs/jquery.fitvids.js', array( 'jquery' ), null, true );
-
- // Main.
- wp_enqueue_script( 'odin-main', $template_url . '/assets/js/main.js', array( 'jquery' ), null, true );
- } else {
- // Grunt main file with Bootstrap, FitVids and others libs.
- wp_enqueue_script( 'odin-main-min', $template_url . '/assets/js/main.min.js', array( 'jquery' ), null, true );
- }
-
- // Grunt watch livereload in the browser.
- // wp_enqueue_script( 'odin-livereload', 'http://localhost:35729/livereload.js?snipver=1', array(), null, true );
-
- // Load Thread comments WordPress script.
- if ( is_singular() && get_option( 'thread_comments' ) ) {
- wp_enqueue_script( 'comment-reply' );
- }
-}
-
-add_action( 'wp_enqueue_scripts', 'odin_enqueue_scripts', 1 );
-
-/**
- * Odin custom stylesheet URI.
- *
- * @since 2.2.0
- *
- * @param string $uri Default URI.
- * @param string $dir Stylesheet directory URI.
- *
- * @return string New URI.
- */
-function odin_stylesheet_uri( $uri, $dir ) {
- return $dir . '/assets/css/style.css';
-}
-
-add_filter( 'stylesheet_uri', 'odin_stylesheet_uri', 10, 2 );
-
-/**
- * Query WooCommerce activation
- *
- * @since 2.2.6
- *
- * @return boolean
- */
-if ( ! function_exists( 'is_woocommerce_activated' ) ) {
- function is_woocommerce_activated() {
- return class_exists( 'woocommerce' ) ? true : false;
- }
-}
-
-/**
- * Core Helpers.
- */
-require_once get_template_directory() . '/core/helpers.php';
-
-/**
- * WP Custom Admin.
- */
-require_once get_template_directory() . '/inc/admin.php';
-
-/**
- * Comments loop.
- */
-require_once get_template_directory() . '/inc/comments-loop.php';
-
-/**
- * WP optimize functions.
- */
-require_once get_template_directory() . '/inc/optimize.php';
-
-/**
- * Custom template tags.
- */
-require_once get_template_directory() . '/inc/template-tags.php';
+require_once get_template_directory() . '/inc/theme/theme.php';
/**
- * WooCommerce compatibility files.
+ * Woocommerce.
*/
-if ( is_woocommerce_activated() ) {
- add_theme_support( 'woocommerce' );
- require get_template_directory() . '/inc/woocommerce/hooks.php';
- require get_template_directory() . '/inc/woocommerce/functions.php';
- require get_template_directory() . '/inc/woocommerce/template-tags.php';
-}
+require_once get_template_directory() . '/inc/woocommerce/woocommerce.php';
diff --git a/gulpfile.js b/gulpfile.js
new file mode 100644
index 0000000..33dcc51
--- /dev/null
+++ b/gulpfile.js
@@ -0,0 +1,211 @@
+/**
+ * Packages
+ */
+
+// General
+const fs = require('fs');
+const path = require('path');
+const browserSync = require('browser-sync').create();
+const gulp = require('gulp');
+const fileInclude = require('gulp-file-include');
+const flatten = require('gulp-flatten');
+const header = require('gulp-header');
+const plumber = require('gulp-plumber');
+const rename = require('gulp-rename');
+const package = require('./package.json');
+const env = process.env.NODE_ENV === 'production' ? 'production' : 'development';
+
+// Scripts
+const jshint = require('gulp-jshint');
+const stylish = require('jshint-stylish');
+const uglify = require('gulp-uglify');
+
+// Styles
+const sass = require('gulp-sass');
+const sassGlob = require('gulp-sass-glob');
+
+// Media.
+const imagemin = require('gulp-imagemin');
+
+// Language.
+const checktextdomain = require('gulp-checktextdomain');
+
+/**
+ * Config to project
+ */
+const config = {
+ "banner":
+ "/*!\n" +
+ " * <%= package.name %> v<%= package.version %> <<%= package.homepage %>>\n"+
+ " * <%= package.title %> : <%= package.description %>\n" +
+ " * (c) " + new Date().getFullYear() + " <%= package.author.name %> <<%= package.author.url %>>\n" +
+ " * <%= package.license.type %> License <<%= package.license.url %>>\n" +
+ " * <%= package.repository.url %>\n" +
+ " */\n\n",
+ "js": {
+ "src": "{assets,components}/**/*.js",
+ "dest": "dist/js/"
+ },
+ "css": {
+ "src": "{assets,components}/**/*.{scss,sass}",
+ "dest": "dist/css/",
+ "includePaths": [
+ path.resolve(__dirname, "./"),
+ path.resolve(__dirname, "./assets/css/"),
+ path.resolve(__dirname, "./node_modules/")
+ ]
+ },
+ "images": {
+ "src": "assets/img/**/*",
+ "dest": "dist/img/"
+ },
+ "fonts": {
+ "src": "{assets/fonts/**/,node_modules/@fortawesome/fontawesome-free-webfonts/webfonts/}",
+ "dest": "dist/fonts/"
+ }
+}
+
+/**
+ * Gulp Taks
+ */
+
+// Lint scripts
+gulp.task('js:lint', function() {
+ return gulp.src(config.js.src)
+ .pipe(plumber())
+ .pipe(jshint())
+ .pipe(jshint.reporter('jshint-stylish'));
+});
+
+// File include and concatenate scripts
+gulp.task('js:compile', ['js:lint'], function() {
+ return gulp.src(config.js.src)
+ .pipe(plumber())
+ .pipe(fileInclude({
+ prefix: '@@',
+ basepath: '@file'
+ }))
+ .pipe(flatten())
+ .pipe(gulp.dest(config.js.dest))
+ .pipe(browserSync.stream());
+});
+
+// Compress and add banner scripts
+gulp.task('js:dist', ['js:compile'], function() {
+ return gulp.src([config.js.dest+'*.js','!'+config.js.dest+'*.min.js'])
+ .pipe(plumber())
+ .pipe(uglify())
+ .pipe(rename({suffix: ".min"}))
+ .pipe(header(config.banner, {package: package}))
+ .pipe(flatten())
+ .pipe(gulp.dest(config.js.dest));
+});
+
+// Process SASS files styles
+gulp.task('css:compile', function() {
+ return gulp.src(config.css.src)
+ .pipe(plumber())
+ .pipe(sassGlob())
+ .pipe(sass({
+ outputStyle: 'expanded',
+ sourceComments: true,
+ includePaths: config.css.includePaths,
+ indentedSyntax: false
+ }).on('error', sass.logError))
+ .pipe(flatten())
+ .pipe(gulp.dest(config.css.dest))
+ .pipe(browserSync.stream());
+});
+
+// Compress and add banner scripts
+gulp.task('css:dist', ['css:compile'], function() {
+ return gulp.src(config.css.src)
+ .pipe(plumber())
+ .pipe(sassGlob())
+ .pipe(sass({
+ outputStyle: 'compressed',
+ sourceComments: false,
+ includePaths: config.css.includePaths,
+ indentedSyntax: false
+ }).on('error', sass.logError))
+ .pipe(rename({suffix: '.min'}))
+ .pipe(header(config.banner, {package: package}))
+ .pipe(flatten())
+ .pipe(gulp.dest(config.css.dest));
+});
+
+// Copy image src -> dist to watch
+gulp.task('img:compile', function() {
+ return gulp.src(config.images.src)
+ .pipe(plumber())
+ .pipe(gulp.dest(config.images.dest))
+ .pipe(browserSync.stream());
+});
+
+// Compress image files
+gulp.task('img:dist', function() {
+ return gulp.src(config.images.src)
+ .pipe(plumber())
+ .pipe(imagemin())
+ .pipe(gulp.dest(config.images.dest));
+});
+
+// Copy fonts files to dist
+gulp.task('fonts:dist', function() {
+ return gulp.src(config.fonts.src+'*.{svg,eot,ttf,woff,woff2}')
+ .pipe(flatten())
+ .pipe(gulp.dest(config.fonts.dest));
+});
+
+// Check text domain in PHP files
+gulp.task('lang:checktextdomain', function() {
+ return gulp
+ .src(['**/*.php','!node_modules'])
+ .pipe(checktextdomain({
+ text_domain: package.name,
+ keywords: [
+ '__:1,2d',
+ '_e:1,2d',
+ '_x:1,2c,3d',
+ 'esc_html__:1,2d',
+ 'esc_html_e:1,2d',
+ 'esc_html_x:1,2c,3d',
+ 'esc_attr__:1,2d',
+ 'esc_attr_e:1,2d',
+ 'esc_attr_x:1,2c,3d',
+ '_ex:1,2c,3d',
+ '_n:1,2,4d',
+ '_nx:1,2,4c,5d',
+ '_n_noop:1,2,3d',
+ '_nx_noop:1,2,3c,4d'
+ ],
+ }));
+});
+
+// Starts a BrowerSync instance
+gulp.task('serve', function(){
+ browserSync.init(package.serveDev);
+});
+
+// Watch files for changes
+gulp.task('watch', ['default'], function(done) {
+ gulp.watch(config.images.src, ['img:compile']);
+ gulp.watch(config.css.src, ['css:compile']);
+ gulp.watch(config.js.src, ['js:compile']);
+ gulp.watch(['**/*.php']).on('change', browserSync.reload);
+});
+
+// Compile and compress js, css and img. Move others files to dist, like app/fonts directory (default)
+gulp.task('default', [
+ 'js:dist',
+ 'css:dist',
+ 'img:dist',
+ 'fonts:dist'
+]);
+
+// Compile, init serve and watch files
+gulp.task('dev-server', [
+ 'default',
+ 'serve',
+ 'watch'
+]);
diff --git a/header.php b/header.php
index 1a770f9..c46ffa2 100644
--- a/header.php
+++ b/header.php
@@ -1,105 +1,39 @@
section and everything up till #main div
+ * This is the template that displays all of the section and everything up until
+ *
+ * @link https://developer.wordpress.org/themes/basics/template-files/#template-partials
*
* @package Odin
- * @since 2.2.0
+ * @subpackage Custom_Theme
*/
+
?>
->
+>
-
+
-
-
-
>
-
-
-
-
-
-
-